[PATCH] Cygwin: signal: Add one more guard to stop signal handling on exit().
Corinna Vinschen
corinna-cygwin@cygwin.com
Thu Mar 6 11:12:41 GMT 2025
On Mar 6 20:02, Takashi Yano wrote:
> The commit 3c1308ed890e adds a guard to stop signal handling on exit()
> in call_signal_handler(). However, the signal that is already queued
> but does not use signal handler may be going to process even with that
> patch.
> This patch add one more guard at the begining of sigpacket::process()
> to avoid that situation.
>
> Fixes: 3c1308ed890e ("Cygwin: signal: Fix a problem that process hangs on exit")
> Reviewed-by:
> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
> ---
> winsup/cygwin/exceptions.cc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
> index 759f89dca..a67529b19 100644
> --- a/winsup/cygwin/exceptions.cc
> +++ b/winsup/cygwin/exceptions.cc
> @@ -1457,7 +1457,7 @@ sigpacket::process ()
>
> /* Don't try to send signals if we're just starting up since signal masks
> may not be available. */
> - if (!cygwin_finished_initializing)
> + if (!cygwin_finished_initializing || ext_state > ES_EXIT_STARTING)
> {
> rc = -1;
> goto done;
> --
> 2.45.1
Makes sense, please push.
Corinna
More information about the Cygwin-patches
mailing list