diff --git a/compiler-rt/lib/msan/msan_interceptors.cpp b/compiler-rt/lib/msan/msan_interceptors.cpp --- a/compiler-rt/lib/msan/msan_interceptors.cpp +++ b/compiler-rt/lib/msan/msan_interceptors.cpp @@ -1034,6 +1034,7 @@ MsanThread *t = (MsanThread *)arg; SetCurrentThread(t); t->Init(); + SetSigProcMask(&t->starting_sigset_, nullptr); return t->ThreadStart(); } @@ -1049,7 +1050,7 @@ AdjustStackSize(attr); MsanThread *t = MsanThread::Create(callback, param); - + ScopedBlockSignals block(&t->starting_sigset_); int res = REAL(pthread_create)(th, attr, MsanThreadStartFunc, t); if (attr == &myattr) diff --git a/compiler-rt/lib/msan/msan_thread.h b/compiler-rt/lib/msan/msan_thread.h --- a/compiler-rt/lib/msan/msan_thread.h +++ b/compiler-rt/lib/msan/msan_thread.h @@ -15,7 +15,7 @@ #include "msan_allocator.h" #include "sanitizer_common/sanitizer_common.h" - +#include "sanitizer_common/sanitizer_posix.h" namespace __msan { class MsanThread { @@ -45,6 +45,7 @@ MsanThreadLocalMallocStorage &malloc_storage() { return malloc_storage_; } int destructor_iterations_; + __sanitizer_sigset_t starting_sigset_; private: // NOTE: There is no MsanThread constructor. It is allocated