From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 12 13:10:48 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCA28106567B for ; Fri, 12 Sep 2008 13:10:48 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA05.westchester.pa.mail.comcast.net (qmta05.westchester.pa.mail.comcast.net [76.96.62.48]) by mx1.freebsd.org (Postfix) with ESMTP id 7031B8FC28 for ; Fri, 12 Sep 2008 13:10:48 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA11.westchester.pa.mail.comcast.net ([76.96.62.36]) by QMTA05.westchester.pa.mail.comcast.net with comcast id DmlQ1a0070mv7h055pAnA2; Fri, 12 Sep 2008 13:10:47 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA11.westchester.pa.mail.comcast.net with comcast id DpAm1a00R4v8bD73XpAnm7; Fri, 12 Sep 2008 13:10:47 +0000 X-Authority-Analysis: v=1.0 c=1 a=W33fUFesqP8A:10 a=p7sCquAJk-0A:10 a=QycZ5dHgAAAA:8 a=7r2qblK4LXpsiqaa7cUA:9 a=3ZBr7cIvv83aAWLw9ykA:7 a=R4bMjKT2j1v3HNqt5XiFFxi-8I8A:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id E444B17B81A; Fri, 12 Sep 2008 06:10:45 -0700 (PDT) Date: Fri, 12 Sep 2008 06:10:45 -0700 From: Jeremy Chadwick To: Barry Andrews Message-ID: <20080912131045.GA56923@icarus.home.lan> References: <48CA555A.4050104@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48CA555A.4050104@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Daniel Eischen , freebsd-hackers@freebsd.org Subject: Re: loading multi threaded library into executable enabled for single thread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 13:10:48 -0000 On Fri, Sep 12, 2008 at 07:41:14AM -0400, Barry Andrews wrote: > Do you know if this is documented in Release Notes or Known Issues or > somewhere? Why would it be an "issue"? gcc -pthread and libpthread linking is documented pretty much everywhere on the web. There isn't anything broken about it, it's how it's done on older FreeBSD. Note that all of this has significantly changed in later FreeBSD versions, and that the 5.x series was deprecated a very long time ago. >> On Thu, 11 Sep 2008, Barry Andrews wrote: >> >>> Hi All, >>> >>> I have a multi-threaded library that is linked against libpthread. >>> When I >>> load this lib into a tclsh process on FreeBSD, I get this error, >>> "Recurse on >>> private mutex". and crash. I understand that I can have this issue >>> when the >>> executable is not linked against libpthread but one of the loaded >>> libs is. >>> Basically, it thinks it's in single threaded mode. >> >> This must be an older version of FreeBSD. I think you must >> link your application (tclsh or whatever) against libpthread >> in order for this to work. The libc functions won't get properly >> overloaded by their equivalents in libpthread unless you do >> this. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |