Segfault when mapping libpthread -> libthr

Joe Peterson lavajoe at gentoo.org
Sun Sep 16 21:35:34 PDT 2007


Jason Evans wrote:
> I saw something similar a while back when investigating malloc problem 
> reports (that turned out to be a threads problem).  It looked to me like 
> there was a minor incompatibility in the exported symbols of libpthread 
> and libthr that caused rtld to pull some symbols from libpthread, 
> despite the libmap.conf settings.  IIRC, the symbol incompatibilities 
> did not at first glance seem like they would cause the problem, but my 
> guess (unverified) was that dynamic dependency resolution was chasing a 
> dependency into libpthread before a legitimate dependency through libthr 
> managed to map the symbol.
> 
> I'm sorry that I don't remember the nature of the library interface 
> incompatibilities.  It seems to me though that it was pretty subtle, 
> having to do with weak internally exported symbols (available to other 
> .o's within the library, but not to external consumers of the library).

This would indeed explain the issue.  It is as if some symbols come from
libthr and some from libpthread.  Or maybe sometimes the libthr version
gets called and other timed the libpthread.

For now, I am symlinking libpthread.so and libc_r.so to libthr.so (and
same for the .a files), and this seems to fix the issue.  These are the
same libs that we map in libmap.conf.

If you remember more about this let me know, or if anyone else knows
more about this potential issue, I'd love to hear more!

					Thanks, Joe



More information about the freebsd-threads mailing list