[compiler-rt] r234147 - [ASan] Do not print thread IDs and stacks for unknown threads.

Alexander Potapenko glider at google.com
Mon Apr 6 03:32:46 PDT 2015


Author: glider
Date: Mon Apr  6 05:32:45 2015
New Revision: 234147

URL: http://llvm.org/viewvc/llvm-project?rev=234147&view=rev
Log:
[ASan] Do not print thread IDs and stacks for unknown threads.


Modified:
    compiler-rt/trunk/lib/asan/asan_report.cc

Modified: compiler-rt/trunk/lib/asan/asan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=234147&r1=234146&r2=234147&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cc Mon Apr  6 05:32:45 2015
@@ -578,6 +578,11 @@ void DescribeThread(AsanThreadContext *c
   InternalScopedString str(1024);
   str.append("Thread T%d%s", context->tid,
              ThreadNameWithParenthesis(context->tid, tname, sizeof(tname)));
+  if (context->parent_tid == kInvalidTid) {
+    str.append(" created by unknown thread\n");
+    Printf("%s", str.data());
+    return;
+  }
   str.append(
       " created by T%d%s here:\n", context->parent_tid,
       ThreadNameWithParenthesis(context->parent_tid, tname, sizeof(tname)));





More information about the llvm-commits mailing list