[compiler-rt] [sanitizer] Fix asserts in asan and tsan in pthread interceptors. (PR #75394)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 11:14:31 PST 2023


================
@@ -53,7 +53,8 @@ void ThreadArgRetval::Finish(uptr thread, void* retval) {
 u32 ThreadArgRetval::BeforeJoin(uptr thread) const {
   __sanitizer::Lock lock(&mtx_);
   auto t = data_.find(thread);
-  CHECK(t);
+  if (!t)
+    return 0;
   CHECK(!t->second.detached);
----------------
vitalybuka wrote:

we still have the case when joined thread is reused by another 'detached' thread and we will hit the CHECK below

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


More information about the llvm-commits mailing list