From: Paul Floyd Date: Thu, 23 Nov 2023 06:45:09 +0000 (+0100) Subject: FreeBSD regtest: new aio test sometimes hangs in infinite aio_error loop X-Git-Tag: VALGRIND_3_23_0~241 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b0a1bc86722f18f2195fbd060f431bad6cc32a2;p=thirdparty%2Fvalgrind.git FreeBSD regtest: new aio test sometimes hangs in infinite aio_error loop Put a limit on the loop. Need to check if this is not a problem with aio_read corrupting memory. --- diff --git a/memcheck/tests/freebsd/aio.c b/memcheck/tests/freebsd/aio.c index 999eecb6f6..54e8006d33 100644 --- a/memcheck/tests/freebsd/aio.c +++ b/memcheck/tests/freebsd/aio.c @@ -59,7 +59,12 @@ int main(void) // (don't crash on the repeated &a) assert( aio_read(&a) == 0 ); - while (0 != aio_error(&a)) { } + int try_count = 0; + while (0 != aio_error(&a) && try_count < 10000) { + ++try_count; + } + + assert(try_count < 10000); assert( aio_return(&a) > 0 ); // XXX: (undefined value error here) diff --git a/memcheck/tests/freebsd/aio.stderr.exp b/memcheck/tests/freebsd/aio.stderr.exp index b40b054d15..1578e573e4 100644 --- a/memcheck/tests/freebsd/aio.stderr.exp +++ b/memcheck/tests/freebsd/aio.stderr.exp @@ -16,7 +16,7 @@ Conditional jump or move depends on uninitialised value(s) Syscall param aio_write(iocb->aio_buf) points to unaddressable byte(s) at 0x........: aio_write (in /...libc...) - by 0x........: main (aio.c:77) + by 0x........: main (aio.c:82) Address 0x........ is not stack'd, malloc'd or (recently) free'd