I was unable to investigate much in the original reported scenario,
because the libc.so binary is missing from the tarball:
uweig...@beagle:~$ tar tfz t2-bt-testcase.tar.gz
usr/sbin/rsyslogd-
lib/libz.so.1
lib/libpthread.so.0
lib/libdl.so.2
lib/librt.so.1
lib/libgcc_s.so.1
lib/libc.so.6
usr/lib/debug/usr/sbin/rsyslogd
usr/lib/debug/lib/libpthread-2.11.1.so
usr/lib/debug/lib/libdl-2.11.1.so
usr/lib/debug/lib/librt-2.11.1.so
usr/lib/debug/lib/libc-2.11.1.so
Note that lib/libc.so.6, which is just a symbolic link, is there, but
lib/libc-2.11.1.so, which is where the link goes to, is missing.
Nevertheless, I was able to reproduce similar problems when attempting
to backtrace out of interrupted system calls. For example, I've been
using the following example:
#include <unistd.h>
int main (void)
{
sleep (1000);
}
Running this in GDB 7.2 and interrupting results in:
uweig...@beagle:~$ ./gdb-7_2-build/gdb/gdb ./a.out
GNU gdb (GDB) 7.1.90.20100709-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "armv7l-unknown-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/uweigand/a.out...done.
(gdb) run
Starting program: /home/uweigand/a.out
^C
Program received signal SIGINT, Interrupt.
0x4008e02c in nanosleep () from /lib/libc.so.6
(gdb) bt
#0 0x4008e02c in nanosleep () from /lib/libc.so.6
#1 0x4008de70 in sleep () from /lib/libc.so.6
#2 0x4008de70 in sleep () from /lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
However, when I install the libc6-dbg debuginfo package, backtraces
work:
uweig...@beagle:~$ ./gdb-7_2-build/gdb/gdb ./a.out
GNU gdb (GDB) 7.1.90.20100709-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "armv7l-unknown-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/uweigand/a.out...done.
(gdb) run
Starting program: /home/uweigand/a.out
^C
Program received signal SIGINT, Interrupt.
0x4008e02c in nanosleep () at ../sysdeps/unix/syscall-template.S:82
82 ../sysdeps/unix/syscall-template.S: No such file or directory.
in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0 0x4008e02c in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1 0x4008de70 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:138
#2 0x000083c0 in main () at t.c:6
(gdb)
The reason why backtraces do not work without debug info is that GDB
will fall back to analyzing function prologue code instead. This
requires GDB to understand and decode all instructions that may be used
in such prologues. Currently, GDB does not understand any Thumb-2
instructions during prologue parsing, however. As these are default on
Ubuntu builds, prologue parsing basically never works. I'll have a look
into extending the prologue parser to add support for Thumb-2
instructions.
Dave Martin wrote in the original bug report:
> Similar results are seen regardless of whether debugging info is available.
Do you have a case where backtrace does not work if debugging info *is*
available (for the whole program, including all libraries)? This would
certainly be another problem, which I haven't been able to reproduce so
far.
--
GDB backtrace does not work correctly for Thumb-2 on armel
https://bugs.launchpad.net/bugs/523959
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