From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 11 19:56:05 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 AB27D1065676 for ; Thu, 11 Sep 2008 19:56:05 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id 305AE8FC15 for ; Thu, 11 Sep 2008 19:56:05 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.2) with ESMTP id m8BJusmC054008; Thu, 11 Sep 2008 14:56:54 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id m8BJus4h054007; Thu, 11 Sep 2008 14:56:54 -0500 (CDT) (envelope-from brooks) Date: Thu, 11 Sep 2008 14:56:54 -0500 From: Brooks Davis To: Barry Andrews Message-ID: <20080911195653.GA53111@lor.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Thu, 11 Sep 2008 14:56:54 -0500 (CDT) Cc: 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: Thu, 11 Sep 2008 19:56:05 -0000 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 11, 2008 at 03:06:35PM -0400, Barry Andrews wrote: > Hi All, >=20 > 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 t= he > executable is not linked against libpthread but one of the loaded libs is. > Basically, it thinks it's in single threaded mode. >=20 > I can get around this issue, by doing export LD_PRELOAD=3Dlibpthread.so.1, > however this is a hack at best. Is there any other way to get around this > issue other than linking tclsh with libpthread ( because that's not an > option) >=20 > I thought of re-building libpthread with the offending code commented out, > and that did work, however I ran into other issues, so I think it's not a > very "safe" option. >=20 > My feeling is that this is a FreeBSD issue because it's not happening on > other platforms, Linux, Solaris. >=20 > Any suggestions are welcome. Many thanks! It would be helpful if you could provide: - your FreeBSD version - the output of "ldd libyourlib.so" - the output of "ldd yourprogram" I wouldn't be supprised to find that the program and library are linked aga= inst different threading libraries. If so, one of them will need to be relinked= or you will need to use libmap.conf to cause it to use the other one. -- Brooks --2fHTh5uZTiUOsy+g Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iD8DBQFIyXgFXY6L6fI4GtQRAncEAKCGe+TUZcGZyOlG6EdT9z4oHw5rjwCfe50C 1F5AEnE1U3TeAc005pgi4Tc= =lsGy -----END PGP SIGNATURE----- --2fHTh5uZTiUOsy+g--