llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) <details> <summary>Changes</summary> Verify CheckedMutex::CheckNoLocks() in EnterSymbolizer() to ensure no internal TSan or ThreadRegistry locks are held when symbolizing. Also remove the redundant ThreadRegistryLock debug check in ShouldReport(), as ThreadRegistry uses CheckedMutex(MutexThreadRegistry) which is already checked by CheckedMutex::CheckNoLocks(). Assisted-by: Gemini --- Full diff: https://github.com/llvm/llvm-project/pull/228815.diff 2 Files Affected: - (modified) compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp (-3) - (modified) compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp (+1) ``````````diff diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp index 1d76a886dc536..ebdc7695c43da 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp @@ -140,9 +140,6 @@ bool ShouldReport(ThreadState *thr, ReportType typ) { // Taking any locking in the fork context can lead to deadlocks. // If any locks are already taken, it's too late to do this check. CheckedMutex::CheckNoLocks(); - // For the same reason check we didn't lock thread_registry yet. - if (SANITIZER_DEBUG) - ThreadRegistryLock l(&ctx->thread_registry); if (!flags()->report_bugs || thr->suppress_reports) return false; switch (typ) { diff --git a/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp b/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp index b382b63247e8e..51028e9ce5941 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp @@ -22,6 +22,7 @@ namespace __tsan { void EnterSymbolizer() { + CheckedMutex::CheckNoLocks(); ThreadState *thr = cur_thread(); CHECK(!thr->in_symbolizer); thr->in_symbolizer = true; `````````` </details> https://github.com/llvm/llvm-project/pull/228815 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
