Hi Wei,
On Sat, 06 Jun 2026 10:08:05 +0000, Wei Gao wrote:
> mmapstress06: Convert to new API
> + SAFE_WAITPID(child_pid, &status, 0);
> + child_pid = -1;
> +
> + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
> + tst_res(TFAIL, "Child process failed (status: %d)", status);
The child already calls tst_res(TPASS/TFAIL, ...) directly, and
.forks_child = 1 tells the framework to propagate those results to the
parent. Checking WEXITSTATUS on top of that risks double-reporting: if a
SAFE_* macro in the child triggers tst_brk(), the framework records the
TBROK from the child and the parent then logs an additional TFAIL.
The correct pattern (per the LTP rules on child result reporting) is to
rely on tst_res() in the child and drop the exit-code check in the
parent. SAFE_WAITPID() is still needed to reap the child, but the result
is already reported:
SAFE_WAITPID(child_pid, &status, 0);
child_pid = -1;
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.