|
|
Message-ID: <20261101154230.28114-1-kaloz@kernel.org>
Date: Sun, 1 Nov 2026 16:42:30 +0100
From: Imre Kaloz <kaloz@...nel.org>
To: musl@...ts.openwall.com
Subject: [PATCH libc-test] fix raise-race regression test
if the thread finished its raise loop before all pthread_kills arrived,
children forked by later handler1 calls missed the child check and
waited for c1 == 100 forever, blocking the parent's wait.
only spin in the parent.
Signed-off-by: Imre Kaloz <kaloz@...nel.org>
---
src/regression/raise-race.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/regression/raise-race.c b/src/regression/raise-race.c
index 6b4c4ef..ebb4106 100644
--- a/src/regression/raise-race.c
+++ b/src/regression/raise-race.c
@@ -38,11 +38,11 @@ static void *start(void *arg)
}
if (c0 != 1000)
t_error("lost signals: got %d, wanted 1000 (ischild %d forks %d)\n", c0, child, c1);
- if (child)
- _exit(t_status);
/* make sure we got all pthread_kills, then wait the forked children */
- while (c1 < 100);
+ while (c1 < 100 && !child);
+ if (child)
+ _exit(t_status);
for (i = 0; i < 100; i++) {
r = wait(&s);
if (r == -1)
--
2.47.3
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.