public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix tst-aio7.
@ 2003-03-06 15:11 Martin Schwidefsky
  2003-03-06 19:17 ` Roland McGrath
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Schwidefsky @ 2003-03-06 15:11 UTC (permalink / raw)
  To: libc-hacker

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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-03-06 20:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-06 15:11 [PATCH] Fix tst-aio7 Martin Schwidefsky
2003-03-06 19:17 ` Roland McGrath
2003-03-06 19:32   ` Ulrich Drepper
2003-03-06 19:37     ` Roland McGrath
2003-03-06 19:56       ` Ulrich Drepper
2003-03-06 20:21         ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).