Crash of GDB with gdbserver btrace enabled [Re: [patch v9 00/23] branch tracing support for Atom]

Jan Kratochvil
2013-03-06T12:43:55Z

Hi Markus,

./gdbserver :1234 true
./gdb true -ex 'target remote localhost:1234' -ex 'set debug remote 1' -ex 'record btrace' -ex c

will crash GDB. There were a similar thread on the list before, I have not
investigated it yet.

But this is sure not a regression when btrace is not involved.

Jan

#0 in serial_debug_p (scb=0x0) at serial.c:558
#1 in serial_write (scb=0x0, str=0x7fffffffc5d0 "$Hgp4406.4406#e9", len=16) at serial.c:414
#2 in putpkt_binary (buf=0x23c4a30 "Hgp4406.4406", cnt=12) at remote.c:7189
#3 in putpkt (buf=0x23c4a30 "Hgp4406.4406") at remote.c:7120
#4 in set_thread (ptid=..., gen=1) at remote.c:1760
#5 in set_general_thread (ptid=...) at remote.c:1771
#6 in remote_disable_btrace (tinfo=0x23803a0) at remote.c:11194
#7 in target_disable_btrace (btinfo=0x23803a0) at target.c:4200
#8 in btrace_disable (tp=0x23284e0) at btrace.c:391
#9 in clear_thread_inferior_resources (tp=0x23284e0) at thread.c:120
#10 in delete_thread_1 (ptid=..., silent=1) at thread.c:296
#11 in delete_thread_silent (ptid=...) at thread.c:319
#12 in delete_thread_of_inferior (tp=0x23284e0, data=0x7fffffffc9a0) at inferior.c:179
#13 in iterate_over_threads (callback=0x86f3aa <delete_thread_of_inferior>, data=0x7fffffffc9a0) at thread.c:370
#14 in exit_inferior_1 (inftoex=0x21a69c0, silent=1) at inferior.c:259
#15 in exit_inferior_silent (pid=17414) at inferior.c:299
#16 in discard_all_inferiors () at inferior.c:337
#17 in remote_close (quitting=0) at remote.c:3024
#18 in target_close (targ=0x1eb7b60 <remote_ops>, quitting=0) at target.c:3775
#19 in pop_target () at target.c:1069
#20 in readchar (timeout=2) at remote.c:7055
#21 in getpkt_or_notif_sane_1 (buf=0x1eb7ae0 <remote_state>, sizeof_buf=0x1eb7ae8 <remote_state+8>, forever=0, expecting_notif=0, is_notif=0x0) at remote.c:7571
#22 in getpkt_sane (buf=0x1eb7ae0 <remote_state>, sizeof_buf=0x1eb7ae8 <remote_state+8>, forever=0) at remote.c:7669
#23 in getpkt (buf=0x1eb7ae0 <remote_state>, sizeof_buf=0x1eb7ae8 <remote_state+8>, forever=0) at remote.c:7511
#24 in set_thread (ptid=..., gen=1) at remote.c:1761
#25 in set_general_thread (ptid=...) at remote.c:1771
#26 in remote_disable_btrace (tinfo=0x23803a0) at remote.c:11194
#27 in target_disable_btrace (btinfo=0x23803a0) at target.c:4200
#28 in btrace_disable (tp=0x23284e0) at btrace.c:391
#29 in record_btrace_disable_callback (arg=0x23284e0) at record-btrace.c:108
#30 in record_btrace_close (quitting=0) at record-btrace.c:192
#31 in target_close (targ=0x1ece880 <record_btrace_ops>, quitting=0) at target.c:3775
#32 in unpush_target (t=0x1ece880 <record_btrace_ops>) at target.c:1061
#33 in record_unpush () at record.c:108
#34 in record_mourn_inferior (ops=0x1ece880 <record_btrace_ops>) at record.c:140
#35 in target_mourn_inferior () at target.c:2817
#36 in handle_inferior_event (ecs=0x7fffffffd470) at infrun.c:3436
#37 in wait_for_inferior () at infrun.c:2743
#38 in proceed (addr=18446744073709551615, siggnal=GDB_SIGNAL_DEFAULT, step=0) at infrun.c:2324
#39 in continue_1 (all_threads=0) at infcmd.c:736
#40 in continue_command (args=0x0, from_tty=1) at infcmd.c:828
#41 in do_cfunc (c=0x2142650, args=0x0, from_tty=1) at ./cli/cli-decode.c:113
#42 in cmd_func (cmd=0x2142650, args=0x0, from_tty=1) at ./cli/cli-decode.c:1859
#43 in execute_command (p=0x7fffffffde73 "", from_tty=1) at top.c:484
#44 in catch_command_errors (command=0x845192 <execute_command>, arg=0x7fffffffde72 "c", from_tty=1, mask=6) at exceptions.c:573
#45 in captured_main (data=0x7fffffffd9a0) at main.c:1009
#46 in catch_errors (func=0x742243 <captured_main>, func_args=0x7fffffffd9a0, errstring=0xfbbdd4 "", mask=6) at exceptions.c:546
#47 in gdb_main (args=0x7fffffffd9a0) at main.c:1042
#48 in main (argc=10, argv=0x7fffffffdaa8) at gdb.c:34