From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11940 invoked by alias); 6 Mar 2003 15:11:59 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 11920 invoked from network); 6 Mar 2003 15:11:58 -0000 Received: from unknown (HELO d06lmsgate-5.uk.ibm.com) (195.212.29.5) by 172.16.49.205 with SMTP; 6 Mar 2003 15:11:58 -0000 Received: from d06relay02.portsmouth.uk.ibm.com (d06relay02.uk.ibm.com [9.166.84.148]) by d06lmsgate-5.uk.ibm.com (1.0.0) with ESMTP id PAA77234 for ; Thu, 6 Mar 2003 15:08:55 GMT Received: from dyn-9-152-242-64.boeblingen.de.ibm.com (dyn-9-152-242-64.boeblingen.de.ibm.com [9.152.242.64]) by d06relay02.portsmouth.uk.ibm.com (8.12.3/NCO/VER6.5) with ESMTP id h26FB1al157782 for ; Thu, 6 Mar 2003 15:11:02 GMT From: Martin Schwidefsky Organization: IBM Deutschland GmbH To: libc-hacker@sources.redhat.com Subject: [PATCH] Fix tst-aio7. Date: Thu, 06 Mar 2003 15:11:00 -0000 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200303061609.43984.schwidefsky@de.ibm.com> X-SW-Source: 2003-03/txt/msg00011.txt.bz2 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 * 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 =3D aio_cancel (piped[0], &cb1); + if (r !=3D AIO_CANCELED) + { + puts ("aio_cancel did not return AIO_CANCELED"); + ++result; + } } =20 return result;