From owner-freebsd-threads@FreeBSD.ORG Mon Nov 23 11:07:06 2009 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD58C106568F for ; Mon, 23 Nov 2009 11:07:05 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BFD498FC1D for ; Mon, 23 Nov 2009 11:07:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nANB75LK070273 for ; Mon, 23 Nov 2009 11:07:05 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nANB75wC070271 for freebsd-threads@FreeBSD.org; Mon, 23 Nov 2009 11:07:05 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Nov 2009 11:07:05 GMT Message-Id: <200911231107.nANB75wC070271@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 11:07:06 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o threa/136345 threads Recursive read rwlocks in thread A cause deadlock with o threa/135673 threads databases/mysql50-server - MySQL query lock-ups on 7.2 p threa/135462 threads [PATCH] _thread_cleanupspecific() doesn't handle delet o threa/133734 threads 32 bit libthr failing pthread_create() o threa/128922 threads threads hang with xorg running o threa/127225 threads bug in lib/libthr/thread/thr_init.c o threa/122923 threads 'nice' does not prevent background process from steali o threa/121336 threads lang/neko threading ok on UP, broken on SMP (FreeBSD 7 o threa/118715 threads kse problem o threa/116668 threads can no longer use jdk15 with libthr on -stable SMP o threa/116181 threads /dev/io-related io access permissions are not propagat o threa/115211 threads pthread_atfork misbehaves in initial thread o threa/110636 threads [request] gdb(1): using gdb with multi thread applicat o threa/110306 threads apache 2.0 segmentation violation when calling gethost o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/101323 threads [patch] fork(2) in threaded programs broken. s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/83914 threads [libc] popen() doesn't work in static threaded program o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/80435 threads panic on high loads o threa/79887 threads [patch] freopen() isn't thread-safe o threa/79683 threads svctcp_create() fails if multiple threads call at the s threa/76694 threads fork cause hang in dup()/close() function in child (-l s threa/76690 threads fork hang in child for -lc_r o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/70975 threads [sysvipc] unexpected and unreliable behaviour when usi s threa/69020 threads pthreads library leaks _gc_mutex s threa/49087 threads Signals lost in programs linked with libc_r s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/34536 threads accept() blocks other threads s threa/32295 threads [libc_r] [patch] pthread(3) dont dequeue signals s threa/30464 threads pthread mutex attributes -- pshared s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o 41 problems total. From owner-freebsd-threads@FreeBSD.ORG Tue Nov 24 15:50:03 2009 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F90D1065698 for ; Tue, 24 Nov 2009 15:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6DB2F8FC1E for ; Tue, 24 Nov 2009 15:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOFo3jf032897 for ; Tue, 24 Nov 2009 15:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nAOFo3WM032896; Tue, 24 Nov 2009 15:50:03 GMT (envelope-from gnats) Date: Tue, 24 Nov 2009 15:50:03 GMT Message-Id: <200911241550.nAOFo3WM032896@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Conor McDermottroe Cc: Subject: Re: threads/135673: databases/mysql50-server - MySQL query lock-ups on 7.2-RELEASE amd64 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Conor McDermottroe List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 15:50:03 -0000 The following reply was made to PR threads/135673; it has been noted by GNATS. From: Conor McDermottroe To: bug-followup@FreeBSD.org, freebsd-bugs@desert.net Cc: Subject: Re: threads/135673: databases/mysql50-server - MySQL query lock-ups on 7.2-RELEASE amd64 Date: Tue, 24 Nov 2009 15:19:38 +0000 Thanks very much for the patch, we were running into it as well. The good news is that it improves the situation quite a bit. The bad news is that it does not appear to cure the problem entirely. Under heavy load we see the same problem re-occurring. We'll be bringing up another machine with 8.0 in the coming weeks and I hope to test it then. We're currently avoiding this bug by under-loading the 7.2 machine and handling more queries on a different 7.0 machine. Is there any information I can provide which would help diagnose this bug further? From owner-freebsd-threads@FreeBSD.ORG Tue Nov 24 15:53:38 2009 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9511106568D for ; Tue, 24 Nov 2009 15:53:38 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id 7EF5E8FC34 for ; Tue, 24 Nov 2009 15:53:38 +0000 (UTC) Received: by fxm10 with SMTP id 10so4050039fxm.14 for ; Tue, 24 Nov 2009 07:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=C6Wx9ndPDjSBZJFxlsa101NMS8GjRp5sUpvXYDTJNtI=; b=kTWz1OLehvSnTSd9FZXVlTcW9XaIoERUFKdU7gQJ9ESwslGvv+7YVr7iuV3QAl/bcV 3hfhev396ZJUqDcenp4n80Fk0H6g2qghCefffgZ2x2nVXRI3Oi3xQLF6vX0IGCex56zg RFCZXliKGYk0JThHdB0QoaEDRg0SvOuDVGrAo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=AE5fjjw5aTryvzJ5cpOF0UkaCGyxbyrEetlUyGpobWtNVcNlMpRLHwgfuYvQFGH/IP rQpYtBf157irOxECHnzAYqEGIvEje2ixH3bUcfKispdP0jikuoAL6YZpcujmageOHpEG DrXpXd2szRvvwWkYnOHNU8BS0TeYpjC8uETKc= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.7.91 with SMTP id c27mr1031278fac.14.1259078017489; Tue, 24 Nov 2009 07:53:37 -0800 (PST) In-Reply-To: <200911241550.nAOFo3WM032896@freefall.freebsd.org> References: <200911241550.nAOFo3WM032896@freefall.freebsd.org> Date: Tue, 24 Nov 2009 16:53:36 +0100 X-Google-Sender-Auth: 04db9e2fbd714dc6 Message-ID: <3bbf2fe10911240753i4fe41b74j760cbcd88a096b8d@mail.gmail.com> From: Attilio Rao To: Conor McDermottroe Content-Type: text/plain; charset=UTF-8 Cc: freebsd-threads@freebsd.org Subject: Re: threads/135673: databases/mysql50-server - MySQL query lock-ups on 7.2-RELEASE amd64 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 15:53:39 -0000 2009/11/24 Conor McDermottroe : > The following reply was made to PR threads/135673; it has been noted by GNATS. > > From: Conor McDermottroe > To: bug-followup@FreeBSD.org, freebsd-bugs@desert.net > Cc: > Subject: Re: threads/135673: databases/mysql50-server - MySQL query > lock-ups on 7.2-RELEASE amd64 > Date: Tue, 24 Nov 2009 15:19:38 +0000 > > Thanks very much for the patch, we were running into it as well. The good > news is that it improves the situation quite a bit. The bad news is that > it does not appear to cure the problem entirely. Under heavy load we see > the same problem re-occurring. > > We'll be bringing up another machine with 8.0 in the coming weeks and I > hope to test it then. > > We're currently avoiding this bug by under-loading the 7.2 machine and > handling more queries on a different 7.0 machine. Is there any > information I can provide which would help diagnose this bug further? My last findings were revealing a sudden zeroing of userland structures where a lock was embedded, leaving some waiters on such locks stuck in the kernel. I think this is a MySQL bug and I feel to suggest you to upgrade to newest MySQL versions. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 05:15:06 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED3A1065696; Fri, 27 Nov 2009 05:15:06 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id 7D11E8FC16; Fri, 27 Nov 2009 05:15:06 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id nAR5HE2s058061; Fri, 27 Nov 2009 00:17:14 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: threads@FreeBSD.org Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-2jmAe98E+VyR3nbzFxAH" Organization: FreeBSD, Inc. Date: Fri, 27 Nov 2009 00:15:18 -0500 Message-Id: <1259298918.1608.19.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: kib Subject: [PATCH] Add missing pthread_condattr_{init,destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 05:15:07 -0000 --=-2jmAe98E+VyR3nbzFxAH Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I would like permission to commit this patch which adds missing pthread_condattr_{init,destroy} symbols to libc. I think I did the symbol addition correctly (and it seems to work). Without this, the weak symbols added in the libpthread-stubs port conflict with those in libthr, and applications with use these symbols can crash. I have temporarily hacked libpthread-stubs to fix this, but I really feel these stubs should be added to libc. I've also copied kib as he has been kind enough to review my work in the past. Thanks. http://www.marcuscom.com/downloads/stubs.diff Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-2jmAe98E+VyR3nbzFxAH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAksPYGQACgkQb2iPiv4Uz4cFIQCgk/wyBJjwg0i4wYSRjXzQz+kc 9lUAnj/NOMb5yzRlaYqG2FTilaKMjInw =EQpO -----END PGP SIGNATURE----- --=-2jmAe98E+VyR3nbzFxAH-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 13:10:06 2009 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE06C106568F; Fri, 27 Nov 2009 13:10:06 +0000 (UTC) (envelope-from conor@mail.mcdermottroe.com) Received: from mail.mcdermottroe.com (mcdermottroe.com [80.68.93.181]) by mx1.freebsd.org (Postfix) with ESMTP id 8585A8FC0A; Fri, 27 Nov 2009 13:10:06 +0000 (UTC) Received: from conor by mail.mcdermottroe.com with local (Exim 4.69) (envelope-from ) id 1NE0C7-000770-7S; Fri, 27 Nov 2009 12:45:03 +0000 Date: Fri, 27 Nov 2009 12:45:03 +0000 From: Conor McDermottroe To: Attilio Rao Message-ID: <20091127124503.GA3853@mcdermottroe.com> References: <200911241550.nAOFo3WM032896@freefall.freebsd.org> <3bbf2fe10911240753i4fe41b74j760cbcd88a096b8d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bbf2fe10911240753i4fe41b74j760cbcd88a096b8d@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: Conor McDermottroe Cc: freebsd-threads@freebsd.org Subject: Re: threads/135673: databases/mysql50-server - MySQL query lock-ups on 7.2-RELEASE amd64 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:10:06 -0000 On Tue, Nov 24, 2009 at 04:53:36PM +0100, Attilio Rao wrote: > My last findings were revealing a sudden zeroing of userland > structures where a lock was embedded, leaving some waiters on such > locks stuck in the kernel. > I think this is a MySQL bug and I feel to suggest you to upgrade to > newest MySQL versions. I'll experiment with MySQL 5.1 on our new FreeBSD 8.0 machine and see if I can trigger the bug on that. Is there anything specific I can do to gather information for you when I'm testing that? -Conor From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 13:23:29 2009 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15A1E1065670 for ; Fri, 27 Nov 2009 13:23:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF388FC12 for ; Fri, 27 Nov 2009 13:23:27 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nARDCg4H023309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Nov 2009 15:12:42 +0200 (EET) (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.3/8.14.3) with ESMTP id nARDCgvV012074; Fri, 27 Nov 2009 15:12:42 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nARDCgdY012073; Fri, 27 Nov 2009 15:12:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Nov 2009 15:12:42 +0200 From: Kostik Belousov To: Joe Marcus Clarke Message-ID: <20091127131242.GA2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: <1259298918.1608.19.camel@shumai.marcuscom.com> 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.4 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: threads@freebsd.org Subject: Re: [PATCH] Add missing pthread_condattr_{init, destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:23:29 -0000 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: > I would like permission to commit this patch which adds missing > pthread_condattr_{init,destroy} symbols to libc. I think I did the > symbol addition correctly (and it seems to work). Without this, the > weak symbols added in the libpthread-stubs port conflict with those in > libthr, and applications with use these symbols can crash. >=20 > I have temporarily hacked libpthread-stubs to fix this, but I really > feel these stubs should be added to libc. I've also copied kib as he > has been kind enough to review my work in the past. Thanks. >=20 > http://www.marcuscom.com/downloads/stubs.diff It is FBSD_1.2 version that we use for symbols added after HEAD become CURRENT-9. I think that you shall change lib/libc/libc_private.h, adding corresponding definitions for the PJT_CONDATTR_DESTROY/PJT_CONDATTR_INIT indexes. Is the patch buildable ? Interesting question is whether these changes are mergeable to the stable branch. Possibly yes, if we declare that rtld/libc/libthr shall be built from the consistent source snapshot. --AhhlLboLdkugWU4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksP0EoACgkQC3+MBN1Mb4hTNwCgpNcCKfhO4bbUXxt3Kv2wfm/W c6UAoNR/VPVfGKxjG5tN3xxx4pDDkmIK =qujH -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 19:14:00 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66CA31065697 for ; Fri, 27 Nov 2009 19:14:00 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id BE2CF8FC13 for ; Fri, 27 Nov 2009 19:13:59 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id nARJG5XJ041541; Fri, 27 Nov 2009 14:16:05 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Kostik Belousov In-Reply-To: <20091127131242.GA2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-LTOyvPKDd72Gw9J7NAOr" Organization: FreeBSD, Inc. Date: Fri, 27 Nov 2009 14:14:08 -0500 Message-Id: <1259349248.1608.36.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: threads@FreeBSD.org Subject: Re: [PATCH] Add missing pthread_condattr_{init,destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 19:14:00 -0000 --=-LTOyvPKDd72Gw9J7NAOr Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: > On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: > > I would like permission to commit this patch which adds missing > > pthread_condattr_{init,destroy} symbols to libc. I think I did the > > symbol addition correctly (and it seems to work). Without this, the > > weak symbols added in the libpthread-stubs port conflict with those in > > libthr, and applications with use these symbols can crash. > >=20 > > I have temporarily hacked libpthread-stubs to fix this, but I really > > feel these stubs should be added to libc. I've also copied kib as he > > has been kind enough to review my work in the past. Thanks. > >=20 > > http://www.marcuscom.com/downloads/stubs.diff >=20 > It is FBSD_1.2 version that we use for symbols added after HEAD become > CURRENT-9. Done. >=20 > I think that you shall change lib/libc/libc_private.h, adding > corresponding definitions for the PJT_CONDATTR_DESTROY/PJT_CONDATTR_INIT > indexes. >=20 > Is the patch buildable ? Yes, but only because my machine had the libc_private.h chunk which I forgot in the diff. >=20 > Interesting question is whether these changes are mergeable to the > stable branch. Possibly yes, if we declare that rtld/libc/libthr shall > be built from the consistent source snapshot. I would like to merge these changes to RELENG_8, RELENG_7, and RELENG_6 if possible. Anything which depends on dbus (e.g. GNOME) will just crash without them. In the meantime, I have hacked libpthread-stubs, but I really think this is the more correct fix. http://www.marcuscom.com/downloads/stubs.diff Thanks for the review. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-LTOyvPKDd72Gw9J7NAOr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAksQJQAACgkQb2iPiv4Uz4cDzACgksqz1AgY3wYLalYIEbnymzHQ 9+cAoIbhhO/4EAGQ7x1tc8MOLiKYyvS6 =cVKV -----END PGP SIGNATURE----- --=-LTOyvPKDd72Gw9J7NAOr-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 21:30:52 2009 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2941A106566B; Fri, 27 Nov 2009 21:30:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 91CA48FC0A; Fri, 27 Nov 2009 21:30:51 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nARLUkpu079505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Nov 2009 23:30:46 +0200 (EET) (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.3/8.14.3) with ESMTP id nARLUkhs041049; Fri, 27 Nov 2009 23:30:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nARLUkb2041048; Fri, 27 Nov 2009 23:30:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Nov 2009 23:30:46 +0200 From: Kostik Belousov To: Daniel Eischen Message-ID: <20091127213046.GI2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MFZs98Tklfu0WsCO" Content-Disposition: inline In-Reply-To: <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> 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.4 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: "threads@freebsd.org" , Joe Marcus Clarke Subject: Re: [PATCH] Add missing pthread_condattr_{init, destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 21:30:52 -0000 --MFZs98Tklfu0WsCO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2009 at 04:19:38PM -0500, Daniel Eischen wrote: >=20 > On Nov 27, 2009, at 2:14 PM, Joe Marcus Clarke =20 > wrote: >=20 > >On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: > >>On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: > >>>I would like permission to commit this patch which adds missing > >>>pthread_condattr_{init,destroy} symbols to libc. I think I did the > >>>symbol addition correctly (and it seems to work). Without this, the > >>>weak symbols added in the libpthread-stubs port conflict with =20 > >>>those in > >>>libthr, and applications with use these symbols can crash. > >>> > >>>I have temporarily hacked libpthread-stubs to fix this, but I really > >>>feel these stubs should be added to libc. I've also copied kib as =20 > >>>he > >>>has been kind enough to review my work in the past. Thanks. > >>> > >>>http://www.marcuscom.com/downloads/stubs.diff > >> > >>It is FBSD_1.2 version that we use for symbols added after HEAD =20 > >>become > >>CURRENT-9. > > > >Done. >=20 > I don't think the symbols belong in FBSD_1.2. They already exist in =20 > libthr in a previous namespace. If you use FBSD_1.2, then you =20 > probably need to bump them in libthr and libc_r, and add compatible =20 > symbols (no problem there since there are no differences) for the =20 > previous versions. Oh, yes. >=20 > Still not sure why libc needs all libpthread stubs. Shouldn't be =20 > necessary. The privately discussed plan for 9.0 is to have libthr merged into libc, and have libpthread and libthr as only filter object against libc providing pthread_* and related symbols. This would eliminate the need for pthread stubs and solve the issues with (wrongly built) binaries that do not link to libthr but dlopen() libraries that are linked with it. --MFZs98Tklfu0WsCO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksQRQYACgkQC3+MBN1Mb4gxtQCfXOrpFLeJ5TWG6BzjguX5ZVP5 34MAnRIWev/MFOKgJ6CWxlSJuADztO+J =uB5T -----END PGP SIGNATURE----- --MFZs98Tklfu0WsCO-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 21:32:05 2009 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F26E1065670; Fri, 27 Nov 2009 21:32:05 +0000 (UTC) (envelope-from eischen@vigrid.com) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 57EBC8FC19; Fri, 27 Nov 2009 21:32:05 +0000 (UTC) Received: from [10.48.14.27] (mobile-166-137-136-050.mycingular.net [166.137.136.50]) (authenticated bits=0) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id nARLJh0A017210 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 27 Nov 2009 16:19:49 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Fri, 27 Nov 2009 16:19:55 -0500 (EST) References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> Message-Id: <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> From: Daniel Eischen To: Joe Marcus Clarke In-Reply-To: <1259349248.1608.36.camel@shumai.marcuscom.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Date: Fri, 27 Nov 2009 16:19:38 -0500 Cc: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init, destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 21:32:05 -0000 On Nov 27, 2009, at 2:14 PM, Joe Marcus Clarke wrote: > On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: >> On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: >>> I would like permission to commit this patch which adds missing >>> pthread_condattr_{init,destroy} symbols to libc. I think I did the >>> symbol addition correctly (and it seems to work). Without this, the >>> weak symbols added in the libpthread-stubs port conflict with >>> those in >>> libthr, and applications with use these symbols can crash. >>> >>> I have temporarily hacked libpthread-stubs to fix this, but I really >>> feel these stubs should be added to libc. I've also copied kib as >>> he >>> has been kind enough to review my work in the past. Thanks. >>> >>> http://www.marcuscom.com/downloads/stubs.diff >> >> It is FBSD_1.2 version that we use for symbols added after HEAD >> become >> CURRENT-9. > > Done. I don't think the symbols belong in FBSD_1.2. They already exist in libthr in a previous namespace. If you use FBSD_1.2, then you probably need to bump them in libthr and libc_r, and add compatible symbols (no problem there since there are no differences) for the previous versions. Still not sure why libc needs all libpthread stubs. Shouldn't be necessary. -- DE From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 21:47:01 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 474DF1065672 for ; Fri, 27 Nov 2009 21:47:01 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id EC1AB8FC1B for ; Fri, 27 Nov 2009 21:47:00 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id nARLnBFh071800; Fri, 27 Nov 2009 16:49:11 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Daniel Eischen In-Reply-To: <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Gp1ebHz9hS6B46nCQ8z9" Organization: FreeBSD, Inc. Date: Fri, 27 Nov 2009 16:47:14 -0500 Message-Id: <1259358434.1608.43.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init,destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 21:47:01 -0000 --=-Gp1ebHz9hS6B46nCQ8z9 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2009-11-27 at 16:19 -0500, Daniel Eischen wrote: > On Nov 27, 2009, at 2:14 PM, Joe Marcus Clarke =20 > wrote: >=20 > > On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: > >> On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: > >>> I would like permission to commit this patch which adds missing > >>> pthread_condattr_{init,destroy} symbols to libc. I think I did the > >>> symbol addition correctly (and it seems to work). Without this, the > >>> weak symbols added in the libpthread-stubs port conflict with =20 > >>> those in > >>> libthr, and applications with use these symbols can crash. > >>> > >>> I have temporarily hacked libpthread-stubs to fix this, but I really > >>> feel these stubs should be added to libc. I've also copied kib as =20 > >>> he > >>> has been kind enough to review my work in the past. Thanks. > >>> > >>> http://www.marcuscom.com/downloads/stubs.diff > >> > >> It is FBSD_1.2 version that we use for symbols added after HEAD =20 > >> become > >> CURRENT-9. > > > > Done. >=20 > I don't think the symbols belong in FBSD_1.2. They already exist in =20 > libthr in a previous namespace. If you use FBSD_1.2, then you =20 > probably need to bump them in libthr and libc_r, and add compatible =20 > symbols (no problem there since there are no differences) for the =20 > previous versions. How would this be done? Would I add an FBSD_1.2 namespace to pthread.map, or would FBSD_1.1 be sufficient? How would the compatibility symbols be defined? >=20 > Still not sure why libc needs all libpthread stubs. Shouldn't be =20 > necessary. Agreed, but the problem comes with the libpthread-stubs port. This port was added as a dependency of libxcb (which is used by just about everything in X). This port defines weak symbols for pthread_condattr_destroy and pthread_condattr_init and maps them to a function that simply returns 0. The problem is that if a binary is linked to both this library and -pthread, and that binary calls pthread_condattr_init(), it can be resolved in libpthread-stubs instead of libthr. When this happens, the init isn't done, and any subsequent usage of the pthread_condattr_t structure results in a segfault. I'm certainly open to other suggestions for fixing this. Joe >=20 > -- > DE >=20 --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-Gp1ebHz9hS6B46nCQ8z9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAksQSOEACgkQb2iPiv4Uz4fn7ACgif4uKqUEAY7xuZfisoZ6988e f2sAoI4v1mTekST+tos3Rz450ESCUWno =5bHj -----END PGP SIGNATURE----- --=-Gp1ebHz9hS6B46nCQ8z9-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 21:53:07 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1144E106568D for ; Fri, 27 Nov 2009 21:53:07 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id CA54B8FC14 for ; Fri, 27 Nov 2009 21:53:06 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id nARLtHsR071866; Fri, 27 Nov 2009 16:55:17 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Kostik Belousov In-Reply-To: <20091127213046.GI2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <20091127213046.GI2368@deviant.kiev.zoral.com.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-GNNT8vyxA5rxIl6Ih1Mv" Organization: FreeBSD, Inc. Date: Fri, 27 Nov 2009 16:53:20 -0500 Message-Id: <1259358800.1608.46.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,MIME_QP_LONG_LINE, NO_RELAYS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init,destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 21:53:07 -0000 --=-GNNT8vyxA5rxIl6Ih1Mv Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2009-11-27 at 23:30 +0200, Kostik Belousov wrote: > On Fri, Nov 27, 2009 at 04:19:38PM -0500, Daniel Eischen wrote: > >=20 > > On Nov 27, 2009, at 2:14 PM, Joe Marcus Clarke =20 > > wrote: > >=20 > > >On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: > > >>On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: > > >>>I would like permission to commit this patch which adds missing > > >>>pthread_condattr_{init,destroy} symbols to libc. I think I did the > > >>>symbol addition correctly (and it seems to work). Without this, the > > >>>weak symbols added in the libpthread-stubs port conflict with =20 > > >>>those in > > >>>libthr, and applications with use these symbols can crash. > > >>> > > >>>I have temporarily hacked libpthread-stubs to fix this, but I really > > >>>feel these stubs should be added to libc. I've also copied kib as =20 > > >>>he > > >>>has been kind enough to review my work in the past. Thanks. > > >>> > > >>>http://www.marcuscom.com/downloads/stubs.diff > > >> > > >>It is FBSD_1.2 version that we use for symbols added after HEAD =20 > > >>become > > >>CURRENT-9. > > > > > >Done. > >=20 > > I don't think the symbols belong in FBSD_1.2. They already exist in =20 > > libthr in a previous namespace. If you use FBSD_1.2, then you =20 > > probably need to bump them in libthr and libc_r, and add compatible =20 > > symbols (no problem there since there are no differences) for the =20 > > previous versions. > Oh, yes. >=20 > >=20 > > Still not sure why libc needs all libpthread stubs. Shouldn't be =20 > > necessary. >=20 > The privately discussed plan for 9.0 is to have libthr merged into > libc, and have libpthread and libthr as only filter object against libc > providing pthread_* and related symbols. >=20 > This would eliminate the need for pthread stubs and solve the issues > with (wrongly built) binaries that do not link to libthr but dlopen() > libraries that are linked with it. Yeah, I think that would be a great overall solution. However, in this case, the binaries in question ARE linked with -pthread. The problem can be easily seen by taking this C program: #include #include #include int main(void) { pthread_condattr_t attr; pthread_condattr_init (&attr); pthread_condattr_setclock (&attr, CLOCK_MONOTONIC); pthread_condattr_destroy (&attr); return 0; } And compiling it as: cc -o xxx -L/usr/local/lib -lpthread-stubs -pthread xxx.c You will need devel/libpthread-stubs (version 0.3) installed. When you run it, it will segfault. If you then rebuild libc and libthr with my stubs.diff patch, then rebuild libpthread-stubs, the problem will go away. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-GNNT8vyxA5rxIl6Ih1Mv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAksQSk8ACgkQb2iPiv4Uz4fdQQCdEg6T2KI+yI/g0nkDFal1hwU0 KlsAoJwBt9lDyfGAJhNn8E26lsYEt5D+ =GkuU -----END PGP SIGNATURE----- --=-GNNT8vyxA5rxIl6Ih1Mv-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 22:07:12 2009 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E735106566C; Fri, 27 Nov 2009 22:07:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 96A8F8FC1D; Fri, 27 Nov 2009 22:07:11 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nARM77wt086127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Nov 2009 00:07:07 +0200 (EET) (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.3/8.14.3) with ESMTP id nARM77fR056166; Sat, 28 Nov 2009 00:07:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nARM76wp056165; Sat, 28 Nov 2009 00:07:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Nov 2009 00:07:06 +0200 From: Kostik Belousov To: Joe Marcus Clarke Message-ID: <20091127220706.GJ2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <20091127213046.GI2368@deviant.kiev.zoral.com.ua> <1259358800.1608.46.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcccYpVZDxQ8hzPO" Content-Disposition: inline In-Reply-To: <1259358800.1608.46.camel@shumai.marcuscom.com> 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.4 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: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init, destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:07:12 -0000 --HcccYpVZDxQ8hzPO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2009 at 04:53:20PM -0500, Joe Marcus Clarke wrote: > On Fri, 2009-11-27 at 23:30 +0200, Kostik Belousov wrote: > > On Fri, Nov 27, 2009 at 04:19:38PM -0500, Daniel Eischen wrote: > > >=20 > > > On Nov 27, 2009, at 2:14 PM, Joe Marcus Clarke = =20 > > > wrote: > > >=20 > > > >On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: > > > >>On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: > > > >>>I would like permission to commit this patch which adds missing > > > >>>pthread_condattr_{init,destroy} symbols to libc. I think I did the > > > >>>symbol addition correctly (and it seems to work). Without this, t= he > > > >>>weak symbols added in the libpthread-stubs port conflict with =20 > > > >>>those in > > > >>>libthr, and applications with use these symbols can crash. > > > >>> > > > >>>I have temporarily hacked libpthread-stubs to fix this, but I real= ly > > > >>>feel these stubs should be added to libc. I've also copied kib as= =20 > > > >>>he > > > >>>has been kind enough to review my work in the past. Thanks. > > > >>> > > > >>>http://www.marcuscom.com/downloads/stubs.diff > > > >> > > > >>It is FBSD_1.2 version that we use for symbols added after HEAD =20 > > > >>become > > > >>CURRENT-9. > > > > > > > >Done. > > >=20 > > > I don't think the symbols belong in FBSD_1.2. They already exist in = =20 > > > libthr in a previous namespace. If you use FBSD_1.2, then you =20 > > > probably need to bump them in libthr and libc_r, and add compatible = =20 > > > symbols (no problem there since there are no differences) for the =20 > > > previous versions. > > Oh, yes. > >=20 > > >=20 > > > Still not sure why libc needs all libpthread stubs. Shouldn't be =20 > > > necessary. > >=20 > > The privately discussed plan for 9.0 is to have libthr merged into > > libc, and have libpthread and libthr as only filter object against libc > > providing pthread_* and related symbols. > >=20 > > This would eliminate the need for pthread stubs and solve the issues > > with (wrongly built) binaries that do not link to libthr but dlopen() > > libraries that are linked with it. >=20 > Yeah, I think that would be a great overall solution. However, in this > case, the binaries in question ARE linked with -pthread. The problem > can be easily seen by taking this C program: >=20 > #include > #include > #include >=20 > int > main(void) { > pthread_condattr_t attr; >=20 > pthread_condattr_init (&attr); > pthread_condattr_setclock (&attr, CLOCK_MONOTONIC); >=20 > pthread_condattr_destroy (&attr); >=20 > return 0; > } >=20 > And compiling it as: >=20 > cc -o xxx -L/usr/local/lib -lpthread-stubs -pthread xxx.c >=20 > You will need devel/libpthread-stubs (version 0.3) installed. When you > run it, it will segfault. If you then rebuild libc and libthr with my > stubs.diff patch, then rebuild libpthread-stubs, the problem will go > away. I see. What happen there is that both libpthread-stubs and libthr provide _weak_ symbols pthread_condattr_destroy and pthread_condattr_init. Actually, these two symbols are the only exported symbols from stubs library. Due to specified library order, rtld for xxx resolves these symbols from stubs, not from libthr. But pthread_condattr_setclock is only exported weak from libthr, and it gets used. This ends up supplying initialized attributes to pthread_condattr_setclock. Your patch makes libc provide these two weak symbols, and then stubs seems to become empty library. --HcccYpVZDxQ8hzPO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksQTYoACgkQC3+MBN1Mb4gMmQCg1kvePXHh5mKeMRJ5vfK5GtRJ xZ0AnA0BelRxWv83HkObLc05RU47dLSa =q5am -----END PGP SIGNATURE----- --HcccYpVZDxQ8hzPO-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 22:11:00 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 142D6106566C for ; Fri, 27 Nov 2009 22:11:00 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id BCE6E8FC0A for ; Fri, 27 Nov 2009 22:10:59 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id nARMDANx072093; Fri, 27 Nov 2009 17:13:10 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Kostik Belousov In-Reply-To: <20091127220706.GJ2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <20091127213046.GI2368@deviant.kiev.zoral.com.ua> <1259358800.1608.46.camel@shumai.marcuscom.com> <20091127220706.GJ2368@deviant.kiev.zoral.com.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-DYKfFuZ9SjIvjz9I/gAv" Organization: FreeBSD, Inc. Date: Fri, 27 Nov 2009 17:11:13 -0500 Message-Id: <1259359873.1608.48.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,MIME_QP_LONG_LINE, NO_RELAYS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init,destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:11:00 -0000 --=-DYKfFuZ9SjIvjz9I/gAv Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2009-11-28 at 00:07 +0200, Kostik Belousov wrote: > On Fri, Nov 27, 2009 at 04:53:20PM -0500, Joe Marcus Clarke wrote: > > On Fri, 2009-11-27 at 23:30 +0200, Kostik Belousov wrote: > > > On Fri, Nov 27, 2009 at 04:19:38PM -0500, Daniel Eischen wrote: > > > >=20 > > > > On Nov 27, 2009, at 2:14 PM, Joe Marcus Clarke = =20 > > > > wrote: > > > >=20 > > > > >On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: > > > > >>On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote= : > > > > >>>I would like permission to commit this patch which adds missing > > > > >>>pthread_condattr_{init,destroy} symbols to libc. I think I did = the > > > > >>>symbol addition correctly (and it seems to work). Without this,= the > > > > >>>weak symbols added in the libpthread-stubs port conflict with =20 > > > > >>>those in > > > > >>>libthr, and applications with use these symbols can crash. > > > > >>> > > > > >>>I have temporarily hacked libpthread-stubs to fix this, but I re= ally > > > > >>>feel these stubs should be added to libc. I've also copied kib = as =20 > > > > >>>he > > > > >>>has been kind enough to review my work in the past. Thanks. > > > > >>> > > > > >>>http://www.marcuscom.com/downloads/stubs.diff > > > > >> > > > > >>It is FBSD_1.2 version that we use for symbols added after HEAD =20 > > > > >>become > > > > >>CURRENT-9. > > > > > > > > > >Done. > > > >=20 > > > > I don't think the symbols belong in FBSD_1.2. They already exist i= n =20 > > > > libthr in a previous namespace. If you use FBSD_1.2, then you =20 > > > > probably need to bump them in libthr and libc_r, and add compatible= =20 > > > > symbols (no problem there since there are no differences) for the =20 > > > > previous versions. > > > Oh, yes. > > >=20 > > > >=20 > > > > Still not sure why libc needs all libpthread stubs. Shouldn't be =20 > > > > necessary. > > >=20 > > > The privately discussed plan for 9.0 is to have libthr merged into > > > libc, and have libpthread and libthr as only filter object against li= bc > > > providing pthread_* and related symbols. > > >=20 > > > This would eliminate the need for pthread stubs and solve the issues > > > with (wrongly built) binaries that do not link to libthr but dlopen() > > > libraries that are linked with it. > >=20 > > Yeah, I think that would be a great overall solution. However, in this > > case, the binaries in question ARE linked with -pthread. The problem > > can be easily seen by taking this C program: > >=20 > > #include > > #include > > #include > >=20 > > int > > main(void) { > > pthread_condattr_t attr; > >=20 > > pthread_condattr_init (&attr); > > pthread_condattr_setclock (&attr, CLOCK_MONOTONIC); > >=20 > > pthread_condattr_destroy (&attr); > >=20 > > return 0; > > } > >=20 > > And compiling it as: > >=20 > > cc -o xxx -L/usr/local/lib -lpthread-stubs -pthread xxx.c > >=20 > > You will need devel/libpthread-stubs (version 0.3) installed. When you > > run it, it will segfault. If you then rebuild libc and libthr with my > > stubs.diff patch, then rebuild libpthread-stubs, the problem will go > > away. >=20 > I see. What happen there is that both libpthread-stubs and libthr > provide _weak_ symbols pthread_condattr_destroy and pthread_condattr_init= . > Actually, these two symbols are the only exported symbols from stubs > library. Due to specified library order, rtld for xxx resolves these > symbols from stubs, not from libthr. But pthread_condattr_setclock > is only exported weak from libthr, and it gets used. >=20 > This ends up supplying initialized attributes to pthread_condattr_setcloc= k. >=20 > Your patch makes libc provide these two weak symbols, and then > stubs seems to become empty library. 100% correct all around. In fact, if you read the manifesto for libpthread-stubs, it is designed to be an empty library on systems which provide all of the necessary stubs. In that case, it just provides its pkg-config file. I didn't see a better way of fixing this. I'm still fuzzy on how to do the correct symbol map dance for libthr/libc_r. Do you know of any example symbols which had to be updated in this fashion? Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-DYKfFuZ9SjIvjz9I/gAv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAksQTn8ACgkQb2iPiv4Uz4fbOACfYYlbLQvcMJAYVq8YvfWAKSv0 9EYAn1vDNuOZLr7ytI68Hg6k+j0nzk02 =cwF7 -----END PGP SIGNATURE----- --=-DYKfFuZ9SjIvjz9I/gAv-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 22:22:29 2009 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7F7D106566C; Fri, 27 Nov 2009 22:22:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 1FF108FC0A; Fri, 27 Nov 2009 22:22:28 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nARMMPvH088944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Nov 2009 00:22:25 +0200 (EET) (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.3/8.14.3) with ESMTP id nARMMOeR056269; Sat, 28 Nov 2009 00:22:24 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nARMMO6L056267; Sat, 28 Nov 2009 00:22:24 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Nov 2009 00:22:24 +0200 From: Kostik Belousov To: Joe Marcus Clarke Message-ID: <20091127222224.GL2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <20091127213046.GI2368@deviant.kiev.zoral.com.ua> <1259358800.1608.46.camel@shumai.marcuscom.com> <20091127220706.GJ2368@deviant.kiev.zoral.com.ua> <1259359873.1608.48.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DXIF1lRUlMsbZ3S1" Content-Disposition: inline In-Reply-To: <1259359873.1608.48.camel@shumai.marcuscom.com> 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.4 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: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init, destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:22:29 -0000 --DXIF1lRUlMsbZ3S1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 27, 2009 at 05:11:13PM -0500, Joe Marcus Clarke wrote: > I didn't see a better way of fixing this. I'm still fuzzy on how to do > the correct symbol map dance for libthr/libc_r. Do you know of any > example symbols which had to be updated in this fashion? pthread_condattr_init and _destroy are exported from libthr in FBSD_1.0. namespace. I think stubs should go into FBSD_1.0 namespace in libc then. We nullified one of the use for symver by extending existing namespaces (symbol versioning, as defined by Sun, allowed for dynamic linker to make a guarantee that process does not have unresolved symbols only by checking that all required versions are provided by libraries). My opinion that adding them to FBSD_1.0 is ok. Others suggestions are welcome. --DXIF1lRUlMsbZ3S1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksQUR8ACgkQC3+MBN1Mb4gqKwCg5apFbUsv7xgsGQYiDhIaNps3 UkoAoLSq4Umdy+3JKiZHkrEtzv5YhCdp =wkZt -----END PGP SIGNATURE----- --DXIF1lRUlMsbZ3S1-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 22:28:00 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDBDC1065679 for ; Fri, 27 Nov 2009 22:28:00 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id 79F678FC14 for ; Fri, 27 Nov 2009 22:28:00 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id nARMU4I1072280; Fri, 27 Nov 2009 17:30:04 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Kostik Belousov In-Reply-To: <20091127222224.GL2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <20091127213046.GI2368@deviant.kiev.zoral.com.ua> <1259358800.1608.46.camel@shumai.marcuscom.com> <20091127220706.GJ2368@deviant.kiev.zoral.com.ua> <1259359873.1608.48.camel@shumai.marcuscom.com> <20091127222224.GL2368@deviant.kiev.zoral.com.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-sIbNPGUP00B0ACD6rXt9" Organization: FreeBSD, Inc. Date: Fri, 27 Nov 2009 17:28:07 -0500 Message-Id: <1259360887.1608.49.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init,destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:28:01 -0000 --=-sIbNPGUP00B0ACD6rXt9 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2009-11-28 at 00:22 +0200, Kostik Belousov wrote: > On Fri, Nov 27, 2009 at 05:11:13PM -0500, Joe Marcus Clarke wrote: > > I didn't see a better way of fixing this. I'm still fuzzy on how to do > > the correct symbol map dance for libthr/libc_r. Do you know of any > > example symbols which had to be updated in this fashion? >=20 > pthread_condattr_init and _destroy are exported from libthr in FBSD_1.0. > namespace. I think stubs should go into FBSD_1.0 namespace in libc then. >=20 > We nullified one of the use for symver by extending existing > namespaces (symbol versioning, as defined by Sun, allowed for dynamic > linker to make a guarantee that process does not have unresolved > symbols only by checking that all required versions are provided > by libraries). My opinion that adding them to FBSD_1.0 is ok. That's easy enough. New patch is up. http://www.marcuscom.com/downloads/stubs.diff Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-sIbNPGUP00B0ACD6rXt9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAksQUnYACgkQb2iPiv4Uz4e93gCfbRHate0vLjn46cauN4Ftzh6x ohAAn3SrVCoFXSBPbXjkGtZiN+b8ynG2 =rRXZ -----END PGP SIGNATURE----- --=-sIbNPGUP00B0ACD6rXt9-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 22:30:58 2009 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7322F106566B; Fri, 27 Nov 2009 22:30:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id B659E8FC17; Fri, 27 Nov 2009 22:30:57 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nARMUhSa090334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Nov 2009 00:30:43 +0200 (EET) (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.3/8.14.3) with ESMTP id nARMUgNv056905; Sat, 28 Nov 2009 00:30:42 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nARMUgNU056904; Sat, 28 Nov 2009 00:30:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Nov 2009 00:30:42 +0200 From: Kostik Belousov To: Joe Marcus Clarke Message-ID: <20091127223042.GM2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <20091127213046.GI2368@deviant.kiev.zoral.com.ua> <1259358800.1608.46.camel@shumai.marcuscom.com> <20091127220706.GJ2368@deviant.kiev.zoral.com.ua> <1259359873.1608.48.camel@shumai.marcuscom.com> <20091127222224.GL2368@deviant.kiev.zoral.com.ua> <1259360887.1608.49.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yklP1rR72f9kjNtc" Content-Disposition: inline In-Reply-To: <1259360887.1608.49.camel@shumai.marcuscom.com> 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.4 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: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init, destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:30:58 -0000 --yklP1rR72f9kjNtc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2009 at 05:28:07PM -0500, Joe Marcus Clarke wrote: > On Sat, 2009-11-28 at 00:22 +0200, Kostik Belousov wrote: > > On Fri, Nov 27, 2009 at 05:11:13PM -0500, Joe Marcus Clarke wrote: > > > I didn't see a better way of fixing this. I'm still fuzzy on how to = do > > > the correct symbol map dance for libthr/libc_r. Do you know of any > > > example symbols which had to be updated in this fashion? > >=20 > > pthread_condattr_init and _destroy are exported from libthr in FBSD_1.0. > > namespace. I think stubs should go into FBSD_1.0 namespace in libc then. > >=20 > > We nullified one of the use for symver by extending existing > > namespaces (symbol versioning, as defined by Sun, allowed for dynamic > > linker to make a guarantee that process does not have unresolved > > symbols only by checking that all required versions are provided > > by libraries). My opinion that adding them to FBSD_1.0 is ok. >=20 > That's easy enough. New patch is up. >=20 > http://www.marcuscom.com/downloads/stubs.diff I think symbols should be added in the pthread_* block of the libc/gen/Symbol.map, arranged alphabetically. --yklP1rR72f9kjNtc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksQUxIACgkQC3+MBN1Mb4hbcwCfehMfWbZBUOtfEf3QxZbIvlJE /TsAnRrkxhd9xSNrm94DeiZ0cVGieINV =7/Bw -----END PGP SIGNATURE----- --yklP1rR72f9kjNtc-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 22:34:06 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976FF1065693 for ; Fri, 27 Nov 2009 22:34:06 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id 1A0D08FC25 for ; Fri, 27 Nov 2009 22:34:05 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id nARMaGqN087848; Fri, 27 Nov 2009 17:36:16 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Kostik Belousov In-Reply-To: <20091127223042.GM2368@deviant.kiev.zoral.com.ua> References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <20091127213046.GI2368@deviant.kiev.zoral.com.ua> <1259358800.1608.46.camel@shumai.marcuscom.com> <20091127220706.GJ2368@deviant.kiev.zoral.com.ua> <1259359873.1608.48.camel@shumai.marcuscom.com> <20091127222224.GL2368@deviant.kiev.zoral.com.ua> <1259360887.1608.49.camel@shumai.marcuscom.com> <20091127223042.GM2368@deviant.kiev.zoral.com.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-USrfwGfywnjScHQ2rIX0" Organization: FreeBSD, Inc. Date: Fri, 27 Nov 2009 17:34:19 -0500 Message-Id: <1259361259.1608.50.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init,destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:34:06 -0000 --=-USrfwGfywnjScHQ2rIX0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2009-11-28 at 00:30 +0200, Kostik Belousov wrote: > On Fri, Nov 27, 2009 at 05:28:07PM -0500, Joe Marcus Clarke wrote: > > On Sat, 2009-11-28 at 00:22 +0200, Kostik Belousov wrote: > > > On Fri, Nov 27, 2009 at 05:11:13PM -0500, Joe Marcus Clarke wrote: > > > > I didn't see a better way of fixing this. I'm still fuzzy on how t= o do > > > > the correct symbol map dance for libthr/libc_r. Do you know of any > > > > example symbols which had to be updated in this fashion? > > >=20 > > > pthread_condattr_init and _destroy are exported from libthr in FBSD_1= .0. > > > namespace. I think stubs should go into FBSD_1.0 namespace in libc th= en. > > >=20 > > > We nullified one of the use for symver by extending existing > > > namespaces (symbol versioning, as defined by Sun, allowed for dynamic > > > linker to make a guarantee that process does not have unresolved > > > symbols only by checking that all required versions are provided > > > by libraries). My opinion that adding them to FBSD_1.0 is ok. > >=20 > > That's easy enough. New patch is up. > >=20 > > http://www.marcuscom.com/downloads/stubs.diff >=20 > I think symbols should be added in the pthread_* block of the > libc/gen/Symbol.map, arranged alphabetically. Wasn't sure of that. I had it that way originally, then I thought maybe they were being organized in order of inclusion (as I saw some others out of alphabetical order). I can easily shuffle them around. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-USrfwGfywnjScHQ2rIX0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAksQU+kACgkQb2iPiv4Uz4ePsACeKL8QFlrV3osUoBaooNKtf0oz sz4AoKp+/1YjGNyBpdytGB4XKsPRdiOA =5o2s -----END PGP SIGNATURE----- --=-USrfwGfywnjScHQ2rIX0-- From owner-freebsd-threads@FreeBSD.ORG Fri Nov 27 22:50:49 2009 Return-Path: Delivered-To: threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D73DA106568B; Fri, 27 Nov 2009 22:50:49 +0000 (UTC) (envelope-from eischen@vigrid.com) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id A63D88FC24; Fri, 27 Nov 2009 22:50:49 +0000 (UTC) Received: from [10.250.37.117] (mobile-166-137-133-148.mycingular.net [166.137.133.148]) (authenticated bits=0) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id nARMoX65013973 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 27 Nov 2009 17:50:42 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Fri, 27 Nov 2009 17:50:48 -0500 (EST) References: <1259298918.1608.19.camel@shumai.marcuscom.com> <20091127131242.GA2368@deviant.kiev.zoral.com.ua> <1259349248.1608.36.camel@shumai.marcuscom.com> <4AF1E295-0524-4C39-94CD-9A12D574C64D@vigrid.com> <1259358434.1608.43.camel@shumai.marcuscom.com> Message-Id: <034943AD-A5C7-4478-A0C1-63307E293156@vigrid.com> From: Daniel Eischen To: Joe Marcus Clarke In-Reply-To: <1259358434.1608.43.camel@shumai.marcuscom.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Date: Fri, 27 Nov 2009 17:50:24 -0500 Cc: "threads@freebsd.org" Subject: Re: [PATCH] Add missing pthread_condattr_{init, destroy} stubs to libc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:50:50 -0000 On Nov 27, 2009, at 4:47 PM, Joe Marcus Clarke wrote: > On Fri, 2009-11-27 at 16:19 -0500, Daniel Eischen wrote: >> On Nov 27, 2009, at 2:14 PM, Joe Marcus Clarke >> wrote: >> >>> On Fri, 2009-11-27 at 15:12 +0200, Kostik Belousov wrote: >>>> On Fri, Nov 27, 2009 at 12:15:18AM -0500, Joe Marcus Clarke wrote: >>>>> I would like permission to commit this patch which adds missing >>>>> pthread_condattr_{init,destroy} symbols to libc. I think I did >>>>> the >>>>> symbol addition correctly (and it seems to work). Without this, >>>>> the >>>>> weak symbols added in the libpthread-stubs port conflict with >>>>> those in >>>>> libthr, and applications with use these symbols can crash. >>>>> >>>>> I have temporarily hacked libpthread-stubs to fix this, but I >>>>> really >>>>> feel these stubs should be added to libc. I've also copied kib as >>>>> he >>>>> has been kind enough to review my work in the past. Thanks. >>>>> >>>>> http://www.marcuscom.com/downloads/stubs.diff >>>> >>>> It is FBSD_1.2 version that we use for symbols added after HEAD >>>> become >>>> CURRENT-9. >>> >>> Done. >> >> I don't think the symbols belong in FBSD_1.2. They already exist in >> libthr in a previous namespace. If you use FBSD_1.2, then you >> probably need to bump them in libthr and libc_r, and add compatible >> symbols (no problem there since there are no differences) for the >> previous versions. > > How would this be done? Would I add an FBSD_1.2 namespace to > pthread.map, or would FBSD_1.1 be sufficient? How would the > compatibility symbols be defined? I'm away and on an iPhone, you'll have to search for my notes on this or see how it's been done for other libc compat symbols.. > >> Still not sure why libc needs all libpthread stubs. Shouldn't be >> necessary. > > Agreed, but the problem comes with the libpthread-stubs port. This > port > was added as a dependency of libxcb (which is used by just about > everything in X). This port defines weak symbols for > pthread_condattr_destroy and pthread_condattr_init and maps them to a > function that simply returns 0. The problem is that if a binary is > linked to both this library and -pthread, and that binary calls > pthread_condattr_init(), it can be resolved in libpthread-stubs > instead > of libthr. When this happens, the init isn't done, and any subsequent > usage of the pthread_condattr_t structure results in a segfault. > > I'm certainly open to other suggestions for fixing this. You can reference the non-weak underscore versions in libpthread, and when non-null you know libphread is present and just dereference them. Or do something similar to libgcc (or is it libstdc++, I forget) and use pthread_create as you weakly referenced symbol. The idea is that if the weakly reference symbol is present, then you know libpthread is present. I may be misusing "reference" instead of "defined. static void *create_is_present = pthread_create; #pragma weak pthread_create If create_is_present is not NULL then the symbol is present. On travel, so I can't provide much more info right now. -- DE