https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a3863bfeb73f3c3832038685498c7c4148a06890

commit a3863bfeb73f3c3832038685498c7c4148a06890
Author: Takashi Yano <[email protected]>
Date:   Thu Mar 6 19:55:07 2025 +0900

    Cygwin: signal: Add one more guard to stop signal handling on exit().
    
    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: Corinna Vinschen <[email protected]>
    Signed-off-by: Takashi Yano <[email protected]>

Diff:
---
 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..68c7af16a 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 || exit_state > ES_EXIT_STARTING)
     {
       rc = -1;
       goto done;

Reply via email to