From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8931 invoked by alias); 26 Nov 2003 09:40:21 -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 8904 invoked from network); 26 Nov 2003 09:40:20 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sources.redhat.com with SMTP; 26 Nov 2003 09:40:20 -0000 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 82CFF184BC77 for ; Wed, 26 Nov 2003 10:40:19 +0100 (CET) Received: by reger.suse.de (Postfix, from userid 659) id C6CB6D0835; Wed, 26 Nov 2003 10:40:18 +0100 (CET) To: Thorsten Kukuk Cc: libc-hacker@sources.redhat.com Subject: Re: nptl/tst-execstack on AMD64/kernel 2.9.0-test9 References: <20031118092847.GA27667@suse.de> From: Andreas Jaeger Date: Wed, 26 Nov 2003 10:01:00 -0000 In-Reply-To: <20031118092847.GA27667@suse.de> (Thorsten Kukuk's message of "Tue, 18 Nov 2003 10:28:47 +0100") Message-ID: User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2003-11/txt/msg00143.txt.bz2 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2200 Thorsten Kukuk writes: > Hi, > > On AMD64, the nptl/tst-execstack fails with kernel 2.6.0-test9 in > pthread_barrier_wait (&go_barrier); > > strace shows, that one process is doing a mmap, while a second=20 > process is segfaulting at the same time. > > I'm using gcc 3.3.2 and binutils 2.14.90.0.7, all other tests passes. > > Does somebody else see this? Is this a kernel problem or a glibc one? The problem is a bug in dl-execstack. If the mprotect call succeeds (it does not succeed on the 2.4 Red Hat kernel), then we do not set dl_stack_flags. I propose the following patch, it passes the test now. Ok to commit? Andreas 2003-11-26 Andreas Jaeger * sysdeps/unix/sysv/linux/dl-execstack.c (_dl_make_stack_executable): Set dl_stack_flags always for success. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Index: sysdeps/unix/sysv/linux/dl-execstack.c --- sysdeps/unix/sysv/linux/dl-execstack.c 25 Sep 2003 23:04:12 -0000 1.3 +++ sysdeps/unix/sysv/linux/dl-execstack.c 26 Nov 2003 09:39:20 -0000 @@ -40,7 +40,7 @@ _dl_make_stack_executable (void) { if (__mprotect ((void *) page, GL(dl_pagesize), PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) =3D=3D 0) - return 0; + goto return_success; if (errno !=3D EINVAL) return errno; no_growsdown =3D true; @@ -91,7 +91,7 @@ _dl_make_stack_executable (void) { if (__mprotect ((void *) page, GL(dl_pagesize), PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSUP) =3D=3D 0) - return 0; + goto return_success; if (errno !=3D EINVAL) return errno; no_growsup =3D true; @@ -132,6 +132,8 @@ _dl_make_stack_executable (void) # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP" #endif =20 + + return_success:=20=20 /* Remember that we changed the permission. */ GL(dl_stack_flags) |=3D PF_X; =20 --=20 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N=FCrnberg, Germany GPG fingerprint =3D 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 --=-=-= Content-Type: application/pgp-signature Content-length: 188 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/xHUCOJpWPMJyoSYRAooYAKCJw7htDyRkwluaCm2p9ffEvfjD3QCcDxll KCqU4kH92wbXbTt9sVQ+HQk= =nfSN -----END PGP SIGNATURE----- --=-=-=--