[compiler-rt] [sanitizer] Disable InstallAtForkHandler on Solaris, NetBSD (PR #75659)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 13:37:37 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

Handlers need missing FutexWait implementation.


---
Full diff: https://github.com/llvm/llvm-project/pull/75659.diff


3 Files Affected:

- (modified) compiler-rt/lib/asan/asan_posix.cpp (+3) 
- (modified) compiler-rt/lib/lsan/lsan_posix.cpp (+3) 
- (modified) compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c (+4) 


``````````diff
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:

``````````

</details>


https://github.com/llvm/llvm-project/pull/75659


More information about the llvm-commits mailing list