[PATCH v2 0/3] dso__data asan and test fixes
From: Ian Rogers
Date: Tue Mar 18 2025 - 00:32:03 EST
The dso__data logic could deadlock with itself when build with asan or
reference count checking due to trying to recurively take a
non-recursive mutex. Use clang's thread safety analysis to find/fix
the problem. Running the tests would fail with -F no-fork mode as a
file descriptor wasn't cleaned up.
v2: Remove an unnecessary if as suggested by Namhyung.
Ian Rogers (3):
perf mutex: Add annotations for LOCKS_EXCLUDED and LOCKS_RETURNED
perf dso: Use lock annotations to fix asan deadlock
perf test dso-data: Correctly free test file in read test
tools/perf/tests/dso-data.c | 28 ++++-----
tools/perf/util/dso.c | 74 +++++++++++++++---------
tools/perf/util/dso.h | 15 +++--
tools/perf/util/mutex.h | 8 +++
tools/perf/util/unwind-libunwind-local.c | 16 ++---
5 files changed, 86 insertions(+), 55 deletions(-)
--
2.49.0.rc1.451.g8f38331e32-goog