From owner-freebsd-toolchain@FreeBSD.ORG Sun Apr 29 16:43:11 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 727FE106564A for ; Sun, 29 Apr 2012 16:43:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0D7988FC15 for ; Sun, 29 Apr 2012 16:43:10 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q3TGh1iN068403; Sun, 29 Apr 2012 19:43:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q3TGh1od002549; Sun, 29 Apr 2012 19:43:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q3TGh0L7002548; Sun, 29 Apr 2012 19:43:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 29 Apr 2012 19:43:00 +0300 From: Konstantin Belousov To: Marcel Moolenaar Message-ID: <20120429164300.GR2358@deviant.kiev.zoral.com.ua> References: <7B7A25D1-E99D-486A-B1CA-A5CFEA837B81@xcllnt.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BIyeO76nyr1ZoJNi" Content-Disposition: inline In-Reply-To: <7B7A25D1-E99D-486A-B1CA-A5CFEA837B81@xcllnt.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: toolchain@freebsd.org, Dmitry Mikulin Subject: Re: [GDB follow-fork] behavior change for wait() X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Apr 2012 16:43:11 -0000 --BIyeO76nyr1ZoJNi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 27, 2012 at 03:33:49PM -0700, Marcel Moolenaar wrote: > Hi Dmitry, >=20 > I've been testing the follow-fork changes in GDB and ran into some weird > behavior. Without gdb, my test program (attached) prints something like: >=20 > fbsdvm% ./fe=20 > fe(41042): initial process. Doing fork & exec... > fe(41043): child after fork. Doing exec... > fe(41043): child after exec. Exiting... > fe(41042): child 41043 exited with status 0 >=20 > In particular: the parent (pid=3D41042) calls wait(2) to reap the child a= nd > the child exits with 0. >=20 > Under gdb, I see this: >=20 > fbsdvm% gdb ./fe > GNU gdb 6.1.1 [FreeBSD] > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you = are > welcome to change it and/or distribute copies of it under certain conditi= ons. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for detail= s. > This GDB was configured as "i386-marcel-freebsd"... > (gdb) br main > Breakpoint 1 at 0x80487b0: file fe.c, line 14. > (gdb) run > Starting program: /usr/home/marcel/fe=20 >=20 > Breakpoint 1, main (argc=3DError accessing memory address 0x1: Bad addres= s. > ) at fe.c:14 > 14 { > (gdb) n > main (argc=3D1, argv=3D0xbfbfebb4) at fe.c:19 > 19 if (getenv("__FE_FORKED__") !=3D NULL) { > (gdb) c > Continuing. > fe(41141): initial process. Doing fork & exec... > [New process 41143] > fe(41143): child after fork. Doing exec... > fe(41143): child after exec. Exiting... > fe(41141): wait(2) failed with error 10 (No child processes) >=20 > Program exited normally. > (gdb)=20 >=20 > When stepping at least once, the inferior will not be able to properly wa= it(2) > for its child as it seems to have been reaped already. I suspect this is = done > by the debugger -- unintentionally at least. >=20 > Have you seen this before? How old is your kernel ? In particular, do you have r232048+r232104+r232947+r232975+r233808+r233809 ? I cannot reproduce your issue on recent kernels and patched gdb. --BIyeO76nyr1ZoJNi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+db5QACgkQC3+MBN1Mb4j98wCfWt9bOJBEZGjo5E8MD3YxfXxP I0EAn34ENM+jKxWbxhfmzjH2xn/MKDrh =S5ZC -----END PGP SIGNATURE----- --BIyeO76nyr1ZoJNi-- From owner-freebsd-toolchain@FreeBSD.ORG Sun Apr 29 18:22:49 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B13AA106564A; Sun, 29 Apr 2012 18:22:49 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6258FC12; Sun, 29 Apr 2012 18:22:49 +0000 (UTC) Received: by qcsg15 with SMTP id g15so1368242qcs.13 for ; Sun, 29 Apr 2012 11:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=pQBDijj5AbtUUhsu7Ls02Y1k7uabeT0pM1h997xUJRE=; b=ih2LKu3MhUDYh1ODdVcSSdUAQQO4RTNBducUzepeC/F5dW0bGRACFq1X9kroxMBBG0 5nv9ZtGPIGTxd8BW+Ii8NV9BLjC3lN0KqX7mNk7k4EWT67TZGX6H4XyDOKFNz8WzH5zT rzs2tQwhcp5XEn0Av/jmWR5qxco37WYfVtxdfA/dkBfb436HE1w6XW865nEoL4UuqPcy jlJyj0t6/XxHQDI/G/qe9qe0r0ObN7GybQjt8/4wMU30mC0Pr2n78TbOZoRSV7sgNSCo PXculjHeCWYMbh8BIcZcYZ+x45zr/GFuj76f6QD+Wz6Zdp94UROeY940mslA6CJK9pZt H4aQ== Received: by 10.229.135.202 with SMTP id o10mr4772635qct.84.1335723768502; Sun, 29 Apr 2012 11:22:48 -0700 (PDT) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPS id gw8sm21100057qab.7.2012.04.29.11.22.47 (version=SSLv3 cipher=OTHER); Sun, 29 Apr 2012 11:22:47 -0700 (PDT) Date: Sun, 29 Apr 2012 14:22:41 -0400 From: Alexander Kabaev To: Konstantin Belousov Message-ID: <20120429142241.646db441@kan.dyndns.org> In-Reply-To: <20120415144322.GU2358@deviant.kiev.zoral.com.ua> References: <4F3C5A3A.6050107@FreeBSD.org> <20120216154730.GL3283@deviant.kiev.zoral.com.ua> <4F5C7764.2@marino.st> <20120415144322.GU2358@deviant.kiev.zoral.com.ua> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/g5OYvipX5G=6G26.XpE_.pV"; protocol="application/pgp-signature" Cc: kan@freebsd.org, John Marino , Pedro Giffuni , freebsd-toolchain@freebsd.org Subject: Re: DragonFly added DT_GNU_HASH support to rtld X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Apr 2012 18:22:49 -0000 --Sig_/g5OYvipX5G=6G26.XpE_.pV Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 15 Apr 2012 17:43:22 +0300 Konstantin Belousov wrote: > On Sun, Mar 11, 2012 at 10:59:00AM +0100, John Marino wrote: > > Hi Konstantin, > >=20 > > It seems that no BSD supported DT_GNU_HASH despite this option > > being available on the base binutils (FreeBSD's 2.17.50 binutils > > supports it). This gnu extension is a big performance improvement > > over the specified SysV hash. > >=20 > > The guy porting libreoffice to pkgsrc was finding > > -Wl,--hash-style=3Dgnu to be the default build for that package. > > Indeed, using the standard hash results in very long startup times > > for something like Writer (> 8 seconds launched from a SSD) > >=20 > > The result is that we brought in DT_GNU_HASH support to our > > real-time linker this weekend. We're still waiting to see how that > > improves libreoffice startup times. > >=20 > > full commit: > > >http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7629c6317998f8= 50ebca23c296822ba08af09e5b > >=20 > >=20 > > Modification to base compiler so all system libs and binaries can > > take advantage of it: > > >http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4687ecd9561d76= f3d02ccb4f7adeecd5e3afdd8f > >=20 > >=20 > > For a while, binaries with dynamic symbol tables will have both > > types of hashes embedded. At some point in the future, we may > > switch over to only generating the GNU hash. This will break > > forward compatibility, but that happens rather frequently for other > > reasons anyway. > >=20 > > I was a bit surprised FreeBSD didn't already have this > > functionality given the performance benefits, so hopefully these > > DragonFly commits will be interesting for you. > >=20 >=20 > I finally ported the Dragonfly commit to FreeBSD. There were several > changes reverted in dragonfly version of the extracted > matched_symbol() function which were restored. I also blindly > converted all non-x86 arches. >=20 > The matched_symbol() extraction is the good opportunity to apply the > style(9) formatting to the large chunk of rtld code. >=20 > Any testers, esp. on non-x86 architectures, are welcome. You would > need to modify gcc spec file for you architecture, see corresponding > x86 changes in contrib/gcc/config/i386. >=20 > For me, patch successfully worked on the machine were I disabled sysv > hashes at all. >=20 > http://people.freebsd.org/~kib/misc/rtld-gnu_hash.1.patch Nothing jumps out, looks good. I am not a fan of mixing and matching different styles within the same file though.=20 --=20 Alexander Kabaev --Sig_/g5OYvipX5G=6G26.XpE_.pV Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iD8DBQFPnYb2Q6z1jMm+XZYRAvzaAJ9wPWBG7egHmFqwDyLwFH125zri1QCeM0es E3xRgyGgvWiCc1hTgo4MW7w= =PU+1 -----END PGP SIGNATURE----- --Sig_/g5OYvipX5G=6G26.XpE_.pV-- From owner-freebsd-toolchain@FreeBSD.ORG Sun Apr 29 23:39:26 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 981FF106566B for ; Sun, 29 Apr 2012 23:39:26 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 44F9A8FC0A for ; Sun, 29 Apr 2012 23:39:26 +0000 (UTC) Received: from dhcp-192-168-2-58.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q3TNdCDR069419 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 29 Apr 2012 16:39:20 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20120429164300.GR2358@deviant.kiev.zoral.com.ua> Date: Sun, 29 Apr 2012 16:39:12 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1D36CFB0-C4DA-4312-B200-58ABA0937977@xcllnt.net> References: <7B7A25D1-E99D-486A-B1CA-A5CFEA837B81@xcllnt.net> <20120429164300.GR2358@deviant.kiev.zoral.com.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1257) Cc: toolchain@freebsd.org, Dmitry Mikulin Subject: Re: [GDB follow-fork] behavior change for wait() X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Apr 2012 23:39:26 -0000 On Apr 29, 2012, at 9:43 AM, Konstantin Belousov wrote: > On Fri, Apr 27, 2012 at 03:33:49PM -0700, Marcel Moolenaar wrote: >> Hi Dmitry, >>=20 >> I've been testing the follow-fork changes in GDB and ran into some = weird >> behavior. Without gdb, my test program (attached) prints something = like: >>=20 >> fbsdvm% ./fe=20 >> fe(41042): initial process. Doing fork & exec... >> fe(41043): child after fork. Doing exec... >> fe(41043): child after exec. Exiting... >> fe(41042): child 41043 exited with status 0 >>=20 >> In particular: the parent (pid=3D41042) calls wait(2) to reap the = child and >> the child exits with 0. >>=20 >> Under gdb, I see this: >>=20 >> fbsdvm% gdb ./fe >> GNU gdb 6.1.1 [FreeBSD] >> Copyright 2004 Free Software Foundation, Inc. >> GDB is free software, covered by the GNU General Public License, and = you are >> welcome to change it and/or distribute copies of it under certain = conditions. >> Type "show copying" to see the conditions. >> There is absolutely no warranty for GDB. Type "show warranty" for = details. >> This GDB was configured as "i386-marcel-freebsd"... >> (gdb) br main >> Breakpoint 1 at 0x80487b0: file fe.c, line 14. >> (gdb) run >> Starting program: /usr/home/marcel/fe=20 >>=20 >> Breakpoint 1, main (argc=3DError accessing memory address 0x1: Bad = address. >> ) at fe.c:14 >> 14 { >> (gdb) n >> main (argc=3D1, argv=3D0xbfbfebb4) at fe.c:19 >> 19 if (getenv("__FE_FORKED__") !=3D NULL) { >> (gdb) c >> Continuing. >> fe(41141): initial process. Doing fork & exec... >> [New process 41143] >> fe(41143): child after fork. Doing exec... >> fe(41143): child after exec. Exiting... >> fe(41141): wait(2) failed with error 10 (No child processes) >>=20 >> Program exited normally. >> (gdb)=20 >>=20 >> When stepping at least once, the inferior will not be able to = properly wait(2) >> for its child as it seems to have been reaped already. I suspect this = is done >> by the debugger -- unintentionally at least. >>=20 >> Have you seen this before? >=20 > How old is your kernel ? In particular, do you have > r232048+r232104+r232947+r232975+r233808+r233809 ? Yup: fbsdvm% uname -a FreeBSD fbsdvm 10.0-CURRENT FreeBSD 10.0-CURRENT #6 r234823: Sun Apr 29 = 16:18:07 PDT 2012 marcel@fbsdvm:/usr/obj/usr/src/sys/FBSDVM i386 This is off of the projects/nand branch, BTW: fbsdvm% svn info Path: . Working Copy Root Path: /usr/src URL: svn+ssh://svn.freebsd.org/base/projects/nand Repository Root: svn+ssh://svn.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 234823 Node Kind: directory Schedule: normal Last Changed Author: gber Last Changed Rev: 234550 Last Changed Date: 2012-04-21 10:48:17 -0700 (Sat, 21 Apr 2012) Which is sync'd up to head @234446. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-freebsd-toolchain@FreeBSD.ORG Mon Apr 30 22:54:39 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0933106564A; Mon, 30 Apr 2012 22:54:39 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id B9CD78FC08; Mon, 30 Apr 2012 22:54:39 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q3UMsd34006363; Mon, 30 Apr 2012 15:54:39 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q3UMscdx006362; Mon, 30 Apr 2012 15:54:38 -0700 (PDT) (envelope-from obrien) Date: Mon, 30 Apr 2012 15:54:38 -0700 From: "David O'Brien" To: Bob Bishop Message-ID: <20120430225438.GB60636@dragon.NUXI.org> Mail-Followup-To: obrien@freebsd.org, Bob Bishop , Konstantin Belousov , toolchain@freebsd.org, freebsd-current@freebsd.org References: <20120426093548.GR2358@deviant.kiev.zoral.com.ua> <5BCE2E77-2B45-43B7-AB1F-6E6C13B87B34@gid.co.uk> <20120428031212.GE80419@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: toolchain@freebsd.org, freebsd-current@freebsd.org Subject: Re: [RFC] Un-staticise the toolchain X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2012 22:54:40 -0000 On Sat, Apr 28, 2012 at 11:03:17AM +0100, Bob Bishop wrote: > Yes. You to have a statically linked /rescue/sh on board, so what's the > point of /bin/sh being dynamic? While you and I agree on this, the primary reason we went with a dynamically linked root was for PAM and NSS support -- which are dlopen'ed. And thus requires using a shared libc. -- -- David (obrien@FreeBSD.org)