All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] open_posix/pthread_sigmask/18-1: Fix race condition in signal thread join
@ 2026-06-15  1:29 Wenbo Ma
  2026-06-15  8:26 ` [LTP] " linuxtestproject.agent
  2026-06-15 11:05 ` [LTP] [PATCH] " Andrea Cervesato via ltp
  0 siblings, 2 replies; 3+ messages in thread
From: Wenbo Ma @ 2026-06-15  1:29 UTC (permalink / raw)
  To: ltp; +Cc: Wenbo Ma

When WITH_SYNCHRO is defined, the signal sender threads (th_sig1 and
th_sig2) may block on sem_wait() after the main loop exits. This causes
pthread_join() to hang indefinitely since those threads never wake up.

Post to both semaphores before joining to ensure the signal threads
can proceed and exit cleanly.

Signed-off-by: Wenbo Ma <wenbo1.ma@intel.com>
---
 .../conformance/interfaces/pthread_sigmask/18-1.c            | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c
index f303e9854..e4606813e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c
@@ -293,6 +293,11 @@ int main(void)
 	}
 	while (do_it);
 
+#ifdef WITH_SYNCHRO
+	sem_post(&semsig1);
+	sem_post(&semsig2);
+#endif
+
 	if ((ret = pthread_join(th_sig1, NULL))) {
 		UNRESOLVED(ret, "Signal 1 sender thread join failed");
 	}
-- 
2.34.1


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] open_posix/pthread_sigmask/18-1: Fix race condition in signal thread join
  2026-06-15  1:29 [LTP] [PATCH] open_posix/pthread_sigmask/18-1: Fix race condition in signal thread join Wenbo Ma
@ 2026-06-15  8:26 ` linuxtestproject.agent
  2026-06-15 11:05 ` [LTP] [PATCH] " Andrea Cervesato via ltp
  1 sibling, 0 replies; 3+ messages in thread
From: linuxtestproject.agent @ 2026-06-15  8:26 UTC (permalink / raw)
  To: Wenbo Ma; +Cc: ltp

Hi Wenbo,

On Mon, Jun 15, 2026 at 09:29:11AM +0800, Wenbo Ma wrote:
> open_posix/pthread_sigmask/18-1: Fix race condition in signal thread join

Verdict - Reviewed

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH] open_posix/pthread_sigmask/18-1: Fix race condition in signal thread join
  2026-06-15  1:29 [LTP] [PATCH] open_posix/pthread_sigmask/18-1: Fix race condition in signal thread join Wenbo Ma
  2026-06-15  8:26 ` [LTP] " linuxtestproject.agent
@ 2026-06-15 11:05 ` Andrea Cervesato via ltp
  1 sibling, 0 replies; 3+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-15 11:05 UTC (permalink / raw)
  To: Wenbo Ma; +Cc: Wenbo Ma, ltp

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-15 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15  1:29 [LTP] [PATCH] open_posix/pthread_sigmask/18-1: Fix race condition in signal thread join Wenbo Ma
2026-06-15  8:26 ` [LTP] " linuxtestproject.agent
2026-06-15 11:05 ` [LTP] [PATCH] " Andrea Cervesato via ltp

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.