[PATCH v2 0/3] dso__data asan and test fixes

Ian Rogers posted 3 patches 9 months ago
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(-)
[PATCH v2 0/3] dso__data asan and test fixes
Posted by Ian Rogers 9 months ago
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
Re: [PATCH v2 0/3] dso__data asan and test fixes
Posted by Namhyung Kim 9 months ago
On Mon, 17 Mar 2025 21:31:48 -0700, Ian Rogers wrote:
> 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.
> 
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung