[PATCH 3/3] Cygwin: signal: Fix a problem that process hangs on exit
Takashi Yano
takashi.yano@nifty.ne.jp
Fri Feb 28 13:42:20 GMT 2025
The process that receives many SIGSTOP/SIGCONT signals sometimes hangs
on exit in sig_dispatch_pending(). This patch avoids processing signals
in sig_dispatch_pending() as if __SIGFLASHFAST is used.
Addresses: https://cygwin.com/pipermail/cygwin/2025-February/257473.html
Fixes: d243e51ef1d3 ("Cygwin: signal: Fix deadlock between main thread and sig thread")
Reported-by: Christian Franke <Christian.Franke@t-online.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
---
winsup/cygwin/sigproc.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 8739f18f5..7cfa37d8f 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -743,7 +743,8 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
}
unsigned cw_mask;
- cw_mask = pack.si.si_signo == __SIGFLUSHFAST ? 0 : cw_sig_restart;
+ cw_mask =
+ (pack.si.si_signo == __SIGFLUSHFAST || exit_state) ? 0 : cw_sig_restart;
DWORD nb;
BOOL res;
--
2.45.1
More information about the Cygwin-patches
mailing list