[llvm-branch-commits] [sanitizer] VReport thread status for failed PTRACE_ATTACH (PR #111901)

Florian Mayer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Oct 10 13:00:14 PDT 2024


================
@@ -148,6 +148,14 @@ bool ThreadSuspender::SuspendThread(tid_t tid) {
     // Log this event and move on.
     VReport(1, "Could not attach to thread %zu (errno %d).\n", (uptr)tid,
             pterrno);
+    if (common_flags()->verbosity >= 2) {
+      InternalScopedString path;
+      path.AppendF("/proc/%d/task/%llu/status", pid_, tid);
+      InternalMmapVector<char> buffer;
+      ReadFileToVector(path.data(), &buffer);
+      buffer.push_back(0);
----------------
fmayer wrote:

nit: '\0'

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


More information about the llvm-branch-commits mailing list