|
|
Message-ID: <20261101212530.GT3542221@port70.net>
Date: Sun, 1 Nov 2026 22:25:30 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: Imre Kaloz <kaloz@...nel.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH libc-test] fix raise-race regression test
* Imre Kaloz <kaloz@...nel.org> [2026-11-01 16:42:30 +0100]:
> 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);
looks good, thanks.
i also added a pause() in the while loop as a followup
in case we hit that case, hang is better than busy loop.
> 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.