gdb screws stacktraces when no debuginfo is present
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gdb (Debian) |
Fix Released
|
Unknown
|
|||
gdb (Suse) |
Fix Released
|
High
|
|||
gdb (Ubuntu) |
Fix Released
|
Undecided
|
Martin Pitt | ||
Hardy |
Fix Released
|
Undecided
|
Martin Pitt | ||
Intrepid |
Fix Released
|
Undecided
|
Martin Pitt |
Bug Description
Binary package hint: gdb
When debugging some code in gdb, the resulting stacktraces on segfaults tend to be useless when the code that is segfaulting has no debuginformation. In such a case, the _complete_ stack looks screwed. An example should explain the situation.
The original stacktrace that I get for my application looks like this:
(gdb) bt
#0 0xb78f485e in ?? () from /usr/lib/
#1 0x00000000 in ?? ()
Now, when I go and install libx11-6-dbg (which has debuginfo for libX11.so.6) I get this:
(gdb) bt
#0 0xb793385e in GetDatabase (db=0x84e0af8,
str=0x84d1518 "*Box.backgroun
doall=1) at ../../src/
#1 0xb7934781 in XrmGetStringDat
data=0x84d1518 "*Box.backgroun
at ../../src/
#2 0xb7910cbc in XGetDefault (dpy=0x84ccdc8, prog=0xb79ed5b5 "Xcursor",
name=0xb79ed647 "core") at ../../src/
#3 0xb79ea4dd in _XcursorGetDisp
#4 0xb79ea5dd in XcursorGetTheme () from /usr/lib/
#5 0xb7a95b74 in gdk_x11_
from /usr/lib/
#6 0xb7d61a6f in ?? () from /usr/lib/
#7 0x084d40e8 in ?? ()
#8 0x084e6f60 in ?? ()
#9 0x00000018 in ?? ()
#10 0xb7ee51ff in ?? () from /usr/lib/
#11 0xb700eff4 in ?? ()
#12 0x00000000 in ?? ()
Now I see one more library without debug information. When I install this too, I have a complete normal stacktrace, including my own application's code at the bottom.
This behaviour seems unnatural. GDB should show ?? only for stackframes without debug info, but for the others it normally still shows the debug information it has. The situation is especially bad when an application crashes in a proprietary piece (like the nvidia driver) which has no debug information at all.
Related branches
Changed in gdb: | |
status: | Unknown → Confirmed |
Changed in gdb: | |
status: | Confirmed → Incomplete |
Changed in gdb: | |
status: | Unknown → New |
Changed in gdb: | |
status: | Incomplete → Confirmed |
Changed in gdb (Suse): | |
status: | Confirmed → Incomplete |
Changed in gdb (Suse): | |
importance: | Unknown → High |
status: | Incomplete → Fix Released |
Changed in gdb (Debian): | |
status: | New → Fix Released |
Thank you for your bug report.
Roman:
To the best of my knowledge this has always been the case. Without the symbols I guess it is hard to know exactly where stack frames start and stop and I guess if gdb gets one offset wrong that's pretty much it. As for the binary driver situation... well that's the way it goes.