From 386749fe298d5181d59564b38964d32e654b9fd4 Mon Sep 17 00:00:00 2001 From: Rhys Kidd Date: Sun, 4 Dec 2016 03:43:29 +0000 Subject: [PATCH] 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 --- coregrind/m_syswrap/syswrap-darwin.c | 5 +++++ 1 file changed, 5 insertions(+) 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 ); -- 2.47.2