4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-03-06 15:06:25 +08:00

Cygwin: signal: Fix a problem that process hangs on exit

The process that receives many SIGSTOP/SIGCONT signals sometimes hangs
on exit in sig_dispatch_pending(). This patch skips processing signals
in call_signal_handler() when exit_state > ES_EXIT_STARTING to avoid
that situation.

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>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
This commit is contained in:
Takashi Yano 2025-02-28 16:56:30 +09:00
parent 1debf2732b
commit 3c1308ed89

View File

@ -1675,7 +1675,7 @@ _cygtls::call_signal_handler ()
while (1)
{
lock ();
if (!current_sig)
if (!current_sig || exit_state > ES_EXIT_STARTING)
{
unlock ();
break;