From: linuxtestproject.agent@gmail.com
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it, LTP AI Reviewer <ltp-ai@noreply.github.com>
Subject: Re: [LTP] pthread_detach_1-2: Fix failure on modern glibc
Date: Fri, 15 May 2026 09:56:01 +0000 [thread overview]
Message-ID: <20260515095601.3983-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260509073921.8487-1-wegao@suse.com>
Hi Wei,
On Sat, 9 May 2026, Wei Gao wrote:
> pthread_detach_1-2: Fix failure on modern glibc
> + /* Wait for the main thread to allow exit */
> + do {
> + ret = sem_wait(&sem_exit);
> + }
> + while ((ret == -1) && (errno == EINTR));
> + if (ret == -1) {
> + UNRESOLVED(errno, "Failed to wait for the exit semaphore");
> + }
[...]
> + ret = sem_init(&sem_exit, 0, 0);
> + if (ret != 0) {
> + UNRESOLVED(errno, "Failed to init the exit semaphore");
> + }
[...]
> + sem_destroy(&sem_exit);
Fix looks correct. The extra semaphore ensures the child stays alive past
the pthread_join() probe, so glibc reliably sees THREAD_STATE_DETACHED
and returns EINVAL rather than ESRCH.
Reviewed-by: LTP AI Reviewer <ltp-ai@noreply.github.com>
Pre-existing issues noticed in the surrounding code (not introduced
by this patch):
- 1-2.c:5 — testfrmw.h used instead of posixtest.h; entry point is
test_main() rather than main() — established convention for this
test framework subdirectory.
- 1-2.c:178 — break inside #if VERBOSE > 0 causes case 1 fall-through
when VERBOSE=0; harmless because case 2/default are also gated by the
same #ifdef.
---
Note:
Our agent completed the review of the patch.
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
prev parent reply other threads:[~2026-05-15 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 10:00 [LTP] [PATCH v1] pthread_detach/1-2: Fix race condition between thread exit and join Wei Gao via ltp
2026-05-08 11:20 ` [LTP] " linuxtestproject.agent
2026-05-09 7:39 ` [LTP] [PATCH v2] pthread_detach_1-2: Fix failure on modern glibc Wei Gao via ltp
2026-05-15 9:56 ` linuxtestproject.agent [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=20260515095601.3983-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=ltp-ai@noreply.github.com \
--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