[Bug 1818918] Re: gdb doesn't search in debug-file-directory for .gnu_debugaltlink
Tiago Stürmer Daitx
1818918 at bugs.launchpad.net
Fri Nov 13 23:55:54 UTC 2020
I tried the testcase from comment #12 in Focal and Hirsute and it worked
just fine:
$ gdb --ex 'set debug-file-directory /tmp/dbgsym/usr/lib/debug:/usr/lib/debug' --ex 'file /bin/cat' --ex 'core-file /tmp/cat.core'
Type "apropos word" to search for commands related to "word".
Reading symbols from /bin/cat...
Reading symbols from /tmp/dbgsym/usr/lib/debug/.build-id/b3/57ed53c8c9cb1a312f83b28982304effae0135.debug...
[New LWP 2094475]
Core was generated by `/bin/cat'.
Program terminated with signal SIGTSTP, Stopped (user).
#0 0x00007ffff7eb6142 in __GI___libc_read (fd=fd at entry=0, buf=buf at entry=0x7ffff7faa000, nbytes=nbytes at entry=131072) at ../sysdeps/unix/sysv/linux/read.c:26
# hirsute
$ gdb --ex 'set debug-file-directory /tmp/dbgsym/usr/lib/debug:/usr/lib/debug' --ex 'file /bin/cat' --ex 'core-file /tmp/cat.core'
Reading symbols from /bin/cat...
Reading symbols from /tmp/dbgsym/usr/lib/debug/.build-id/fb/a7cee6aca864b8f79dfaa8a267855333b445c1.debug...
[New LWP 14651]
Core was generated by `/usr/bin/cat'.
Program terminated with signal SIGTSTP, Stopped (user).
#0 0x00007ffff7edccb2 in __GI___libc_read (fd=fd at entry=0, buf=buf at entry=0x7ffff791e000, nbytes=nbytes at entry=131072) at ../sysdeps/unix/sysv/linux/read.c:26
26 ../sysdeps/unix/sysv/linux/read.c: No such file or directory.
If the dbgsym is installed and I use (with intentional typo):
set debug-file-directory /tmp/dbgsym/usr/lib/debugnot:/usr/lib/debug
it then loads symbols correctly from /usr/lib/debug
Note, this was tested under Focal (host) and Hirsute (lxd container).
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1818918
Title:
gdb doesn't search in debug-file-directory for .gnu_debugaltlink
Status in Apport:
Fix Released
Status in apport package in Ubuntu:
New
Status in gdb package in Ubuntu:
Confirmed
Bug description:
As far as I can tell gdb version 8.2.90 isn't searching the debug-
file-directory, which I set, for the '.gnu_debugaltlink' which is in
the debug symbols. Here's the error I'm seeing:
Type "apropos word" to search for commands related to "word".
Reading symbols from /srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox//usr/bin/gnome-calculator...
Reading symbols from /srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox/usr/lib/debug/.build-id/95/59c4c5ee30eb66d47bb9bd64784a69c9a6de6b.debug...
could not find '.gnu_debugaltlink' file for /srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox/usr/lib/debug/.build-id/95/59c4c5ee30eb66d47bb9bd64784a69c9a6de6b.debug
(No debugging symbols found in /srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox/usr/lib/debug/.build-id/95/59c4c5ee30eb66d47bb9bd64784a69c9a6de6b.debug)
Here's part of an strace of what's going on behind the scenes:
lstat("/srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox/usr/lib/debug/.build-id/95/59c4c5ee30eb66d47bb9bd64784a69c9a6de6b.debug", {st_mode=S_IFREG|0644, st_size=839744, ...}) = 0
openat(AT_FDCWD, "/usr/lib/debug/.dwz/x86_64-linux-gnu/gnome-calculator.debug", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
This is the only time "/usr/lib/debug" is searched, generally
"/srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-
sandbox/usr/lib/debug/" is used. I'll attach the full strace though.
For completeness here's the gdb command I'm using:
Calling gdb command: '/srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64
/report-sandbox/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2' '/srv/vms
/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox/usr/bin/gdb'
--ex 'set debug-file-directory /srv/vms/apport-sandbox-dir/Ubuntu
19.04/amd64/report-sandbox/usr/lib/debug' --ex 'set solib-absolute-
prefix /srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox'
--ex 'add-auto-load-safe-path /srv/vms/apport-sandbox-dir/Ubuntu
19.04/amd64/report-sandbox' --ex 'set solib-search-path /srv/vms
/apport-sandbox-dir/Ubuntu 19.04/amd64/report-sandbox/lib/x86_64
-linux-gnu' --ex 'set data-directory /srv/vms/apport-sandbox-
dir/Ubuntu 19.04/amd64/report-sandbox/usr/share/gdb' --ex 'file
"/srv/vms/apport-sandbox-dir/Ubuntu 19.04/amd64/report-
sandbox//usr/bin/gnome-calculator"' --ex 'core-file
/tmp/apport_core_1b6dn6np'
To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/1818918/+subscriptions
More information about the foundations-bugs
mailing list