ld-2.31.so is not correctly packaged in libc6-dbg
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Won't Fix
|
Undecided
|
Unassigned | ||
Hirsute |
Won't Fix
|
Undecided
|
Unassigned |
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@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-
Program stopped.
0x00007ffff7fc90d0 in _start () from /lib64/
(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_
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_
#1 0x00007ffff7fcc18e in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=
#2 0x00007ffff7fe73df in _dl_sysdep_start (start_
#3 0x00007ffff7fca11a in _dl_start_final (arg=0x7fffffff
#4 _dl_start (arg=0x7fffffff
#5 0x00007ffff7fc90d8 in _start () from /lib64/
#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:/
[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/
(gdb) b _dl_debug_state
Breakpoint 1 at 0x7ffff7fe11d0
(gdb) c
Continuing.
Breakpoint 1, 0x00007ffff7fe11d0 in _dl_debug_state () from /lib64/
(gdb) bt
#0 0x00007ffff7fe11d0 in _dl_debug_state () from /lib64/
#1 0x00007ffff7fd2fd1 in ?? () from /lib64/
#2 0x00007ffff7febc3b in ?? () from /lib64/
#3 0x00007ffff7fd104c in ?? () from /lib64/
#4 0x00007ffff7fd0108 in ?? () from /lib64/
#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=
31 ../sysdeps/
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/
0x00007ffff7df4630 0x00007ffff7f6920d Yes /lib/x86_
(*): 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/
/usr/lib/
Since ld-linux resolves to /lib64/
/lib64/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
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/
P.P.S. After running
sudo mkdir /usr/lib/
sudo ln -s /usr/lib/
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/
(gdb) b _dl_debug_state
Breakpoint 1 at 0x7ffff7fe11d0: file dl-debug.c, line 73.
(gdb) c
Continuing.
Breakpoint 1, __GI__dl_
73 dl-debug.c: No such file or directory.
(gdb) bt
#0 __GI__dl_
#1 0x00007ffff7fd2fd1 in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=
#2 0x00007ffff7febc3b in _dl_sysdep_start (start_
#3 0x00007ffff7fd104c in _dl_start_final (arg=0x7fffffff
#4 _dl_start (arg=0x7fffffff
#5 0x00007ffff7fd0108 in _start () from /lib64/
#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-
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Sat Mar 6 22:39:51 2021
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SHELL=/bin/bash
SourcePackage: glibc
UpgradeStatus: No upgrade log present (probably fresh install)
description: | updated |
Changed in glibc (Ubuntu Groovy): | |
status: | New → Won't Fix |
Changed in glibc (Ubuntu Focal): | |
status: | New → In Progress |
Changed in glibc (Ubuntu Hirsute): | |
status: | New → Won't Fix |
Fixed in 2.33-0ubuntu6.