This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix tst-aio7.


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 at de dot ibm dot 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]