From: Rhys Kidd Date: Sun, 4 Dec 2016 03:43:29 +0000 (+0000) Subject: Fix 373046 - Stacks registered by core are never deregistered (macOS-specific follow... X-Git-Tag: svn/VALGRIND_3_13_0~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=386749fe298d5181d59564b38964d32e654b9fd4;p=thirdparty%2Fvalgrind.git Fix 373046 - Stacks registered by core are never deregistered (macOS-specific follow-up). Refer r16159. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16168 --- diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 206d57f2c5..e75acc85d9 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -53,6 +53,7 @@ #include "pub_core_scheduler.h" #include "pub_core_sigframe.h" // For VG_(sigframe_destroy)() #include "pub_core_signals.h" +#include "pub_core_stacks.h" #include "pub_core_syscall.h" #include "pub_core_syswrap.h" #include "pub_core_tooliface.h" @@ -205,6 +206,10 @@ static void run_a_thread_NORETURN ( Word tidW ) c = VG_(count_living_threads)(); vg_assert(c >= 1); /* stay sane */ + /* Deregister thread's stack. */ + if (tst->os_state.stk_id != NULL_STK_ID) + VG_(deregister_stack)(tst->os_state.stk_id); + // Tell the tool this thread is exiting VG_TRACK( pre_thread_ll_exit, tid );