mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
When all threads are blocked in a syscall, DRD_(thread_get_running_tid)() returns (or can return?) a "valid" DrdThreadId (probably the last one that was running ?). However, in such a situation, VG_(get_running_tid)() returns 0 (as effectively there is no thread running). This discrepancy (drd_tid "valid" and "vg_tid" invalid) can (probably) only happen with gdb monitor commands, as a thread can (normally) execute a client request only when it is running. However, vgdb can "force" the invocation of the gdb monitor client request, even if no thread is running. In such a case, the assert should not verify that drd_tid and vg_tid are consistent. To reproduce the problem: ./vg-in-place --tool=drd sleep 60 and in another window: ./coregrind/vgdb help which then gives ... drd: drd_clientreq.c:84 (handle_client_request): Assertion 'DRD_(VgThreadIdToDrdThreadId)(vg_tid) == drd_tid' failed. ==4208== at 0x3801DE1D: report_and_quit (m_libcassert.c:260) ==4208== by 0x3801E034: vgPlain_assert_fail (m_libcassert.c:340) ==4208== by 0x380026CC: handle_client_request (drd_clientreq.c:84) ==4208== by 0x3806EE8F: handle_gdb_monitor_command (server.c:490) ==4208== by 0x3806F07A: handle_query (server.c:580) ==4208== by 0x3806FDB2: server_main (server.c:915) ==4208== by 0x3806B01C: call_gdbserver (m_gdbserver.c:706) ==4208== by 0x3806B8F2: vgPlain_invoke_gdbserver (m_gdbserver.c:892) ... git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13765