diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2021-11-20 02:32:12 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2021-11-20 02:37:52 +0900 |
commit | a92d69d7439de92974d733d402d34f6f11dafdcb (patch) | |
tree | 071a38b667007dc33a5a5a5a26ea9084f2ce940a /winsup | |
parent | c8b779aff447966ec467c3a52edab34a6ab76277 (diff) | |
download | newlib-a92d69d7439de92974d733d402d34f6f11dafdcb.zip newlib-a92d69d7439de92974d733d402d34f6f11dafdcb.tar.gz newlib-a92d69d7439de92974d733d402d34f6f11dafdcb.tar.bz2 |
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.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 97211ed..2441efc 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 |