[compiler-rt] [NFC][sanitizer][asan] Promote stack_id into ThreadContextBase (PR #111917)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 10 21:02:50 PDT 2024
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/111917
>From 744449313fff3f637e02280d58e0037eeffcca2b Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Thu, 10 Oct 2024 16:01:03 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
=?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
[skip ci]
---
compiler-rt/lib/asan/asan_descriptions.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/compiler-rt/lib/asan/asan_descriptions.cpp b/compiler-rt/lib/asan/asan_descriptions.cpp
index 1c2f20a76343bb..778e134f1cf2a5 100644
--- a/compiler-rt/lib/asan/asan_descriptions.cpp
+++ b/compiler-rt/lib/asan/asan_descriptions.cpp
@@ -63,7 +63,10 @@ void DescribeThread(AsanThreadContext *context) {
if (flags()->print_full_thread_history) {
AsanThreadContext *parent_context =
GetThreadContextByTidLocked(context->parent_tid);
- DescribeThread(parent_context);
+ // `context->parent_tid` may point to reused slot, double check, `unique_id`
+ // of new user will always be greater then the child.
+ if (context->unique_id > parent_context->unique_id)
+ DescribeThread(parent_context);
}
}
More information about the llvm-commits
mailing list