Discussion:
[Bug gdb/20143] New: ARM (rPi2): Debugging "top" fails: /build/gdb-nrlhe3/gdb-7.7.1+dfsg/gdb/frame.c:472: internal-error:
arre_diels at hotmail dot com
2016-05-25 08:46:04 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20143

Bug ID: 20143
Summary: ARM (rPi2): Debugging "top" fails:
/build/gdb-nrlhe3/gdb-7.7.1+dfsg/gdb/frame.c:472:
internal-error: get_frame_id: Assertion
`fi->this_id.p' failed
Product: gdb
Version: 7.7
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: arre_diels at hotmail dot com
Target Milestone: ---

Hi,

When trying to debug something as simple as the program "top" on my raspberry
pi 2, I run into a gdb assertion when trying to do:
- a few step-instructions after pressing control+c in execution
- or even a backtrace after pressing control+c

This is pretty easy to reproduce. Just fire up gdb, continue, break, and
"stepi" x 10, and type "bt" a few times.

Note, this -works- on the same gdb version on debian on x86_64 (see below), but
not on the arm of the raspberry pi


***@raspberrypi:~ $ gdb /usr/bin/top
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 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 "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/top...(no debugging symbols found)...done.
(gdb) run > /dev/null
Starting program: /usr/bin/top > /dev/null
^CQuit
(gdb) bt
#0 __GI__dl_debug_state () at dl-debug.c:74
#1 0xb6fd2514 in dl_main (phdr=<optimized out>, phnum=<optimized out>,
user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:2302
#2 0xb6fe5b30 in _dl_sysdep_start (
start_argptr=***@entry=0xbefff780, dl_main=0x0)
at ../elf/dl-sysdep.c:249
#3 0xb6fd3c78 in _dl_start_final (arg=0xbefff780, ***@entry=0x0,
info=***@entry=0xbefff500) at rtld.c:330
#4 0xb6fd3f08 in _dl_start (arg=0x0) at rtld.c:558
#5 0xb6fcfd50 in _start () from /lib/ld-linux-armhf.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) c
Continuing.

Program received signal SIGINT, Interrupt.
0xb6ea4aec in __pselect (nfds=1,
***@entry=<error reading variable: Cannot access memory at address 0xe>,
readfds=0xbefff57c, writefds=0x0, exceptfds=0x0, timeout=<optimized out>,
sigmask=0x3a4e0) at ../sysdeps/unix/sysv/linux/pselect.c:71
71 ../sysdeps/unix/sysv/linux/pselect.c: No such file or directory.
(gdb) bt
#0 0xb6ea4aec in __pselect (nfds=1, readfds=0xbefff57c, writefds=0x0,
exceptfds=0x0, timeout=<optimized out>, sigmask=0x3a4e0)
at ../sysdeps/unix/sysv/linux/pselect.c:71
#1 0x00012a44 in ?? ()
/build/gdb-nrlhe3/gdb-7.7.1+dfsg/gdb/frame.c:472: internal-error: get_frame_id:
Assertion `fi->this_id.p' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)



Tested OK with Debian 8 on vbox:

***@oab1ardi-mcdev:~$ gdb
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 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 "x86_64-linux-gnu".
...
--
You are receiving this mail because:
You are on the CC list for the bug.
arre_diels at hotmail dot com
2016-05-25 08:54:08 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20143

--- Comment #1 from Arnout <arre_diels at hotmail dot com> ---
By the way, this is also sort of a regression.

On the old debian on rpi, I don't see the assertions. However, there, if you do
stepi too many times, gdb is stuck, and cannot continue the program execution
anymore:


***@raspberrypi ~ $ gdb /usr/bin/top
GNU gdb (GDB) 7.4.1-debian <================ Old version for reference
Copyright (C) 2012 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 "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/top...(no debugging symbols found)...done.
(gdb)

(gdb) run > /dev/null
Starting program: /usr/bin/top > /dev/null

Program received signal SIGINT, Interrupt.
0x76eb8d50 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x76eb8d54 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x76eb8d58 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
Cannot access memory at address 0xe
(gdb) stepi
0x76eb8d60 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
Cannot access memory at address 0xe
(gdb) stepi
Cannot access memory at address 0xe
(gdb) c <========================== At this point, even continue fails!
Continuing.
Cannot access memory at address 0xe
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.
arre_diels at hotmail dot com
2016-05-25 11:07:25 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20143

--- Comment #2 from Arnout <arre_diels at hotmail dot com> ---
Cannnot reproduce on 7.11.50.20160525-git!



GNU gdb (GDB) 7.11.50.20160525-git
Copyright (C) 2016 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 "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/top...(no debugging symbols found)...done.
(gdb) run > /dev/null
Starting program: /usr/bin/top > /dev/null

Program received signal SIGINT, Interrupt.
0x76eb8d50 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) bt
#0 0x76eb8d50 in select () from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: Cannot access memory at address 0xe
(gdb) stepi
0x76eb8d54 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) bt
#0 0x76eb8d54 in select () from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: Cannot access memory at address 0xe
(gdb) stepi
0x76eb8d58 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x76eb8d5c in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x76eb8d60 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x0000ae00 in ?? ()
(gdb) stepi
0x0000ae04 in ?? ()
(gdb) stepi
0x0000ad6c in ?? ()
(gdb) stepi
0x0000f8d8 in ?? ()
(gdb) stepi
0x0000f8dc in ?? ()
(gdb) stepi
0x0000f8e0 in ?? ()
(gdb) stepi
0x0000f8e4 in ?? ()
(gdb) stepi
0x0000f8e8 in ?? ()
(gdb) stepi
0x0000f8ec in ?? ()
(gdb) stepi
0x0000f8f0 in ?? ()
(gdb) stepi
0x0000f8f4 in ?? ()
(gdb) stepi
0x0000f8f8 in ?? ()
(gdb) stepi
0x0000f8fc in ?? ()
(gdb) bt
#0 0x0000f8fc in ?? ()
#1 0x0000ad70 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) bt
#0 0x0000f8fc in ?? ()
#1 0x0000ad70 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) stepi
0x0000f900 in ?? ()
(gdb) stepi
0x0000f904 in ?? ()
(gdb) stepi
0x0000f908 in ?? ()
(gdb) stepi
0x0000f90c in ?? ()
(gdb) stepi
0x0000f910 in ?? ()
(gdb) stepi
0x0000f914 in ?? ()
(gdb) stepi
0x0000f918 in ?? ()
(gdb) stepi
0x0000f91c in ?? ()
(gdb) stepi
0x0000f920 in ?? ()
(gdb) stepi
0x0000f924 in ?? ()
(gdb) stepi
0x0000f928 in ?? ()
(gdb) stepi
0x0000f92c in ?? ()
(gdb) stepi
0x0000f930 in ?? ()
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.
arre_diels at hotmail dot com
2016-05-25 11:49:14 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20143

--- Comment #3 from Arnout <arre_diels at hotmail dot com> ---
Well in fact there is still a bug, even in the last version.
The stepi's still work, but if I try to check the registers at this point,
things go bad again:

GNU gdb (GDB) 7.11.50.20160525-git
...

0x76eb8d58 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x76eb8d5c in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x76eb8d60 in select () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) stepi
0x0000ccdc in ?? ()
(gdb) bt
#-1 0x0000ccdc in ?? ()
Backtrace stopped: Cannot access memory at address 0xe
(gdb) bt
#-1 0x0000ccdc in ?? ()
Backtrace stopped: Cannot access memory at address 0xe
(gdb) info reg
findvar.c:291: internal-error: value* value_of_register_lazy(frame_info*, int):
Assertion `frame_id_p (get_frame_id (frame))' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...