[Bug 1325503] Re: gdb reports 'corrupt stack' on armhf without symbols
Brian Murray
brian at ubuntu.com
Tue Jul 1 20:25:55 UTC 2014
This may be partially resolved by the reintroduction of the patch in bug
1233185. The initial Stacktrace still ends in a corrupt stack but the
non-multiarch version of gdb is able to produce a more useful Stacktrace
and a StacktraceAddressSignature when retracing the crash. For example,
with the gnome calculator crash from apport test crashes we can see the
following differences.
Stacktrace:
#0 0x4081ed22 in poll () from /lib/arm-linux-gnueabihf/libc.so.6
No symbol table info available.
#1 0x4067c4e6 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
After retracing:
Stacktrace:
#0 0x4081ed22 in poll () at ../sysdeps/unix/syscall-template.S:81
No locals.
#1 0x4067c4e6 in g_main_context_poll (priority=2147483647, n_fds=1, fds=0x41400c68, timeout=-1, context=0xd00d0) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:4028
poll_func = 0x406862a5 <g_poll>
#2 g_main_context_iterate (context=context at entry=0xd00d0, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3729
max_priority = 2147483647
timeout = -1
some_ready = <optimized out>
nfds = 1
allocated_nfds = <optimized out>
fds = 0x41400c68
#3 0x4067c588 in g_main_context_iteration (context=context at entry=0xd00d0, may_block=may_block at entry=1) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3795
retval = <optimized out>
#4 0x410c1cd0 in dconf_gdbus_worker_thread (user_data=0xd00d0) at dconf-gdbus-thread.c:82
context = 0xd00d0
#5 0x40695eea in g_thread_proxy (data=0x9db80) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
thread = 0x9db80
#6 0x4077efbc in start_thread (arg=0x413ff2d0) at pthread_create.c:314
pd = 0x413ff2d0
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {1094710504, 1094709968, 1, 1094708424, 1094708752, 1081684380, 1094710532, -1090523248, 220780268, 207672765, 0 <repeats 54 times>}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = 0
pagesize_m1 = <optimized out>
sp = <optimized out>
freesize = <optimized out>
__PRETTY_FUNCTION__ = "start_thread"
#7 0x40827b3c in ?? () at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:92 from /srv/daisy.staging.ubuntu.com/production/cache/Ubuntu 14.04/cache-DhmXbj/sandbox/lib/arm-linux-gnueabihf/libc.so.6
No locals.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1325503
Title:
gdb reports 'corrupt stack' on armhf without symbols
Status in Linaro GDB:
New
Status in “gdb” package in Ubuntu:
Confirmed
Bug description:
[Test Case]
sleep 120 &
kill -SEGV %1
Observe a corrupt stack in the generated crash file.
Original Report
---------------
On armhf crash files fail to retrace and gdb reports 'corrupt stack' errors
For example bug 1323241
Thread 1 (Thread 0xb0b3b450 (LWP 2243)):
#0 0x00000030 in ?? ()
No symbol table info available.
#1 0xa9990cbe in ?? () from /usr/lib/arm-linux-gnueabihf/unity8/qml/Unity/Launcher/libUnityLauncher-qml.so
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
I also tried directly on the device to run an unstripped and stripped
build of cat and gdb fails to unwind the stack when the binary is
stripped. The result of this test is:
== unstripped ==
Reading symbols from ./cat...done.
(gdb) run
Starting program: /home/phablet/tmp/coreutils-8.21/src/cat
^C
Program received signal SIGINT, Interrupt.
0xb6f6e914 in read () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) bt
#0 0xb6f6e914 in read () from /lib/arm-linux-gnueabihf/libc.so.6
#1 0x0000b648 in read (__nbytes=65536, __buf=0x19000, __fd=0) at /usr/include/arm-linux-gnueabihf/bits/unistd.h:44
#2 safe_read (fd=0, buf=buf at entry=0x19000, count=count at entry=65536) at lib/safe-read.c:66
#3 0x00009ace in simple_cat (bufsize=65536, buf=0x19000 "") at src/cat.c:168
#4 main (argc=1, argv=<optimized out>) at src/cat.c:730
(gdb) quit
== stripped ==
Reading symbols from ./cat...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/phablet/tmp/coreutils-8.21/src/cat
^C
Program received signal SIGINT, Interrupt.
0xb6f6e914 in read () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) bt
#0 0xb6f6e914 in read () from /lib/arm-linux-gnueabihf/libc.so.6
#1 0x0000b648 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
I'd expect the same number of frames and addresses when the binary is
stripped or not with '??' instead of names when it is stripped.
ProblemType: BugDistroRelease: Ubuntu 14.10
Package: gdb (not installed)
Uname: Linux 3.4.0-5-mako armv7l
ApportVersion: 2.14.3-0ubuntu1
Architecture: armhf
Date: Mon Jun 2 11:07:07 2014
InstallationDate: Installed on 2014-06-02 (0 days ago)
InstallationMedia: Ubuntu Utopic Unicorn (development branch) - armhf (20140602)SourcePackage: gdb
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/gdb-linaro/+bug/1325503/+subscriptions
More information about the foundations-bugs
mailing list