public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: libc-hacker@sources.redhat.com
Subject: [PATCH] Fix tst-aio7.
Date: Thu, 06 Mar 2003 15:11:00 -0000	[thread overview]
Message-ID: <200303061609.43984.schwidefsky@de.ibm.com> (raw)

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;

             reply	other threads:[~2003-03-06 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-06 15:11 Martin Schwidefsky [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200303061609.43984.schwidefsky@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).