Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] OpenPOSIX: Allow 0 return value when detaching or joining joined thread
Date: Tue, 12 May 2026 13:10:56 +0200	[thread overview]
Message-ID: <agMKwNsX6A7WDDn_@yuki.lan> (raw)
In-Reply-To: <20260509082649.8533-1-wegao@suse.com>

Hi!
> Latest test in our openqa setup (Linux 7.1-rc2, Glibc 2.43) show following errors:
> - pthread_detach_4-2: Test FAILED: Incorrect return code: 0 instead of ESRCH
> - pthread_join_6-2: Test FAILED: Return code should be ESRCH, but is: 0 instead.
> 
> These are caused by glibc commit 5da15b15adab661c80e373b6af89be0b5fa5b3ad
> ("nptl: Do not use pthread set_tid_address as state synchronization (BZ #19951)").
> 
> The new glibc logic removed the explicit validation of thread handles that
> previously returned ESRCH:
> 
> --- a/nptl/pthread_detach.c
> -  if (INVALID_NOT_TERMINATED_TD_P (pd))
> -    return ESRCH;
> 
> --- a/nptl/pthread_join_common.c
> -  if (INVALID_NOT_TERMINATED_TD_P (pd))
> -    return ESRCH;
> -
> 
> Update the tests to allow both return codes.
> 
> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  .../conformance/interfaces/pthread_detach/4-2.c             | 6 +++---
>  .../conformance/interfaces/pthread_join/6-2.c               | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c
> index a6dc83efd..1e7b84117 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c
> @@ -18,7 +18,7 @@
>   * 1. Create a thread.
>   * 2.Wait 'till the thread exits.
>   * 3.Try and detach this thread.
> - * 4.Check the return value and make sure it is ESRCH
> + * 4.Check the return value and make sure it is ESRCH or 0
>   *
>   */
>  
> @@ -59,9 +59,9 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
>  	ret = pthread_detach(new_th);
>  
>  	/* Check return value of pthread_detach() */
> -	if (ret != ESRCH) {
> +	if (ret != ESRCH && ret != 0) {
>  		printf
> -		    ("Test FAILED: Incorrect return code: %d instead of ESRCH\n",
> +		    ("Test FAILED: Incorrect return code: %d instead of ESRCH or 0\n",
>  		     ret);
>  		return PTS_FAIL;

Technically since this is open posix testsuite we should PTS_UNTESTED on
0 since we were not able to trigger the error since the implementation
does not implement the optional behavior.

Something as:

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c
index 1e7b84117..fc7a6e9c9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c
@@ -58,8 +58,13 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
        /* Detach the non-existant thread. */
        ret = pthread_detach(new_th);

+       if (ret == 0) {
+               printf("Test UNTESTED: Implementation does not return ESCHR\n");
+               return PTS_UNTESTED;
+       }
+
        /* Check return value of pthread_detach() */
-       if (ret != ESRCH && ret != 0) {
+       if (ret != ESRCH) {
                printf
                    ("Test FAILED: Incorrect return code: %d instead of ESRCH or 0\n",
                     ret);


-- 
Cyril Hrubis
chrubis@suse.cz

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

      parent reply	other threads:[~2026-05-12 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09  8:26 [LTP] [PATCH v1] OpenPOSIX: Allow 0 return value when detaching or joining joined thread Wei Gao via ltp
2026-05-12  8:08 ` [LTP] " linuxtestproject.agent
2026-05-12  8:18   ` Andrea Cervesato via ltp
2026-05-12  9:21     ` Wei Gao via ltp
2026-05-12  9:30       ` Andrea Cervesato via ltp
2026-05-12  8:18 ` [LTP] [PATCH v1] " Andrea Cervesato via ltp
2026-05-12  9:31 ` Andrea Cervesato via ltp
2026-05-12 11:10 ` Cyril Hrubis [this message]

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=agMKwNsX6A7WDDn_@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox