This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Symbols missing from global map?


On 16 Dec 1998 07:50:45 -0800, 
Ulrich Drepper <drepper@cygnus.com> wrote:
>Keith Owens <kaos@ocs.com.au> writes:
>
>> >Fix:
>>         Adding __dup, __pipe, __waitpid etc. to build/libc.map makes
>>         them visible again.  I am guessing here, this may be the wrong
>>         fix.
>
>Yes, it's very wrong.  Why should these symbols have a leading
>underscore if not to show they are *INTERNAL* symbols?  One must not
>use them.

I'm not using them, libstdc++ is.  I did some more digging, the problem
looks like a binary incompatibility.

PRCS 1.2.3 is a mixture of C and C++.  It was compiled using c++/gcc
2.7.2.3 against libstdc++ 2.7.2.8 and libc-2.0.5.so.

Original environment.

ldd src/prcs
        libstdc++.so.2.7.2 => /usr/lib/libstdc++.so.2.7.2 (0x40002000)
        libm.so.6 => /lib/libm.so.6 (0x4003c000)
        libc.so.6 => /lib/libc.so.6 (0x40055000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)

lrwxrwxrwx   1 root     root           20 Jun 22 22:02 /usr/lib/libstdc++.so.2.7.2 -> libstdc++.so.2.7.2.8*
lrwxrwxrwx   1 root     root           13 Jun 22 21:56 /lib/libm.so.6 -> libm-2.0.5.so*
lrwxrwxrwx   1 root     root           13 Jun 22 21:56 /lib/libc.so.6 -> libc-2.0.5.so*
lrwxrwxrwx   1 root     root           11 Jun 22 21:56 /lib/ld-linux.so.2 -> ld-2.0.5.so

prcs works perfectly against glibc 2.0.  When run against 2.1, it gets SEGV.

gdb src/prcs
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-redhat-linux), Copyright 1996 Free Software Foundation, Inc...
(gdb) r
Starting program: /home2/root/download/prod/prcs-1.2.3/src/prcs 

Program received signal SIGSEGV, Segmentation fault.
0x20002 in ?? ()
Current language:  auto; currently c
(gdb) bt
#0  0x20002 in ?? ()
#1  0x400ba4b6 in _IO_vsnprintf (string=0x80b20c0 "", maxlen=1024, format=0x4013f1a5 "%d", args=0xbffffa60) at vsnprintf.c:129
#2  0x400b411a in __snprintf (s=0x80b20c0 "", maxlen=1024, format=0x4013f1a5 "%d") at snprintf.c:37
#3  0x40130791 in __nscd_getpwuid_r (uid=200, resultbuf=0x40145910, buffer=0x80b20c0 "", buflen=1024) at nscd_getpw_r.c:56
#4  0x400eff74 in __getpwuid_r (uid=200, resbuf=0x40145910, buffer=0x80b20c0 "", buflen=1024, result=0xbffffacc) at ../nss/getXXbyYY_r.c:129
#5  0x400ef960 in getpwuid (uid=200) at ../nss/getXXbyYY.c:109
#6  0x806c427 in get_login () at misc.cc:395
#7  0x804d525 in main (argc=1, argv=0xbffffb54) at prcs.cc:1201
(gdb) 

Test environment.

ldd src/prcs
        libstdc++.so.2.7.2 => /usr/lib/libstdc++.so.2.7.2 (0x40017000)
        libm.so.6 => /lib/libm.so.6 (0x40051000)
        libc.so.6 => /lib/libc.so.6 (0x4006c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

lrwxrwxrwx   1 root     root           20 Nov 14 18:09 /usr/lib/libstdc++.so.2.7.2 -> libstdc++.so.2.7.2.8*
lrwxrwxrwx   1 root     root           15 Dec 17 10:45 /lib/libc.so.6 -> libc-2.0.106.so*
lrwxrwxrwx   1 root     root           15 Dec 17 10:45 /lib/libm.so.6 -> libm-2.0.106.so*
lrwxrwxrwx   1 root     root           13 Dec 17 10:45 /lib/ld-linux.so.2 -> ld-2.0.106.so*


glibc 2.1 FAQ 2.21 says "{UD} But since in the case of a shared
libstdc++ the version numbers should be different existing programs
will continue to work.", alas this is not true.

When I tried to recompile prcs using c++/gcc 2.7.2.3 against libstdc++
2.7.2.8 and libc-2.0.106.so, it compiled OK but failed in link with
/usr/lib/libstdc++.so: undefined reference to `__dup2'
/usr/lib/libstdc++.so: undefined reference to `__pipe'
/usr/lib/libstdc++.so: undefined reference to `__waitpid'
That is covered (sort of) in FAQ 2.21, it is an unsupported
combination.

The main problem is that an existing C++ program fails to run with
glibc 2.1.  The missing references to __dup2, __pipe and __waitpid may
or may not be relevant.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]