[compiler-rt] [tsan] Process SIGPROF as sync signal only if thread is alive (PR #86343)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 22 15:13:50 PDT 2024
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/86343
>From a01b823a1db9ae4ea6b10a6fb8978d916bcf13f9 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Fri, 22 Mar 2024 14:30:33 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
=?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
[skip ci]
---
compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
index 77488f84328542..5316a7862e449c 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
@@ -160,6 +160,10 @@ void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,
}
Free(thr->tctx->sync);
+#if !SANITIZER_GO
+ thr->is_inited = true;
+#endif
+
uptr stk_addr = 0;
uptr stk_size = 0;
uptr tls_addr = 0;
@@ -200,15 +204,11 @@ void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,
}
void ThreadContext::OnStarted(void *arg) {
- thr = static_cast<ThreadState *>(arg);
DPrintf("#%d: ThreadStart\n", tid);
- new (thr) ThreadState(tid);
+ thr = new (arg) ThreadState(tid);
if (common_flags()->detect_deadlocks)
thr->dd_lt = ctx->dd->CreateLogicalThread(tid);
thr->tctx = this;
-#if !SANITIZER_GO
- thr->is_inited = true;
-#endif
}
void ThreadFinish(ThreadState *thr) {
More information about the llvm-commits
mailing list