Re: [PATCH v1] perf test code-reading: Fix duplicate kernel maps and machine leak
From: Arnaldo Carvalho de Melo
Date: Mon Sep 28 2026 - 12:46:38 EST
On Mon, Sep 28, 2026 at 12:55:17AM -0700, Ian Rogers wrote:
> Furthermore, when try_kcore is true and !have_kcore, returning
> TEST_CODE_READING_NO_KCORE directly bypasses out_err, leaking the entire
> struct machine, its kernel/module maps and DSOs, all kallsyms symbols,
> and host_env.
>
> Remove the redundant machine__create_kernel_maps() call, check for
> !machine after machine__new_host(), and jump to out_err when returning
> TEST_CODE_READING_NO_KCORE.
> Fixes: 0fd4008ed755 ("perf test: Use machine__new_host in mmap thread code reading test")
> Assisted-by: Antigravity:gemini-3.1-pro
Thanks, applied to perf-tools-next, for v7.4.
- Arnaldo