gdb causes the debugged program to segfault when stepping into shared libraries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gdb (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: gdb
Ubuntu lucid
gdb 7.0.1-0ubuntu1
Also observed on gdb trunk 20100223-cvs (built with the lucid tools)
When attempting to step into a shared library using gdb, gdb claims the debugged program suffered a segfault and the program cannot be debugged further.
The problem seems to occur irrespective of whether code is ARM or Thumb, or whether debug information is present or not in the shared library. If the debugged program is simply allowed to run (inside or outside gdb), it proceeds normally with no segfault.
~/bugs$ gcc -g -o hello hello.c
~/bugs$ ~/src/gdb/
GNU gdb (GDB) 7.1.50.20100223-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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-
For bug reporting instructions, please see:
<http://
Reading symbols from /home/ubuntu/
(gdb) b main
Breakpoint 1 at 0x83b8: file hello.c, line 6.
(gdb) r
Starting program: /home/ubuntu/
Breakpoint 1, main () at hello.c:6
6 puts("Hello, world!");
(gdb) s
Program received signal SIGSEGV, Segmentation fault.
0x4000a058 in ?? () from /lib/ld-linux.so.3
(gdb) q
A debugging session is active.
Inferior 1 [process 17617] will be killed.
Quit anyway? (y or n) y
~/bugs$ ~/src/gdb/
GNU gdb (GDB) 7.1.50.20100223-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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-
For bug reporting instructions, please see:
<http://
Reading symbols from /home/ubuntu/
(gdb) b main
Breakpoint 1 at 0x83b8: file hello.c, line 6.
(gdb) r
Starting program: /home/ubuntu/
Breakpoint 1, main () at hello.c:6
6 puts("Hello, world!");
(gdb) n
Hello, world!
8 return EXIT_SUCCESS;
(gdb) s
9 }
(gdb) c
Continuing.
Program exited normally.
(gdb) q
~/bugs$ gcc -marm -g -o hello-arm hello.c
~/bugs$ ~/src/gdb/
GNU gdb (GDB) 7.1.50.20100223-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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-
For bug reporting instructions, please see:
<http://
Reading symbols from /home/ubuntu/
(gdb) b main
Breakpoint 1 at 0x83bc: file hello.c, line 6.
(gdb) r
Starting program: /home/ubuntu/
Breakpoint 1, main () at hello.c:6
6 puts("Hello, world!");
(gdb) s
Program received signal SIGSEGV, Segmentation fault.
0x4000a058 in ?? () from /lib/ld-linux.so.3
(gdb) c
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) q
Changed in gdb (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Triaged |
The patch for getting GDB to single-step correctly across state changes has been submitted here:
http:// www.sourceware. org/ml/ gdb-patches/ 2010-03/ msg00168. html
And approved here:
http:// www.sourceware. org/ml/ gdb-patches/ 2010-03/ msg00170. html