Date: Thu, 11 Sep 2008 14:56:54 -0500 From: Brooks Davis <brooks@freebsd.org> To: Barry Andrews <titanandrews@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: loading multi threaded library into executable enabled for single thread Message-ID: <20080911195653.GA53111@lor.one-eyed-alien.net> In-Reply-To: <eda4c18b0809111206t6438f87dmb8fab0db939c9980@mail.gmail.com> References: <eda4c18b0809111206t6438f87dmb8fab0db939c9980@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080911195653.GA53111>