]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix 373046 - Stacks registered by core are never deregistered (macOS-specific follow...
authorRhys Kidd <rhyskidd@gmail.com>
Sun, 4 Dec 2016 03:43:29 +0000 (03:43 +0000)
committerRhys Kidd <rhyskidd@gmail.com>
Sun, 4 Dec 2016 03:43:29 +0000 (03:43 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16168

coregrind/m_syswrap/syswrap-darwin.c

index 206d57f2c52b2bf1826da87aac2c5b257cb240ed..e75acc85d9e6770ba1bef782b7a8394302c695c5 100644 (file)
@@ -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 );