Bug 132102 - problem with /lib/tls/librt.so.1
problem with /lib/tls/librt.so.1
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-08 15:56 EDT by adams
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-11 09:11:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description adams 2004-09-08 15:56:17 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7)
Gecko/20040707 Firefox/0.9.2

Description of problem:
Try compiling the following code with 
     gcc -o getclockres getclockres.c -lrt
and then 
     gcc -o getclockres getclockres.c /usr/lib/librt.a

/*
***********************************************************
*/
#include <unistd.h>
#include <time.h>
#include <sys/time.h>

int main()
{
        struct timespec clock_resolution;
        int stat;

        stat = clock_getres(CLOCK_REALTIME, &clock_resolution);
        printf("CLOCK_REALTIME: Clock resolution is %d seconds, %1d
nanoseconds (%f seconds)\n",clock_resolution.tv_sec,
clock_resolution.tv_nsec, (clock_resolution.tv_nsec/1000000000.0));
}

/*
***********************************************************
*/

I get a successful run with the librt.a but I get the error below with
-lrt.

# ./getclockres
./getclockres: relocation error: ./getclockres: symbol
__pthread_initialize, version GLIBC_PRIVATE not defined in file
libpthread.so.0 with link time reference

Version-Release number of selected component (if applicable):
glibc-2.3.3-27

How reproducible:
Always

Steps to Reproduce:
1.compile example code both ways as stated in description
2.check runtime between compilations in step 1
    

Actual Results:  # ./getclockres
./getclockres: relocation error: ./getclockres: symbol
__pthread_initialize, version GLIBC_PRIVATE not defined in file
libpthread.so.0 with link time reference

Expected Results:  CLOCK_REALTIME: Clock resolution is 0 seconds,
999848 nanoseconds (0.001000 seconds)

Additional info:
Comment 1 Jakub Jelinek 2004-09-09 03:48:56 EDT
Looks like hosed upgrade.
If you have /lib/tls/librtkaio*, please remove it and rerun /sbin/ldconfig
(though glibc-2.3.3-26 and above glibc_post_upgrade is supposed to
deal with that).
If that doesn't help, please specify from which distro you have upgraded
(if any), ls -l /lib/{,i686/,tls/}lib{rt,pthread,c}*
and rpm -q --qf '%{name}-%{version}-%{release}.%{arch}\n' glibc
Comment 2 adams 2004-09-09 10:50:36 EDT
I didn't find the librtkaio*

# ll /lib/tls/librtkaio*
ls: /lib/tls/librtkaio*: No such file or directory

So here's the output from step 2:

# ls -l /lib/{,i686/,tls/}lib{rt,pthread,c}*
-rwxr-xr-x  1 root root 1431320 May 11 08:20 /lib/i686/libc-2.3.3.so
lrwxrwxrwx  1 root root      13 Aug  4 15:54 /lib/i686/libc.so.6 ->
libc-2.3.3.so
-rwxr-xr-x  1 root root   89156 May 11 08:20 /lib/i686/libpthread-0.10.so
lrwxrwxrwx  1 root root      18 Aug  4 15:54 /lib/i686/libpthread.so.0
-> libpthread-0.10.so
-rwxr-xr-x  1 root root   43808 May 11 08:20 /lib/i686/librt-2.3.3.so
lrwxrwxrwx  1 root root      14 Aug  4 15:54 /lib/i686/librt.so.1 ->
librt-2.3.3.so
-rwxr-xr-x  1 root root 1446984 May 11 08:20 /lib/libc-2.3.3.so
lrwxrwxrwx  1 root root      11 Aug  4 16:12 /lib/libcap.so -> libcap.so.1
lrwxrwxrwx  1 root root      14 Aug  4 16:00 /lib/libcap.so.1 ->
libcap.so.1.10
-rwxr-xr-x  1 root root   11820 Mar  2  2004 /lib/libcap.so.1.10
-rwxr-xr-x  1 root root  192396 May 11 08:20 /lib/libcidn-2.3.3.so
lrwxrwxrwx  1 root root      16 Aug  4 15:54 /lib/libcidn.so.1 ->
libcidn-2.3.3.so
lrwxrwxrwx  1 root root      17 Aug  4 15:54 /lib/libcom_err.so.2 ->
libcom_err.so.2.1
-rwxr-xr-x  1 root root    7100 Apr  8 09:31 /lib/libcom_err.so.2.1
-rwxr-xr-x  1 root root   28408 May 11 08:20 /lib/libcrypt-2.3.3.so
-rwxr-xr-x  1 root root  852976 Mar  5  2004 /lib/libcrypto.so.0.9.6b
-rwxr-xr-x  1 root root  973340 Mar 25 09:38 /lib/libcrypto.so.0.9.7a
lrwxrwxrwx  1 root root      19 Aug  4 16:30 /lib/libcrypto.so.2 ->
libcrypto.so.0.9.6b
lrwxrwxrwx  1 root root      19 Aug  4 15:55 /lib/libcrypto.so.4 ->
libcrypto.so.0.9.7a
lrwxrwxrwx  1 root root      17 Aug  4 15:54 /lib/libcrypt.so.1 ->
libcrypt-2.3.3.so
lrwxrwxrwx  1 root root       9 Aug  9 14:50 /lib/libc.so -> libc.so.6
lrwxrwxrwx  1 root root      13 Aug  4 15:54 /lib/libc.so.6 ->
libc-2.3.3.so
-rwxr-xr-x  1 root root   95012 May 11 08:20 /lib/libpthread-0.10.so
lrwxrwxrwx  1 root root      18 Aug  4 15:54 /lib/libpthread.so.0 ->
libpthread-0.10.so
-rwxr-xr-x  1 root root   43784 May 11 08:20 /lib/librt-2.3.3.so
lrwxrwxrwx  1 root root      14 Aug  4 15:54 /lib/librt.so.1 ->
librt-2.3.3.so
-rwxr-xr-x  1 root root 1455084 May 11 08:20 /lib/tls/libc-2.3.3.so
lrwxrwxrwx  1 root root      13 Aug 10 13:37 /lib/tls/libc.so.6 ->
libc-2.3.3.so
-rwxr-xr-x  1 root root  106212 May 11 08:20 /lib/tls/libpthread-0.61.so
lrwxrwxrwx  1 root root      18 Aug  4 15:54 /lib/tls/libpthread.so.0
-> libpthread-0.61.so
-rwxr-xr-x  1 root root   50940 May 11 08:20 /lib/tls/librt-2.3.3.so
lrwxrwxrwx  1 root root      14 Aug  4 15:54 /lib/tls/librt.so.1 ->
librt-2.3.3.so

# rpm -q --qf '%{name}-%{version}-%{release}.%{arch}\n' glibc
glibc-2.3.3-27.i686
Comment 3 Ulrich Drepper 2004-09-27 21:21:18 EDT
You in any case have a mismatch between libc and librt which are used.
 They absolutely must come from the same directory.  So, run

  ldd APPLICATION

to see which version is used.
Comment 4 Jakub Jelinek 2004-11-11 09:11:42 EST
If you have more information, please reopen.

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