This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/10652] getaddrinfo causes segfault if multithreaded and linked statically
- From: "redbugs at galexander dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 19 Nov 2009 15:18:13 -0000
- Subject: [Bug libc/10652] getaddrinfo causes segfault if multithreaded and linked statically
- References: <20090917113439.10652.heuler@infosim.net>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From redbugs at galexander dot org 2009-11-19 15:18 -------
I have not bothered to actually trace this but I have a likely suspect.
As I understand it, resolution is handled by libnss_*.so, which are still
dynamically linked even if the executable is statically linked. They
presumably feature weak extern references to various pthread functions.
If pthreoads is dynamically linked, these references succeed. If
pthreads is statically linked then the pthread symbols are not reexported
to things loaded with dlopen() like the libnss libraries.
I don't know a good solution but perhaps -rdynamic has some role to play?
Or perhaps a less bloated libc than glibc could be used, one which has a
number of simple resolvers built in? The libnss resolvers on my Linux
system take up 275kB which is enough space for many other unixes to
implement an entire libc....
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10652
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.