[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#399035: LD_LIBRARY_PATH=/usr/lib/debug causes switch to ancient libpthread



Package: libc6-dbg
Version: 2.3.6-7

I see applications using a different thread library when using unstripped
libraries from /usr/lib/debug:

    $ ldd /usr/sbin/mysqld | grep libpthread
            libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7f64000)
    $ ls -l /lib/tls/libpthread.so.0
    lrwxrwxrwx  1 root root 19 2006-05-14 15:06 /lib/tls/libpthread.so.0 -> libpthread-2.3.6.so
    $ LD_LIBRARY_PATH=/usr/lib/debug ldd /usr/sbin/mysqld | grep libpthread
            libpthread.so.0 => /usr/lib/debug/libpthread.so.0 (0xb7e63000)
    $ ls -l /usr/lib/debug/libpthread.so.0
    lrwxrwxrwx  1 root root 18 2006-05-14 15:06 /usr/lib/debug/libpthread.so.0 -> libpthread-0.10.so

So mysqld is normally using libpthread-2.3.6 (NPTL), which is what I expected.

But when setting LD_LIBRARY_PATH=/usr/lib/debug, mysqld is now using
libpthread-0.10.so, which I believe is an ancient version of LinuxThreads with
fixed thread locations, for use only to provide compatibility with old/broken
applications.

So seemingly, when switching to unstripped libraries to debug a problem, we
will also switch to a very different threading library, which could easily
cause confusion and seems quite unfortunate.

My understanding of ld.so is unfortunately limited, but perhaps the problem is
related to missing libpthread.so.0 symbolic links?

    $ find /lib /usr/lib -name libpthread.so.0
    /lib/tls/libpthread.so.0
    /lib/libpthread.so.0
    /usr/lib/debug/libpthread.so.0

So I'm wondering if there is missing a symbolic link

    /usr/lib/debug/tls/libpthread.so.0 -> /usr/lib/debug/lib/tls/libpthread-2.3.6.so

but then similar links will also be required for other system libraries, I
suppose.

Alternatively, perhaps the bug is that the /usr/lib/debug/libpthread.so.0
symbolic link is pointing out the wrong libpthread (the ancient compatibility
one), which will usually be the wrong one.

So I'm not sure about the proper fix, but I do think the switch to different
threading lib when using unstripped libraries (as shown by ldd commands above)
is a bug.

 - Kristian.

System info:

$ uname -a
Linux ymer 2.6.13.4 #3 Thu Oct 27 01:07:26 CEST 2005 i686 GNU/Linux
$ ls -l /lib/libc.so.6
lrwxrwxrwx  1 root root 13 2006-05-14 15:06 /lib/libc.so.6 -> libc-2.3.6.so


-- 
Kristian Nielsen, Software Developer
MySQL AB, www.mysql.com
Are you MySQL certified?  www.mysql.com/certification




Reply to: