From: linuxtestproject.agent@gmail.com
To: Jan Polensky <japo@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] thp04: Add ptrace mode and fix tracee stop synchronization
Date: Thu, 9 Jul 2026 18:56:57 +0000 [thread overview]
Message-ID: <20260709185658.3978-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260709175927.268677-1-japo@linux.ibm.com>
Hi Jan,
On Thu Jul 9 2026, Jan Polensky wrote:
> thp04: Add ptrace mode and fix tracee stop synchronization
The subject says "fix tracee stop synchronization". The original test
had no tracee or ptrace code at all -- this is entirely new logic.
"fix" suggests something broken was corrected. "add" would be more
accurate here.
> +static void tracee_main(void)
> +{
> ...
> + /*
> + * Run indefinitely - parent controls termination via PTRACE_DETACH.
> + */
The actual termination sequence in run_proc_mem_ptrace_serialized() is
PTRACE_DETACH followed by SIGKILL. PTRACE_DETACH alone does not stop
the tracee; the parent then sends SIGKILL explicitly. The comment
should say "via SIGKILL (after PTRACE_DETACH)".
> + if (*child->read_ptr != 0) {
> + tst_res(TFAIL, "Huge zero page was polluted");
> + child_cleanup();
> + exit(1);
> + }
> + if (WEXITSTATUS(status) != 0) {
> + /* Tracee reported result and exited early - already handled */
> + tracee_pid = 0;
> + free_child_state();
> + return 1;
> + }
> + if (WIFEXITED(status)) {
> + if (WEXITSTATUS(status) == 0)
> + tst_brk(TBROK, "Tracee exited unexpectedly: %s",
> + tst_strstatus(status));
> +
> + /* Tracee reported result and exited, this is expected for TFAIL */
> + tracee_exited = 1;
> + break;
> + }
The exit code is used to convey "tracee reported a failure" (exit 1)
vs "unexpected exit" (exit 0). LTP rule: never encode pass/fail as a
child exit code; use tst_res() only, and let the framework propagate
the result.
A cleaner approach: add a result_reported field (or similar) to
child_state, set it in the tracee before calling exit(0) on the
failure path, and check that flag in the parent after reaping. The
tracee always exits with 0; the parent distinguishes "reported failure"
from "unexpected exit" via the shared flag.
> + char path[64];
> + snprintf(path, sizeof(path), "/proc/%d/mem", tracee_pid);
Path buffers must use PATH_MAX, not a fixed-size literal.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-07-09 18:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 17:59 [LTP] [PATCH v6 1/1] thp04: Add ptrace mode and fix tracee stop synchronization Jan Polensky
2026-07-09 18:56 ` linuxtestproject.agent [this message]
2026-07-10 11:26 ` Cyril Hrubis
2026-07-10 11:46 ` Jan Polensky
2026-07-10 12:02 ` Cyril Hrubis
2026-07-14 15:12 ` Jan Polensky
-- strict thread matches above, loose matches on Subject: below --
2026-07-09 14:35 [LTP] [PATCH v5 " Jan Polensky
2026-07-09 16:37 ` [LTP] " linuxtestproject.agent
2026-07-09 17:59 ` Jan Polensky
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=20260709185658.3978-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=japo@linux.ibm.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.