From: sashiko-bot@kernel.org
To: "Namhyung Kim" <namhyung@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 11/11] perf tests: Add namespace, nsinfo, and boot ID tests
Date: Mon, 23 Nov 2026 23:33:39 +0000 [thread overview]
Message-ID: <sashiko-outbox-230212@kernel.org> (raw)
In-Reply-To: <20261123232025.1406560-12-namhyung@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] perf tests: leaked thread ref on failure in
test__nsinfo_thread_liveness()
--
commit bd9ea809a4bbf37b8dd8dcc52bfc3183504775fe
Author: Namhyung Kim <namhyung@kernel.org>
perf tests: Add namespace, nsinfo, and boot ID tests
This commit adds a namespace and nsinfo unit test suite and extends the
header and pipe shell tests to verify boot ID handling.
> diff --git a/tools/perf/tests/namespaces.c b/tools/perf/tests/namespaces.c
> new file mode 100644
> index 0000000000000..2e332c333960e
> --- /dev/null
> +++ b/tools/perf/tests/namespaces.c
[ ... ]
> +static int test__nsinfo_thread_liveness(struct test_suite *test __maybe_unused,
> + int subtest __maybe_unused)
> +{
[ ... ]
> + machine__remove_thread(off_m, off_th);
> + thread__put(off_th);
> + off_th = NULL;
> +
> + thread__e_machine_endian(off_sub, off_m, NULL, NULL);
> + if (machine__find_thread(off_m, self_pid, self_pid) != NULL) {
> + pr_debug("thread__e_machine_endian() unexpectedly recreated exited leader\n");
> + goto out;
> + }
[Severity: Low]
Does this leak a struct thread reference if the check fails?
machine__find_thread() returns a refcounted pointer that must be released
with thread__put(), so assigning the result to off_th (as done with th in
the later perf_event__exit_del_thread() check) would let thread__put(off_th)
at the out label release it on failure.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123232025.1406560-1-namhyung@kernel.org?part=11
next prev parent reply other threads:[~2026-11-23 23:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 23:20 [PATCH v3 00/11] perf tools: Enhance namespace and chroot handling Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 01/11] perf tools: Add HEADER_BOOT_ID feature Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 02/11] perf tools: Add perf_env__is_same_boot() Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 03/11] perf tools: Add nsinfo__new_thread() to track tid Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 04/11] perf tools: Add lock to struct nsinfo Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 05/11] perf tools: Defer /proc lookup until nsinfo is used Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 06/11] perf tools: Verify thread status and mount namespace inode Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 07/11] perf tools: Check thread liveness when accessing /proc Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 08/11] perf tools: Export filename__read_build_id_ns() Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 09/11] perf tools: Only enter mount namespace if necessary Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 10/11] perf tools: Scope mount namespace entry in dso__load() Namhyung Kim
2026-11-23 23:20 ` [PATCH v3 11/11] perf tests: Add namespace, nsinfo, and boot ID tests Namhyung Kim
2026-11-23 23:33 ` sashiko-bot [this message]
2026-11-23 23:35 ` [PATCH v3 00/11] perf tools: Enhance namespace and chroot handling sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-230212@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox