This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/13898] New: GDB crash when tracepoint andbreakpoint at same location
- From: "marc.khouzam at ericsson dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sat, 24 Mar 2012 02:18:05 +0000
- Subject: [Bug breakpoints/13898] New: GDB crash when tracepoint andbreakpoint at same location
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13898
Bug #: 13898
Summary: GDB crash when tracepoint and breakpoint at same
location
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: breakpoints
AssignedTo: unassigned@sourceware.org
ReportedBy: marc.khouzam@ericsson.com
Classification: Unclassified
I ran into this GDB crash when using eclipse. I got it down to its bare
essential.
> ~/workspace-GDB/build/gdb/gdb a.out
GNU gdb (GDB) 7.4.50.20120316-cvs
(gdb) l
1 int main() {
2 if (0) {
3 return 1;
4 }
5 return 0;
6 }
(gdb) interpreter-exec mi "-break-insert -a 2"
^done,bkpt={number="1",type="tracepoint",disp="keep",enabled="y",addr="0x08048497",func="main()",file="crash.cpp",fullname="/home/lmckhou/testing/crash.cpp",line="2",times="0",original-location="crash.cpp:2"}
==> I must use MI to set the tracepoint. Using the CLI command "trace 2" does
not cause the problem.
(gdb) b 5
Note: breakpoint 1 also set at pc 0x8048497.
Breakpoint 2 at 0x8048497: file crash.cpp, line 5.
==> breakpoint must be at same location as tracepoint. In this example, it is
at a different line, but effectively at the same location due to the "if (0)".
I used this example to show that a user could easily end up in this situation.
(gdb) r
Starting program: /home/lmckhou/testing/a.out
../../src/gdb/breakpoint.c:5067: internal-error: bpstat_what: tracepoint
encountered
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
The backtrace is:
#0 0x005b7422 in __kernel_vsyscall ()
#1 0x005e2651 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0x005e5a82 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x082bd02c in dump_core () at ../../src/gdb/utils.c:854
#4 0x082bd2ec in internal_vproblem (problem=0x8510720, file=0x84268bc
"../../src/gdb/breakpoint.c", line=5067,
fmt=0x8427218 "bpstat_what: tracepoint encountered", ap=0xbf927f4c "") at
../../src/gdb/utils.c:1012
#5 0x082bd348 in internal_verror (file=0x84268bc "../../src/gdb/breakpoint.c",
line=5067, fmt=0x8427218 "bpstat_what: tracepoint encountered",
ap=0xbf927f4c "") at ../../src/gdb/utils.c:1037
#6 0x082bd380 in internal_error (file=0x84268bc "../../src/gdb/breakpoint.c",
line=5067, string=0x8427218 "bpstat_what: tracepoint encountered")
at ../../src/gdb/utils.c:1047
#7 0x0816796e in bpstat_what (bs_head=0x8765ad0) at
../../src/gdb/breakpoint.c:5067
#8 0x081d419b in handle_inferior_event (ecs=0xbf928240) at
../../src/gdb/infrun.c:4402
#9 0x081d0fe8 in wait_for_inferior () at ../../src/gdb/infrun.c:2718
#10 0x081d052c in proceed (addr=1116240, siggnal=TARGET_SIGNAL_0, step=0) at
../../src/gdb/infrun.c:2287
#11 0x081c9140 in run_command_1 (args=0x0, from_tty=1, tbreak_at_main=0) at
../../src/gdb/infcmd.c:610
#12 0x081c9170 in run_command (args=0x0, from_tty=1) at
../../src/gdb/infcmd.c:620
#13 0x081063cf in do_cfunc (c=0x86a2ae0, args=0x0, from_tty=1) at
../../src/gdb/cli/cli-decode.c:67
#14 0x08108c35 in cmd_func (cmd=0x86a2ae0, args=0x0, from_tty=1) at
../../src/gdb/cli/cli-decode.c:1810
#15 0x082ba992 in execute_command (p=0x866a3c1 "", from_tty=1) at
../../src/gdb/top.c:483
#16 0x081edb4f in command_handler (command=0x866a3c0 "") at
../../src/gdb/event-top.c:435
#17 0x081ee092 in command_line_handler (rl=0x8755c90 "") at
../../src/gdb/event-top.c:636
#18 0x08304eb2 in rl_callback_read_char () at ../../src/readline/callback.c:220
#19 0x081ed717 in rl_callback_read_char_wrapper (client_data=0x0) at
../../src/gdb/event-top.c:169
#20 0x081eda74 in stdin_event_handler (error=0, client_data=0x0) at
../../src/gdb/event-top.c:375
#21 0x081ecb13 in handle_file_event (data=...) at
../../src/gdb/event-loop.c:827
#22 0x081ec10c in process_event () at ../../src/gdb/event-loop.c:401
#23 0x081ec1d0 in gdb_do_one_event () at ../../src/gdb/event-loop.c:465
#24 0x081ec222 in start_event_loop () at ../../src/gdb/event-loop.c:490
#25 0x081ed740 in cli_command_loop () at ../../src/gdb/event-top.c:182
#26 0x081e600c in current_interp_command_loop () at ../../src/gdb/interps.c:309
#27 0x081e6836 in captured_command_loop (data=0x0) at ../../src/gdb/main.c:225
#28 0x081e524d in catch_errors (func=0x81e6821 <captured_command_loop>,
func_args=0x0, errstring=0x8448a2f "", mask=6)
at ../../src/gdb/exceptions.c:546
#29 0x081e7724 in captured_main (data=0xbf9287b0) at ../../src/gdb/main.c:939
#30 0x081e524d in catch_errors (func=0x81e686c <captured_main>,
func_args=0xbf9287b0, errstring=0x8448a2f "", mask=6)
at ../../src/gdb/exceptions.c:546
#31 0x081e775a in gdb_main (args=0xbf9287b0) at ../../src/gdb/main.c:948
#32 0x08095313 in main (argc=2, argv=0xbf928874) at ../../src/gdb/gdb.c:34
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.