Public bug reported:

I have installed libc6-dbg and have the /usr/lib/debug directory.
However, I cannot get my application to actually link against the
libraries in this directory to have access to the debug symbols.  This
appears to be related to some symlink problems.

I have written a trivial Hello, World! program and compiled it as:
a...@danu:~/test/c$ gcc -Wall helloworld.c
a...@danu:~/test/c$ ./a.out 
Hello, world!

I then run ldd on the executable and see that it linked against the normal 
libc.so:
a...@danu:~/test/c$ ldd a.out 
        linux-gate.so.1 =>  (0x007a3000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00dfc000)
        /lib/ld-linux.so.2 (0x00470000)

Similarly, even when running:
a...@danu:~/test/c$ LD_LIBRARY_PATH=/usr/lib/debug/lib 
LD_TRACE_LOADED_OBJECTS=1 ./a.out 
        linux-gate.so.1 =>  (0x0084d000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00ae3000)
        /lib/ld-linux.so.2 (0x00aa7000)

I also tried running gcc with a -L option, but got the same results:
a...@danu:~/test/c$ gcc -Wall helloworld.c -L/usr/lib/debug/lib/
a...@danu:~/test/c$ ldd a.out
        linux-gate.so.1 =>  (0x004ad000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00110000)
        /lib/ld-linux.so.2 (0x00360000)
a...@danu:~/test/c$ LD_LIBRARY_PATH=/usr/lib/debug/lib 
LD_TRACE_LOADED_OBJECTS=1 ./a.out 
        linux-gate.so.1 =>  (0x00cd7000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x008b4000)
        /lib/ld-linux.so.2 (0x00c01000)

It appears to be linking against libc.so.6, which does not exist in
/usr/lib/debug.  Indeed, even /lib/tls/i686/cmov/libc.so.6 is a symlink
to /lib/tls/i686/cmov/libc-2.11.1.so.  There does, however, exist a
/usr/lib/debug/lib/libc-2.11.1.so.  Therefore, I tried making a symlink:

a...@danu:~/test/c$ sudo ln -s /usr/lib/debug/lib/libc-2.11.1.so 
/usr/lib/debug/lib/libc.so.6
a...@danu:~/test/c$ LD_LIBRARY_PATH=/usr/lib/debug/lib 
LD_TRACE_LOADED_OBJECTS=1 ./a.out 
Segmentation fault

We see a new result, implying that the link therefore works, but it's a
segfault, which is obviously less good :).


My system information is:

a...@danu:~/test/c$ lsb_release -rd
Description:    Ubuntu 10.04 LTS
Release:        10.04

a...@danu:~/test/c$ apt-cache policy libc6-dbg
libc6-dbg:
  Installed: 2.11.1-0ubuntu7.1
  Candidate: 2.11.1-0ubuntu7.1
  Version table:
 *** 2.11.1-0ubuntu7.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
        100 /var/lib/dpkg/status
     2.11.1-0ubuntu7 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages


Thank you very much.  If I can provide any information, please let me know.

** Affects: eglibc (Ubuntu)
     Importance: Undecided
         Status: New

-- 
libc6-dbg: cannot link against debug libraries
https://bugs.launchpad.net/bugs/591582
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to