[compiler-rt] af7fa27 - [sanitizer] VReport thread status for failed PTRACE_ATTACH (#111901)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 10 14:53:19 PDT 2024
Author: Vitaly Buka
Date: 2024-10-10T14:53:16-07:00
New Revision: af7fa2710c998811dd72799799798f2bd4d9bff4
URL: https://github.com/llvm/llvm-project/commit/af7fa2710c998811dd72799799798f2bd4d9bff4
DIFF: https://github.com/llvm/llvm-project/commit/af7fa2710c998811dd72799799798f2bd4d9bff4.diff
LOG: [sanitizer] VReport thread status for failed PTRACE_ATTACH (#111901)
Such threads can cause false leak reports,
but often it's hard to diagnose the reason of
failed PTRACE_ATTACH. Maybe we can find
a clue from `/proc/*/task/*/status`
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
index d9f803a276dadc..6ebca965f6a334 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
@@ -228,6 +228,8 @@ bool ThreadSuspender::SuspendAllThreads() {
for (tid_t tid : threads) {
if (SuspendThread(tid))
retry = true;
+ else
+ VReport(2, "%llu/status: %s\n", tid, thread_lister.LoadStatus(tid));
}
if (retry)
VReport(1, "SuspendAllThreads retry: %d\n", i);
More information about the llvm-commits
mailing list