public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: sigproc: Do not send signal to myself if exiting.
@ 2021-11-19 17:40 Takashi Yano
  0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2021-11-19 17:40 UTC (permalink / raw)
  To: cygwin-cvs

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

commit a92d69d7439de92974d733d402d34f6f11dafdcb
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Sat Nov 20 02:32:12 2021 +0900

    Cygwin: sigproc: Do not send signal to myself if exiting.
    
    - This patch fixes the issue that process sometimes hangs for 60
      seconds with the following scenario.
        1) Open command prompt.
        2) Run "c:\cygwin64\bin\bash -l"
        3) Compipe the following source with mingw compiler.
           /*--- Begin ---*/
           #include <stdio.h>
           int main() {return getchar();}
           /*---- End ----*/
        4) Run "tcsh -c ./a.exe"
        5) Hit Ctrl-C.

Diff:
---
 winsup/cygwin/sigproc.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 97211edcf..2441efc92 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -603,6 +603,11 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
       its_me = false;
     }
 
+  /* Do not send signal to myself if exiting, which will be
+     ignored in wait_sig thread. */
+  if (its_me && exit_state > ES_EXIT_STARTING && si.si_signo > 0)
+    goto out;
+
   if (its_me)
     sendsig = my_sendsig;
   else


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-19 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 17:40 [newlib-cygwin] Cygwin: sigproc: Do not send signal to myself if exiting Takashi Yano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).