Re: [PATCH v2] pthread_detach_1-2: Fix failure on modern glibc

Wei Gao via ltp <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
On Thu, Jun 11, 2026 at 05:33:31PM +0200, Martin Doucha wrote:
> Hi,
> this looks like trying to hide a glibc bug to me. I've looked at both the
> POSIX standard and Linux man pages and there is no mention that already
> exited threads may be left joinable. I think we should report this as a bug
> and wait for response from glibc maintainers.

I think is actually not a glibc bug, but correct behavior under POSIX.

Link: The Open Group - pthread_detach (https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_detach.html)

Wording: 
1)Under the DESCRIPTION section, it explicitly states:
    > "The behavior is undefined if the value specified by the thread argument to pthread_detach() does not refer to a joinable thread."

2)Under the CHANGE HISTORY section also mention:

Issue 6
The pthread_detach() function is marked as part of the Threads option.
IEEE Std 1003.1-2001/Cor 2-2004, item XSH/TC2/D6/95 is applied, updating the ERRORS section so that the [EINVAL] and [ESRCH] error cases become optional. <<<<<<

Issue 7
The pthread_detach() function is moved from the Threads option to the Base.
Austin Group Interpretation 1003.1-2001 #142 is applied, removing the [ESRCH] error condition. <<<<<<<<

Also include Adhemerval Zanella who submit the glibc change.

> 
> 
> 
> -- 
> Martin Doucha   [email protected]
> SW Quality Engineer
> SUSE LINUX, s.r.o.
> CORSO IIa
> Krizikova 148/34
> 186 00 Prague 8
> Czech Republic

-- 
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.