[LTP] openposix: timer_*/speculative: Handle SIGSEGV on invalid timer ID

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Aug 7 22:42:52 CEST 2026


Hi Avinesh,

On Aug 7, 2026, Avinesh Kumar wrote:
> openposix: timer_*/speculative: Handle SIGSEGV on invalid timer ID

> +static void sigsegv_handler(int signum PTS_ATTRIBUTE_UNUSED)
> +{
> +	printf("Got SIGSEGV when calling timer_delete() with an invalid timer ID\n");
> +	printf("Test PASSED\n");
> +	exit(PTS_PASS);
> +}

Could all four new handlers use PTS_WRITE_MSG() and _exit() instead?
printf() and exit() are not async-signal-safe. Since SIGSEGV is raised while
libc is processing the invalid timer ID, calling them invokes undefined
behavior and may hang instead of reliably reporting a pass.

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