From d53abf834c4fde7a904b9cb7b1913ee38c768f21 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 26 Oct 2021 15:01:09 +0200 Subject: [PATCH] sanitizer_common: fix deadlock detector output Print PC of the previous lock, not the current one. The current one will be printed during unwind. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D112533 --- compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp index 1c177d8e7cca..40fe56661250 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp @@ -174,7 +174,7 @@ struct InternalDeadlockDetector { if (max_idx != MutexInvalid && !mutex_can_lock[max_idx][type]) { Printf("%s: internal deadlock: can't lock %s under %s mutex\n", SanitizerToolName, mutex_meta[type].name, mutex_meta[max_idx].name); - PrintMutexPC(pc); + PrintMutexPC(locked[max_idx].pc); CHECK(0); } locked[type].seq = ++sequence;