Bug 145941
Summary: | pthread_atfork symbol weird behavior | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | mathieu lacage <lacage> |
Component: | glibc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-01-24 10:36:34 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
mathieu lacage
2005-01-24 10:28:29 UTC
You are linking the shared library incorrectly. cc -lpthread -ldl -shared -o bin/libprofiler/libprofiler.so bin/libprofiler/manager.o bin/libprofiler/record.o -Lbin/libdebug -ldebug-pic Both -lpthread and -ldl must come after the object files (or .a libraries) that use them on the link line. libpthread.so is a linker script that sources in a small .a library and a shared library. If doesn't come up after the objects that use the pthread_* etc. interfaces, although you link the shared library against libpthread.so.0, you don't link in libpthread_nonshared.a (unless you surround almost everything on the command line between -Wl,--start-group and -Wl,--end-group, so that .a libs are searched repeatedly). pthread_atfork is defined in libpthread_nonshared.a, so that's why things don't work as expected for you. Simply move -lpthread -ldl to the end of cmdline and it will DTRT. |