[llvm] [Support] Don't re-raise signals sent from kernel (PR #145759)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 11:18:45 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Alex Langford (bulbazord)

<details>
<summary>Changes</summary>

When an llvm tool crashes (e.g. from a segmentation fault), SignalHandler will re-raise the signal. The effect is that crash reports now contain SignalHandler in the stack trace. The crash reports are still useful, but the presence of SignalHandler can confuse tooling and automation that deduplicate or analyze crash reports.

rdar://150464802

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


1 Files Affected:

- (modified) llvm/lib/Support/Unix/Signals.inc (+3-3) 


``````````diff
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index 6668a2953b3b2..cb38fcc559a7e 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -413,9 +413,9 @@ static void SignalHandler(int Sig, siginfo_t *Info, void *) {
     raise(Sig);
 #endif
 
-  // Signal sent from another process, do not assume that continuing the
-  // execution would re-raise it.
-  if (Info->si_pid != getpid())
+  // Signal sent from another userspace process, do not assume that continuing
+  // the execution would re-raise it.
+  if (Info->si_pid != getpid() && Info->si_pid != 0)
     raise(Sig);
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list