All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Avinesh Kumar <avinesh.kumar@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] openposix: timer_*/speculative: fork() to isolate the SIGSEGV on old glibc
Date: Tue, 29 Sep 2026 22:04:07 +0000	[thread overview]
Message-ID: <20260929220408.34912-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260929193119.912502-1-avinesh.kumar@suse.com>

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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-09-29 22:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 12:47 [LTP] [PATCH] openposix: timer_*/speculative: Handle SIGSEGV on old glibc Avinesh Kumar via ltp
2026-09-29 17:50 ` [LTP] " linuxtestproject.agent
2026-09-29 19:31 ` [LTP] [PATCH v2] openposix: timer_*/speculative: fork() to isolate the " Avinesh Kumar via ltp
2026-09-29 22:04   ` linuxtestproject.agent [this message]
2026-09-30  7:35     ` [LTP] " Petr Vorel
2026-09-30  8:46       ` [LTP] [PATCH v3] " Avinesh Kumar via ltp
2026-09-30  9:10         ` Petr Vorel
2026-09-30 10:12           ` Cyril Hrubis
2026-09-30 12:02             ` Petr Vorel

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=20260929220408.34912-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=avinesh.kumar@suse.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.