Async signals may crash the process if AsanThread is not fully
initialized. We do the same for other sanitizers already.
Can't have good reproducer for test. We see this in internal test with prob 1e-6.
Differential D156299
[asan] Block signals when starting threads vitalybuka on Jul 26 2023, 1:02 AM. Authored by
Details
Async signals may crash the process if AsanThread is not fully Can't have good reproducer for test. We see this in internal test with prob 1e-6.
Diff Detail
Event TimelineComment Actions This broke our macOS builders, would it be possible to fix forward or revert? /opt/s/w/ir/x/w/llvm_build/./bin/clang++ --target=x86_64-apple-darwin20.6.0 --sysroot=/opt/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -DASAN_DYNAMIC=1 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/s/w/ir/x/w/llvm-llvm-project/compiler-rt/lib/asan/.. -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffile-prefix-map=/opt/s/w/ir/x/w/llvm_build/runtimes/runtimes-bins=../llvm_build/runtimes/runtimes-bins -ffile-prefix-map=/opt/s/w/ir/x/w/llvm-llvm-project/= -no-canonical-prefixes -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -arch arm64 -arch x86_64 -isysroot /opt/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -stdlib=libc++ -mmacosx-version-min=10.10 -isysroot /opt/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -fPIC -fno-builtin -fno-exceptions -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -g -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -nostdinc++ -fno-rtti -Wno-format -ftls-model=initial-exec -MD -MT compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.osx.dir/asan_interceptors.cpp.o -MF compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.osx.dir/asan_interceptors.cpp.o.d -o compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.osx.dir/asan_interceptors.cpp.o -c /opt/s/w/ir/x/w/llvm-llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp /opt/s/w/ir/x/w/llvm-llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:229:3: error: use of undeclared identifier 'SetSigProcMask' 229 | SetSigProcMask(&sigset, nullptr); | ^ /opt/s/w/ir/x/w/llvm-llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:252:3: error: unknown type name 'ScopedBlockSignals' 252 | ScopedBlockSignals block(&sigset); | ^ 2 errors generated. |