[PATCH] Fix tst-aio7.

Martin Schwidefsky schwidefsky@de.ibm.com
Thu Mar 6 15:11:00 GMT 2003


Hi,
the tst-aio7 testcase sometimes fails for s390-64. After some
debugging I found out why. The aio_suspend test starts
a read on aio buffer cb1. This read never completes.
The aio buffer is still enqueued when the block that
contains the aiocb structure is left. The exit processing
will cancel the i/o and the exit status will be written to the
stack which is reused for a stack frame in the meantime.
This sometimes segfaults on s390-64, sometimes it works.
The fix is simple: cancel the i/o before leaving the block
that defines cb1.

blue skies,
  Martin.

2003-03-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* rt/tst-aio7.c (do_test): Cancel i/o on cb1.

diff -urN libc/rt/tst-aio7.c libc-aiofix/rt/tst-aio7.c
--- libc/rt/tst-aio7.c	Mon Sep 30 09:19:21 2002
+++ libc-aiofix/rt/tst-aio7.c	Thu Mar  6 10:38:00 2003
@@ -180,6 +180,14 @@
 	puts ("aio_suspend([done,blocked],2,3) suspended thread");
 	++result;
       }
+
+    /* Cancel i/o on cb1. */
+    r = aio_cancel (piped[0], &cb1);
+    if (r != AIO_CANCELED)
+      {
+	puts ("aio_cancel did not return AIO_CANCELED");
+	++result;
+      }
   }
 
   return result;



More information about the Libc-hacker mailing list