Bug 20997 - Symbol version problem in libpthread
Summary: Symbol version problem in libpthread
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-17 04:39 UTC by Red Hat Bugzilla
Modified: 2008-03-13 19:18 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-11-19 02:13:55 UTC
Embargoed:


Attachments (Terms of Use)
The testcase (802 bytes, application/octet-stream)
2000-11-17 04:39 UTC, Red Hat Bugzilla
no flags Details
A patch (3.03 KB, patch)
2000-11-18 08:43 UTC, Red Hat Bugzilla
no flags Details | Diff

Description Red Hat Bugzilla 2000-11-17 04:39:09 UTC
Symbols, pread, __pread64, pread64, pwrite, __pwrite64, pwrite64, lseek64
and open64, have
version name GLIBC_2.2 in libpthread. But they have version name GLIBC_2.1
in libc. Their
version names are different. As the result, the wrong functions can be
called in a thread
application. I will attach a testcase here.

# make
cc -g -O   -c -o test.o test.c
cc -o foo.o -c -g -O -fPIC foo.c
ar rv libfoo.a foo.o
a - foo.o
cc -o test1 test.o libfoo.a -lpthread
cc -shared -o libfoo.so foo.o
cc -o test2 test.o libfoo.so -lpthread -Wl,-rpath,.
test1:
        `__pwrite64' is bound to /lib/libc.so
test2:
        `pread' is bound to /lib/libc.so
        `__pread64' is bound to /lib/libc.so
        `pread64' is bound to /lib/libc.so
        `pwrite' is bound to /lib/libc.so
        `__pwrite64' is bound to /lib/libc.so
        `pwrite64' is bound to /lib/libc.so
        `lseek64' is bound to /lib/libc.so
        `open64' is bound to /lib/libc.so

They all are supposed to be bound to libpthread, but they are bound to libc
instead.

Comment 1 Red Hat Bugzilla 2000-11-17 04:39:42 UTC
Created attachment 5480 [details]
The testcase

Comment 2 Red Hat Bugzilla 2000-11-18 08:43:03 UTC
Created attachment 5500 [details]
A patch

Comment 3 Red Hat Bugzilla 2000-11-18 08:44:23 UTC
I submitted a patch. It seems to work for me.

Comment 4 Red Hat Bugzilla 2000-11-18 20:40:48 UTC
Unless Ulrich accepts this into CVS, I don't want to put this in,
since it would just cause us to be incompatible with everyone else
(binaries compiled with -lpthread on systems with your patch
would not use the cancelation wrappers on systems without it).

Comment 5 Red Hat Bugzilla 2000-11-19 02:13:52 UTC
As it stands today, glibc 2.2 is broken with thread applications. So far, Ulrich
hasn't
acknowledged it is a bug. If he doesn't see it as bug, which I believe it is, I
don't
know if he will accept it into CVS.

BTW, thread applications with glibc 2.2 may not use the cancelation wrappers
today.
At least, it won't happen on systems with my patch installed.


Note You need to log in before you can comment on or make changes to this bug.