diff --git a/compiler-rt/lib/msan/msan_thread.cpp b/compiler-rt/lib/msan/msan_thread.cpp --- a/compiler-rt/lib/msan/msan_thread.cpp +++ b/compiler-rt/lib/msan/msan_thread.cpp @@ -1,8 +1,13 @@ -#include "msan.h" #include "msan_thread.h" -#include "msan_interface_internal.h" +#include + +#include "msan.h" +#include "msan_interface_internal.h" +#include "sanitizer_common/sanitizer_linux.h" +#include "sanitizer_common/sanitizer_platform_limits_posix.h" +#include "sanitizer_common/sanitizer_posix.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" namespace __msan { @@ -43,10 +48,16 @@ } void MsanThread::Init() { + __sanitizer_sigset_t set, old; + internal_sigfillset(&set); + internal_sigprocmask(SIG_SETMASK, &set, &old); + SetThreadStackAndTls(); CHECK(MEM_IS_APP(stack_.bottom)); CHECK(MEM_IS_APP(stack_.top - 1)); ClearShadowForThreadStackAndTLS(); + + internal_sigprocmask(SIG_SETMASK, &old, nullptr); } void MsanThread::TSDDtor(void *tsd) {