From owner-freebsd-threads@FreeBSD.ORG Wed Dec 21 19:10:10 2011 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 442101065680 for ; Wed, 21 Dec 2011 19:10:10 +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 1FC028FC1B for ; Wed, 21 Dec 2011 19:10:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBLJAAJm009817 for ; Wed, 21 Dec 2011 19:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBLJA91e009816; Wed, 21 Dec 2011 19:10:09 GMT (envelope-from gnats) Resent-Date: Wed, 21 Dec 2011 19:10:09 GMT Resent-Message-Id: <201112211910.pBLJA91e009816@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steven Wills Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9950310656DC for ; Wed, 21 Dec 2011 19:00:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 418BB8FC16 for ; Wed, 21 Dec 2011 19:00:13 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pBLJ0D6n034357 for ; Wed, 21 Dec 2011 19:00:13 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id pBLJ0Cr0034356; Wed, 21 Dec 2011 19:00:12 GMT (envelope-from nobody) Message-Id: <201112211900.pBLJ0Cr0034356@red.freebsd.org> Date: Wed, 21 Dec 2011 19:00:12 GMT From: Steven Wills To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: threads/163512: libc defaults to single threaded 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: Wed, 21 Dec 2011 19:10:10 -0000 >Number: 163512 >Category: threads >Synopsis: libc defaults to single threaded >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Dec 21 19:10:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Steven Wills >Release: >Organization: >Environment: >Description: 1) libc defaults to being single-threaded 2) thus apps not linked against libthr don't initialize the structures that threading depends on 3) this causes bugs when said app loads a library that loads libthr 4) said library will take the threaded code path and reference uninitialized data structures An example of this can be seen by removing ports/devel/p5-Glib2/files/patch-threadstest then after building, run "make test" from work/Glib-1.241. Perl will hang in state umtxn. I believe this may also be the source of an intermittent hang in automoc4 (also stuck in state umtxn) seen while building x11/kde4. This was discussed here: http://mail.kde.org/pipermail/kde-freebsd/2011-November/012211.html https://bugs.kde.org/show_bug.cgi?id=276461 >How-To-Repeat: 1. update ports tree 2. Ensure perl is not build with threads (currently not building with threads is the default) 2. cd /usr/ports/devel/p5-Glib2 3. rm files/patch-threadstest 4. make 5. cd work/Glib-1.241 6. make test 7. Verify perl is hung trying to run t/9.t >Fix: I'm told merging libthr into libc may help, but I'm not really sure. No ideas beyond that. >Release-Note: >Audit-Trail: >Unformatted: