From: Paul Floyd Date: Wed, 8 Feb 2023 21:54:57 +0000 (+0100) Subject: Darwin: try to fix assert in DRD X-Git-Tag: VALGRIND_3_21_0~173 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e4eb0b674db465c9c332ec72b5c7f5202de7d71;p=thirdparty%2Fvalgrind.git Darwin: try to fix assert in DRD The hard coded memory mapping trigger drd_start_using_mem_w_perms which will lead to tl_assert(vg_tid != VG_INVALID_THREADID); But vg_tid was just set to VG_INVALID_THREADID before the hard coded memory map. --- diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 0a7e96e500..b5501b5f31 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -2047,10 +2047,6 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) True /* executable? */, 0 /* di_handle: no associated debug info */ ); - /* Clear the running thread indicator */ - VG_(running_tid) = VG_INVALID_THREADID; - vg_assert(VG_(running_tid) == VG_INVALID_THREADID); - /* Darwin only: tell the tools where the client's kernel commpage is. It would be better to do this by telling aspacemgr about it -- see the now disused record_system_memory() in @@ -2068,6 +2064,10 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) True, False, True, /* r-x */ 0 /* di_handle: no associated debug info */ ); # endif + + /* Clear the running thread indicator */ + VG_(running_tid) = VG_INVALID_THREADID; + vg_assert(VG_(running_tid) == VG_INVALID_THREADID); } //--------------------------------------------------------------