[Bug gdb/31713] race conditions in target simulation
bernd.edlinger at hotmail dot de
sourceware-bugzilla@sourceware.org
Sat May 11 06:19:07 GMT 2024
https://sourceware.org/bugzilla/show_bug.cgi?id=31713
--- Comment #6 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
Created attachment 15513
--> https://sourceware.org/bugzilla/attachment.cgi?id=15513&action=edit
random signal-unsafe call inside of a signal
This happens rarely in gdb.base/*.exp, this is actually two errors at once:
First there is a signal unsafe malloc/free happening in the signal handler,
but the reason is a segmentation fault in the "target sim" command.
I think this can only happen, because something with the bfd parser is not
stable, due to the underlying thread issue, that can make the simulator crash,
at least that is my theory.
The attachment contains only the TSAN output, but the gdb/testsuite/gdb.log
around the TSAN report reveals the reason why the signal was sent:
(gdb) target sim ^M
^M
^M
[...many tsan errors reported here...]
Fatal signal: Segmentation fault^M
---- Backtrace -----^M
0x5608f46ad811 gdb_internal_backtrace_1^M
../../binutils-gdb/gdb/bt-utils.c:121^M
0x5608f46ad811 _Z22gdb_internal_backtracev^M
../../binutils-gdb/gdb/bt-utils.c:167^M
0x5608f48604e6 handle_fatal_signal^M
../../binutils-gdb/gdb/event-top.c:916^M
0x5608f486072c handle_sigsegv^M
../../binutils-gdb/gdb/event-top.c:989^M
0x7f84e843b3dc CallUserSignalHandler^M
../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:2005^M
0x7f84e843b837 _Z10sighandleriPN11__sanitizer19__sanitizer_siginfoEPv^M
../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:2085^M
0x7f84e7e5b04f ???^M
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0^M
0x5608f4c6b1e3 initialize_cpu^M
../../binutils-gdb/sim/riscv/sim-main.c:1584^M
0x5608f4c23227 sim_open^M
../../binutils-gdb/sim/riscv/interp.c:129^M
0x5608f4a226a7 gdbsim_target_open^M
../../binutils-gdb/gdb/remote-sim.c:744^M
0x5608f4b54744 open_target^M
../../binutils-gdb/gdb/target.c:837^M
0x5608f47000db _Z8cmd_funcP16cmd_list_elementPKci^M
../../binutils-gdb/gdb/cli/cli-decode.c:2741^M
0x5608f4b6f1ee _Z15execute_commandPKci^M
../../binutils-gdb/gdb/top.c:569^M
0x5608f4861e6a _Z15command_handlerPKc^M
../../binutils-gdb/gdb/event-top.c:579^M
0x5608f4863ed4
_Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE^M
../../binutils-gdb/gdb/event-top.c:815^M
0x5608f486172c gdb_rl_callback_handler^M
../../binutils-gdb/gdb/event-top.c:271^M
0x5608f4cba39b rl_callback_read_char^M
../../../binutils-gdb/readline/readline/callback.c:290^M
0x5608f48610dd gdb_rl_callback_read_char_wrapper_noexcept^M
../../binutils-gdb/gdb/event-top.c:196^M
0x5608f4861453 gdb_rl_callback_read_char_wrapper^M
../../binutils-gdb/gdb/event-top.c:235^M
0x5608f4b9767f stdin_event_handler^M
../../binutils-gdb/gdb/ui.c:154^M
0x5608f4e4a545 handle_file_event^M
../../binutils-gdb/gdbsupport/event-loop.cc:551^M
0x5608f4e4ac4a gdb_wait_for_event^M
../../binutils-gdb/gdbsupport/event-loop.cc:672^M
0x5608f4e4b66b _Z16gdb_do_one_eventi^M
../../binutils-gdb/gdbsupport/event-loop.cc:263^M
0x5608f4960069 start_event_loop^M
../../binutils-gdb/gdb/main.c:401^M
0x5608f4960069 captured_command_loop^M
../../binutils-gdb/gdb/main.c:465^M
0x5608f4963f04 captured_main^M
../../binutils-gdb/gdb/main.c:1339^M
0x5608f4963f04 _Z8gdb_mainP18captured_main_args^M
../../binutils-gdb/gdb/main.c:1358^M
0x5608f45abab4 main^M
../../binutils-gdb/gdb/gdb.c:38^M
---------------------^M
[...more identical tsan errors reported here...]
A fatal error internal to GDB has been detected, further^M
debugging is not possible. GDB will now terminate.^M
^M
For instructions, see:^M
<https://www.gnu.org/software/gdb/bugs/>.^M
^M
ERROR: : spawn id exp9 not open
while executing
"expect {
-i exp9 -timeout 2400
-re ".*$gdb_prompt $" {
if {$verbose > 1} {
send_user "Loaded $arg into $GDB\n"
}
return 0
}
-re "..."
("uplevel" body line 1)
invoked from within
"uplevel $body" NONE : spawn id exp9 not open
Couldn't send delete breakpoints to GDB.
UNRESOLVED: gdb.base/utf8-identifiers.exp: delete all breakpoints, watchpoints,
tracepoints, and catchpoints in delete_breakpoints
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list