diff --git a/compiler-rt/lib/dfsan/dfsan_custom.cpp b/compiler-rt/lib/dfsan/dfsan_custom.cpp --- a/compiler-rt/lib/dfsan/dfsan_custom.cpp +++ b/compiler-rt/lib/dfsan/dfsan_custom.cpp @@ -756,6 +756,7 @@ DFsanThread *t = (DFsanThread *)arg; SetCurrentThread(t); t->Init(); + SetSigProcMask(&t->starting_sigset_, nullptr); return t->ThreadStart(); } @@ -776,6 +777,10 @@ DFsanThread *t = DFsanThread::Create(start_routine_trampoline, (thread_callback_t)start_routine, arg, track_origins); + + ScopedBlockSignals block; + block.GetSavedSet(&t->starting_sigset_); + int res = pthread_create(thread, attr, DFsanThreadStartFunc, t); if (attr == &myattr) diff --git a/compiler-rt/lib/dfsan/dfsan_thread.h b/compiler-rt/lib/dfsan/dfsan_thread.h --- a/compiler-rt/lib/dfsan/dfsan_thread.h +++ b/compiler-rt/lib/dfsan/dfsan_thread.h @@ -15,6 +15,7 @@ #include "dfsan_allocator.h" #include "sanitizer_common/sanitizer_common.h" +#include "sanitizer_common/sanitizer_posix.h" namespace __dfsan { @@ -45,6 +46,7 @@ DFsanThreadLocalMallocStorage &malloc_storage() { return malloc_storage_; } int destructor_iterations_; + __sanitizer_sigset_t starting_sigset_; private: void SetThreadStackAndTls();