[Bug 1918035] Re: ld-2.31.so is not correctly packaged in libc6-dbg
Anastasios Andronidis
1918035 at bugs.launchpad.net
Fri Aug 26 16:11:00 UTC 2022
Any news on this?
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1918035
Title:
ld-2.31.so is not correctly packaged in libc6-dbg
Status in glibc package in Ubuntu:
Fix Released
Status in glibc source package in Focal:
Confirmed
Status in glibc source package in Groovy:
Won't Fix
Status in glibc source package in Hirsute:
Won't Fix
Bug description:
[Impact]
* Debug files for ld-linux are not found by gdb making debugging
programs harder.
[Test Plan]
* Run a gdb debugging session and observe symbols from ld-linux shown
properly:
root at ii:~# gdb -q /bin/date
Reading symbols from /bin/date...
Download failed: Function not implemented. Continuing without debug info for /bin/date.
(No debugging symbols found in /bin/date)
(gdb) starti
Starting program: /usr/bin/date
Download failed: Function not implemented. Continuing without debug info for /root/system-supplied DSO at 0x7ffff7fc6000.
Program stopped.
0x00007ffff7fc90d0 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) b _dl_debug_state
Download failed: Function not implemented. Continuing without source file ./elf/dl-debug.c.
Breakpoint 1 at 0x7ffff7fd9fc0: file dl-debug.c, line 73.
(gdb) c
Continuing.
Breakpoint 1, __GI__dl_debug_state () at dl-debug.c:73
Download failed: Function not implemented. Continuing without source file ./elf/dl-debug.c.
73 dl-debug.c: No such file or directory.
(gdb) bt
#0 __GI__dl_debug_state () at dl-debug.c:73
#1 0x00007ffff7fcc18e in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:1810
#2 0x00007ffff7fe73df in _dl_sysdep_start (start_argptr=start_argptr at entry=0x7fffffffe5c0, dl_main=dl_main at entry=0x7ffff7fca610 <dl_main>) at ../elf/dl-sysdep.c:250
#3 0x00007ffff7fca11a in _dl_start_final (arg=0x7fffffffe5c0) at rtld.c:490
#4 _dl_start (arg=0x7fffffffe5c0) at rtld.c:583
#5 0x00007ffff7fc90d8 in _start () from /lib64/ld-linux-x86-64.so.2
#6 0x0000000000000001 in ?? ()
#7 0x00007fffffffe7fa in ?? ()
#8 0x0000000000000000 in ?? ()
[Where problems could occur]
* The fix is dropping using DH_COMPAT=8 for dh_strip. This override
for compat level was in place to work around a valgrind issue (
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677876 ) that has
been fixed already in Ubuntu 18.04 and later releases. Almost all
other packages use the default compat level for dh_strip thus there is
no expected problem to occur.
[Original Bug Text]
lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Using gdb 9.2-0ubuntu1~20.04, libc6 and libc6-dbg 2.31-0ubuntu9.2
gdb -q /bin/date
Reading symbols from /bin/date...
(No debugging symbols found in /bin/date)
(gdb) starti
Starting program: /usr/bin/date
Program stopped.
0x00007ffff7fd0100 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) b _dl_debug_state
Breakpoint 1 at 0x7ffff7fe11d0
(gdb) c
Continuing.
Breakpoint 1, 0x00007ffff7fe11d0 in _dl_debug_state () from /lib64/ld-linux-x86-64.so.2
(gdb) bt
#0 0x00007ffff7fe11d0 in _dl_debug_state () from /lib64/ld-linux-x86-64.so.2
#1 0x00007ffff7fd2fd1 in ?? () from /lib64/ld-linux-x86-64.so.2
#2 0x00007ffff7febc3b in ?? () from /lib64/ld-linux-x86-64.so.2
#3 0x00007ffff7fd104c in ?? () from /lib64/ld-linux-x86-64.so.2
#4 0x00007ffff7fd0108 in ?? () from /lib64/ld-linux-x86-64.so.2
#5 0x0000000000000001 in ?? ()
#6 0x00007fffffffe58c in ?? ()
#7 0x0000000000000000 in ?? ()
Note that debug info for ld-linux is missing despite libc6-dbg being
installed.
(gdb) disable 1
(gdb) catch syscall exit_group
Catchpoint 2 (syscall 'exit_group' [231])
(gdb) c
Continuing.
Sat Mar 6 22:47:08 PST 2021
Catchpoint 2 (call to syscall exit_group), __GI__exit (status=status at entry=0) at ../sysdeps/unix/sysv/linux/_exit.c:31
31 ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.
Note that debug info for `libc.so.6` was loaded correctly, but debug
info for ld-linux was not.
(gdb) info shared
From To Syms Read Shared Object Library
0x00007ffff7fd0100 0x00007ffff7ff2674 Yes (*) /lib64/ld-linux-x86-64.so.2
0x00007ffff7df4630 0x00007ffff7f6920d Yes /lib/x86_64-linux-gnu/libc.so.6
(*): Shared library is missing debugging information.
----
As far as I can tell, this is happening because libc6-dbg installs ld-2.31.so into the wrong place:
dpkg -L libc6-dbg | grep /ld-2.31
/usr/lib/debug/lib/libc6-prof/x86_64-linux-gnu/ld-2.31.so
/usr/lib/debug/lib/x86_64-linux-gnu/ld-2.31.so
Since ld-linux resolves to /lib64/ld-linux-x86-64.so.2, GDB looks for
debug symbols in the following paths:
/lib64/.debug/ld-2.31.so
/usr/lib/debug/lib64/ld-2.31.so
/usr/lib/x86_64-linux-gnu/.debug/ld-2.31.so
/usr/lib/debug/usr/lib/x86_64-linux-gnu/ld-2.31.so
/usr/lib/x86_64-linux-gnu/.debug/ld-2.31.so
/usr/lib/debug/usr/lib/x86_64-linux-gnu/ld-2.31.so
None of these matches the actual installed path, so debug symbols are
not loaded.
P.S. Manually adding symbols via add-symbol-file
/usr/lib/debug/lib/x86_64-linux-gnu/ld-2.31.so works fine, but this
should be automatic.
P.P.S. After running
sudo mkdir /usr/lib/debug/lib64
sudo ln -s /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.31.so /usr/lib/debug/lib64
things start working as expected:
gdb -q /bin/date
Reading symbols from /bin/date...
(No debugging symbols found in /bin/date)
(gdb) starti
Starting program: /usr/bin/date
Program stopped.
0x00007ffff7fd0100 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) b _dl_debug_state
Breakpoint 1 at 0x7ffff7fe11d0: file dl-debug.c, line 73.
(gdb) c
Continuing.
Breakpoint 1, __GI__dl_debug_state () at dl-debug.c:73
73 dl-debug.c: No such file or directory.
(gdb) bt
#0 __GI__dl_debug_state () at dl-debug.c:73
#1 0x00007ffff7fd2fd1 in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:1661
#2 0x00007ffff7febc3b in _dl_sysdep_start (start_argptr=start_argptr at entry=0x7fffffffe390, dl_main=dl_main at entry=0x7ffff7fd15e0 <dl_main>) at ../elf/dl-sysdep.c:252
#3 0x00007ffff7fd104c in _dl_start_final (arg=0x7fffffffe390) at rtld.c:449
#4 _dl_start (arg=0x7fffffffe390) at rtld.c:539
#5 0x00007ffff7fd0108 in _start () from /lib64/ld-linux-x86-64.so.2
#6 0x0000000000000001 in ?? ()
#7 0x00007fffffffe5c8 in ?? ()
#8 0x0000000000000000 in ?? ()
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: libc6-dbg 2.31-0ubuntu9.2
Uname: Linux 5.4.72-microsoft-standard-WSL2 x86_64
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperMD5CheckResult: skip
Date: Sat Mar 6 22:39:51 2021
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
LANG=C.UTF-8
SHELL=/bin/bash
SourcePackage: glibc
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1918035/+subscriptions
More information about the foundations-bugs
mailing list