[compiler-rt] df4c913 - [asan] Print `unique_id` instead of `tid` (#111925)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 21:04:28 PDT 2024


Author: Vitaly Buka
Date: 2024-10-10T21:04:25-07:00
New Revision: df4c91342577cd9a74f168ad8c98380538d5e7c4

URL: https://github.com/llvm/llvm-project/commit/df4c91342577cd9a74f168ad8c98380538d5e7c4
DIFF: https://github.com/llvm/llvm-project/commit/df4c91342577cd9a74f168ad8c98380538d5e7c4.diff

LOG: [asan] Print `unique_id` instead of `tid` (#111925)

Before the first reuse, after 2^32 threads
they are equal.

Added: 
    

Modified: 
    compiler-rt/lib/asan/asan_descriptions.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_descriptions.cpp b/compiler-rt/lib/asan/asan_descriptions.cpp
index db87789aea86a0..caec79313e22ff 100644
--- a/compiler-rt/lib/asan/asan_descriptions.cpp
+++ b/compiler-rt/lib/asan/asan_descriptions.cpp
@@ -24,7 +24,7 @@ AsanThreadIdAndName::AsanThreadIdAndName(AsanThreadContext *t) {
     internal_snprintf(name, sizeof(name), "T-1");
     return;
   }
-  int len = internal_snprintf(name, sizeof(name), "T%d", t->tid);
+  int len = internal_snprintf(name, sizeof(name), "T%llu", t->unique_id);
   CHECK(((unsigned int)len) < sizeof(name));
   if (internal_strlen(t->name))
     internal_snprintf(&name[len], sizeof(name) - len, " (%s)", t->name);


        


More information about the llvm-commits mailing list