[compiler-rt] d01be3c - [sanitizer] Disable InstallAtForkHandler on Solaris, NetBSD (#75659)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 18 01:50:59 PST 2023
Author: Vitaly Buka
Date: 2023-12-18T10:50:55+01:00
New Revision: d01be3c63109986627c1c029d6d0130f76a63a2f
URL: https://github.com/llvm/llvm-project/commit/d01be3c63109986627c1c029d6d0130f76a63a2f
DIFF: https://github.com/llvm/llvm-project/commit/d01be3c63109986627c1c029d6d0130f76a63a2f.diff
LOG: [sanitizer] Disable InstallAtForkHandler on Solaris, NetBSD (#75659)
Handlers need missing FutexWait implementation.
Reported in #75290.
Added:
Modified:
compiler-rt/lib/asan/asan_posix.cpp
compiler-rt/lib/lsan/lsan_posix.cpp
compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_posix.cpp b/compiler-rt/lib/asan/asan_posix.cpp
index 206551b6ef910e..0d2e4fe0176772 100644
--- a/compiler-rt/lib/asan/asan_posix.cpp
+++ b/compiler-rt/lib/asan/asan_posix.cpp
@@ -149,6 +149,9 @@ void PlatformTSDDtor(void *tsd) {
#endif
void InstallAtForkHandler() {
+# if SANITIZER_SOLARIS || SANITIZER_NETBSD
+ return; // FIXME: Implement FutexWait.
+# endif
auto before = []() {
if (CAN_SANITIZE_LEAKS) {
__lsan::LockGlobal();
diff --git a/compiler-rt/lib/lsan/lsan_posix.cpp b/compiler-rt/lib/lsan/lsan_posix.cpp
index 3677f0141a2f02..e0c1899edcd2cf 100644
--- a/compiler-rt/lib/lsan/lsan_posix.cpp
+++ b/compiler-rt/lib/lsan/lsan_posix.cpp
@@ -101,6 +101,9 @@ void InstallAtExitCheckLeaks() {
}
void InstallAtForkHandler() {
+# if SANITIZER_SOLARIS || SANITIZER_NETBSD
+ return; // FIXME: Implement FutexWait.
+# endif
auto before = []() {
LockGlobal();
LockThreads();
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c
index 6c5102049ae8ef..5c6a8743cdb580 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c
@@ -12,6 +12,10 @@
// FIXME: False stack overflow report
// UNSUPPORTED: android && asan
+// FIXME: Requires `FutexWait` implementation. See __asan::InstallAtForkHandler.
+// UNSUPPORTED: target={{.*solaris.*}}
+// UNSUPPORTED: target={{.*netbsd.*}}
+
// Forking in multithread environment is unsupported. However we already have
// some workarounds, and will add more, so this is the test.
// The test try to check two things:
More information about the llvm-commits
mailing list