[compiler-rt] [TSan] skip memcpy of ctx when NULL in sighandler (PR #217935)

Dan Blackwell via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 06:31:06 PDT 2026


================
@@ -2343,7 +2343,8 @@ void sighandler(int sig, __sanitizer_siginfo *info, void *ctx) {
   if (signal->armed == false) {
     signal->armed = true;
     internal_memcpy(&signal->siginfo, info, sizeof(*info));
-    internal_memcpy(&signal->ctx, ctx, sizeof(signal->ctx));
+    if (ctx)
----------------
DanBlackwell wrote:

I think it would take a bit of work to pull these definitions out so that they can be used in a unit test. fwiw I discovered the issue that I'm fixing here because several of the lit tests for TSan fail due to it (e.g. the `signal_*` tests).

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


More information about the llvm-commits mailing list