[compiler-rt] [compiler-rt] Also consider SIGPROF as a synchronous signal (PR #85188)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 01:04:51 PDT 2024


https://github.com/serge-sans-paille updated https://github.com/llvm/llvm-project/pull/85188

>From da8180f778358d191263d1d281c5e6d667c826d7 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton at mozilla.com>
Date: Thu, 14 Mar 2024 07:41:46 +0100
Subject: [PATCH] [compiler-rt] Also consider SIGPROF as a synchronous signal

Blocking that signal causes inter-blocking for profilers that monitor
threads through that signal.
Fix #83844 and #83561
---
 compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index 8ffc703b05eace..2bebe651b994e5 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -126,6 +126,7 @@ const int SIGFPE = 8;
 const int SIGSEGV = 11;
 const int SIGPIPE = 13;
 const int SIGTERM = 15;
+const int SIGPROF = 27;
 #if defined(__mips__) || SANITIZER_FREEBSD || SANITIZER_APPLE || SANITIZER_NETBSD
 const int SIGBUS = 10;
 const int SIGSYS = 12;
@@ -2168,7 +2169,8 @@ static bool is_sync_signal(ThreadSignalContext *sctx, int sig,
     return false;
 #endif
   return sig == SIGSEGV || sig == SIGBUS || sig == SIGILL || sig == SIGTRAP ||
-         sig == SIGABRT || sig == SIGFPE || sig == SIGPIPE || sig == SIGSYS;
+         sig == SIGABRT || sig == SIGFPE || sig == SIGPIPE || sig == SIGSYS ||
+         sig == SIGPROF;
 }
 
 void sighandler(int sig, __sanitizer_siginfo *info, void *ctx) {



More information about the llvm-commits mailing list