[compiler-rt] [sanitizer] Don't TestPTrace() if SPARC; don't give up if internal_fork() fails (PR #152072)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 6 10:54:25 PDT 2025
================
@@ -405,10 +405,16 @@ struct ScopedSetTracerPID {
// This detects whether ptrace is blocked (e.g., by seccomp), by forking and
// then attempting ptrace.
-// This separate check is necessary because StopTheWorld() creates a child
-// process with a shared virtual address space and shared TLS, and therefore
+// This separate check is necessary because StopTheWorld() creates a thread
+// with a shared virtual address space and shared TLS, and therefore
// cannot use waitpid() due to the shared errno.
static void TestPTrace() {
+# if SANITIZER_SPARC
+ // internal_fork() on SPARC actually calls __fork(). We can't safely fork,
+ // because it's possible seccomp has been configured to disallow fork() but
+ // allow clone().
+ Report("WARNING: skipping TestPTrace() because this is SPARC\n");
----------------
vitalybuka wrote:
It's better to e VPrint
spamming stderr just in case is not helpful
https://github.com/llvm/llvm-project/pull/152072
More information about the llvm-commits
mailing list