From df4c91342577cd9a74f168ad8c98380538d5e7c4 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 10 Oct 2024 21:04:25 -0700 Subject: [PATCH] [asan] Print `unique_id` instead of `tid` (#111925) Before the first reuse, after 2^32 threads they are equal. --- compiler-rt/lib/asan/asan_descriptions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/asan/asan_descriptions.cpp b/compiler-rt/lib/asan/asan_descriptions.cpp index db87789aea86..caec79313e22 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);