[compiler-rt] [TSan] Fix deadlocks during TSan error reporting on Apple platforms (PR #151495)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 5 07:16:42 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp compiler-rt/lib/tsan/rtl/tsan_mman.cpp compiler-rt/lib/tsan/rtl/tsan_rtl_access.cpp compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index 860e23630..0a76eb253 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -2157,14 +2157,14 @@ static void ReportErrnoSpoiling(ThreadState *thr, uptr pc, int sig) {
#if SANITIZER_APPLE
} // Close this scope to release the locks before writing report
#endif
- if (!suppressed)
- OutputReport(thr, *rep);
+ if (!suppressed)
+ OutputReport(thr, *rep);
#if !SANITIZER_APPLE
- }
+}
#endif
- // Need to manually destroy this because we used placement new to allocate
- rep->~ScopedReport();
+// Need to manually destroy this because we used placement new to allocate
+rep->~ScopedReport();
}
static void CallUserSignalHandler(ThreadState *thr, bool sync, bool acquire,
``````````
</details>
https://github.com/llvm/llvm-project/pull/151495
More information about the llvm-commits
mailing list