Backtrace not working with 0.9.32-rc3

WANG.Jiong wong.kwongyuan at gmail.com
Thu Mar 31 08:36:01 UTC 2011


I suggest you do backtrace by yourself and see what happen

info register  + disassemble to calculate the return address by yourself

If you can get the corrent return address by yourself, then there maybe 
something wrong when gdb analyze the stack


On 03/31/2011 04:26 PM, Chris Loopenberg wrote:
> Hi!
>
> I'v tried to backtrace after a received signal (SIGUSR1) in an application
> built with uClibc-0.9.32-rc3.
> uClibc was configured for NPTL on a MIPS32 (little-endian).
>
> Toolchain: gcc-4.4.5, binutils-2.21, linux-2.6.31, gdb-7.2
>
> Backtrace stops after reaching __thread_start() function with the error:
> frame did not save the PC!
>
> I'v copied the unstripped libraries to the target and used LD_LIBRARY_PATH +
> solib-search-path but the result is the same:
>
> [New Thread 0x2b65f500 (LWP 864)]
>
> Program received signal SIGUSR1, User defined signal 1.
> [Switching to Thread 0x2b65f500 (LWP 864)]
> 0x2ad660b4 in __syscall_nanosleep (req=0x2b65ef18, rem=0x0)
>      at libc/sysdeps/linux/common/nanosleep.c:22
> 22      libc/sysdeps/linux/common/nanosleep.c: No such file or directory.
>          in libc/sysdeps/linux/common/nanosleep.c
> (gdb) bt
> #0  0x2ad660b4 in __syscall_nanosleep (req=0x2b65ef18, rem=0x0)
>      at libc/sysdeps/linux/common/nanosleep.c:22
> #1  __libc_nanosleep (req=0x2b65ef18, rem=0x0)
>      at libc/sysdeps/linux/common/nanosleep.c:33
> #2  0x0048d448 in mvcn_thread_sleep (seconds=<value optimized out>)
>      at thread/src/mvcn_thread.c:1113
> #3  0x0047f704 in secbox_lcd_loop (unused=<value optimized out>)
>      at lcd/src/secbox_lcd.c:725
> #4  0x0048dd20 in mvcn_thread_function (data=0x66f438)
>      at thread/src/mvcn_thread.c:550
> #5  0x2ace5e08 in start_thread (arg=0x2b65f500)
>      at libpthread/nptl/pthread_create.c:297
> #6  0x2acde020 in __thread_start () at ./libc/sysdeps/linux/mips/clone.S:146
> Backtrace stopped: frame did not save the PC
>
> I'v tried to backtrace a non-multithreaded app (BusyBox telnetd), the
> results are strange:
>
> # /tmp/gdb /usr/sbin/telnetd
> GNU gdb (GDB) 7.2
> 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 "mipsel-q-linux-uclibc".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /usr/sbin/telnetd...(no debugging symbols
> found)...done.
> (gdb) set arguments -F
> No symbol table is loaded.  Use the "file" command.
> (gdb) show args
> Argument list to give program being debugged when it is started is "".
> (gdb) set args -F
> (gdb) run
> Starting program: /usr/sbin/telnetd -F
>
> Program received signal SIGINT, Interrupt.
> 0x2aaf5090 in __syscall_select (n=4, readfds=0x7fd2a7f8,
> writefds=0x7fd2a878,
>      exceptfds=0x1, timeout=0x0) at libc/sysdeps/linux/common/select.c:75
> 75      libc/sysdeps/linux/common/select.c: No such file or directory.
>          in libc/sysdeps/linux/common/select.c
> (gdb) bt
> #0  0x2aaf5090 in __syscall_select (n=4, readfds=0x7fd2a7f8,
>      writefds=0x7fd2a878, exceptfds=0x1, timeout=0x0)
>      at libc/sysdeps/linux/common/select.c:75
> #1  0x00411f60 in ?? ()
> warning: GDB can't find the start of the function at 0x411f5f.
>
>      GDB is unable to find the start of the function at 0x411f5f
> and thus can't determine the size of that function's stack frame.
> This means that GDB may be unable to access that stack frame, or
> the frames below it.
>      This problem is most likely caused by an invalid program counter or
> stack pointer.
>      However, if you think GDB should simply search farther back
> from 0x411f5f for code which looks like the beginning of a
> function, you can increase the range of the search using the `set
> heuristic-fence-post' command.
> (gdb)
>
> Any ideas?
>
> BR,
> Krisztian
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc



More information about the uClibc mailing list