[LTP] openposix: timer_*/speculative: fork() to isolate the SIGSEGV on old glibc
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Wed Sep 30 00:04:07 CEST 2026
Hi Avinesh,
On Tue, 29 Sep 2026 21:31:15 +0200, Avinesh Kumar wrote:
> openposix: timer_*/speculative: fork() to isolate the SIGSEGV on old glibc
> * Test to see if timer_delete() sets errno==EINVAL for an invalid
> * timerid. Since this is a "may" requirement, succeeding or crashing
> * are equally valid outcomes.
POSIX "may fail" requirements define that returning -1 with EINVAL or
succeeding are valid outcomes; crashing is undefined behavior due to
pointer dereference on older glibc, not a defined requirement outcome.
Please update the comments across all four tests to clarify that returning
-1 with EINVAL, succeeding, or crashing (on older glibc) are accepted.
> + if (WIFSIGNALED(status) || (WIFEXITED(status) && WEXITSTATUS(status) == 0)) {
> + printf("Test PASSED\n");
> + return PTS_PASS;
> + }
WIFSIGNALED(status) without checking WTERMSIG(status) treats any terminating
signal as success, which masks abnormal process exits (such as SIGABRT or
SIGSYS) as well as test cancellation (e.g. SIGINT or test-runner SIGTERM).
Check for the expected fault explicitly with WIFSIGNALED(status) &&
(WTERMSIG(status) == SIGSEGV || WTERMSIG(status) == SIGBUS), and use PTS_PASS
instead of literal 0 for WEXITSTATUS(status). This applies to all four tests.
> + if (timer_delete(tid) == -1) {
> + if (errno == EINVAL)
> + _exit(PTS_PASS);
> + _exit(PTS_FAIL);
> + }
>
> + printf("Test FAILED\n");
> + return PTS_FAIL;
Printing only "Test FAILED" removes diagnostic information when the timer
call fails with an unexpected errno, violating Open POSIX result reporting
rules. The child should print the unexpected errno before calling _exit(),
or the parent should report the reason for failure before returning PTS_FAIL.
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
More information about the ltp
mailing list