Bug 114618
Summary: | pthread_attr_destroy reports free(): invalid pointer | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Ivan Loncar <ivan.loncar> | ||||||||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||||||||
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> | ||||||||||
Severity: | high | Docs Contact: | |||||||||||
Priority: | medium | ||||||||||||
Version: | 3.0 | ||||||||||||
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: | 2004-01-30 09:06:43 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: | |||||||||||||
Attachments: |
|
Description
Ivan Loncar
2004-01-30 08:09:54 UTC
Created attachment 97361 [details]
sample libmylib.so source
cc -D__USE_POSIX -D__REENTRANT -fpic -g -I. -c mylib.c -o mylib.o
ld -shared -o libmylib.so mylib.o
Created attachment 97362 [details]
Sample program mythrtest
gcc -o mythrtest mythrtest.c -L`pwd` -lmylib -lpthread
Created attachment 97363 [details]
sample libmy2lib.so source
cc -D__USE_POSIX -D__REENTRANT -fpic -g -I. -c my2lib.c -o my2lib.o
ld -shared -o libmy2lib.so my2lib.o
Created attachment 97364 [details]
Sample program mythrtest2
gcc -o mythrtest2 mythrtest2.c -L`pwd` -lmy2lib -lpthread
There are 2 very serious bugs in your testcase: 1) never ever use ld -shared directly, always use gcc -shared or g++ -shared The GCC driver knows the details how to link properly shared libraries on each platform, which is certainly not simply running ld -shared 2) if you use any pthread functions in a library which don't have also stubs in libc.so (this is the case of mylib.c, but not my2lib.c), then you absolutely must link with -lpthread, otherwise symbol versioning cannot work properly If you do this, your testcase will work just fine. There was a bug in libpthread.so when handling libraries built against glibc 2.0, fixed in glibc-2.3.2-95.7, which will cure also your incorrectly built testcase, but that doesn't mean linking things this way will not malfunction in other places (it will). glibc-2.3.2-95.7 (well, one of its successors) will show up in U2, but closing as a NOTABUG, since this is primarily because of a buggy testcase. |