[ANNOUNCEMENT] TEST: Cygwin 3.1.0-0.1

Takashi Yano takashi.yano@nifty.ne.jp
Wed Aug 14 19:21:00 GMT 2019

On Wed, 14 Aug 2019 15:49:00 +0200
Corinna Vinschen wrote:
> The only reason I can see is if sigwait_common() returns EINTR because
> it was interrupted by an unrelated signal.  This in turn lets the read()
> call fail with EINTR and that should be expected by the callers, in
> theory.

Strangely, this problem also disappears with this patch.

diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 9cf892801..82ac0674f 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1869,7 +1869,7 @@ thread_signalfd (void *arg)
       switch (WaitForSingleObject (si->evt, INFINITE))
        case WAIT_OBJECT_0:
-         tls->signalfd_select_wait = NULL;
+         //tls->signalfd_select_wait = NULL;
          event = true;

Moreover, this EINTR is not set by sigwait_common() but set by

With following debug print, the message shows:
1 [main] script 1082 select_stuff::wait: signal = 20
script: poll failed: Interrupted system call
Script done, file is typescript

however, the signal 20 (SIGCHLD) is registered to signalfd by
script and should be caught.

diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 9cf892801..adcc75ad3 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -446,6 +446,7 @@ next_while:;
         unconditionally, ignoring any SA_RESTART detection by
         call_signal_handler().  */
       _my_tls.call_signal_handler ();
+      system_printf ("signal = %d\n", _my_tls.infodata.si_signo);
       set_sig_errno (EINTR);
       res = select_signalled;  /* Cause loop exit in cygwin_select */

Takashi Yano <takashi.yano@nifty.ne.jp>

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list