From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128107 invoked by alias); 15 Aug 2019 07:49:39 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 128100 invoked by uid 89); 15 Aug 2019 07:49:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-115.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,GOOD_FROM_CORINNA_CYGWIN,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=abroad X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.135) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Aug 2019 07:49:37 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MwwqB-1iE3XT0aYF-00yNEX; Thu, 15 Aug 2019 09:49:32 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 60094A807B3; Thu, 15 Aug 2019 09:49:30 +0200 (CEST) Date: Thu, 15 Aug 2019 07:49:00 -0000 From: Corinna Vinschen To: Takashi Yano Cc: cygwin@cygwin.com Subject: Re: [ANNOUNCEMENT] TEST: Cygwin 3.1.0-0.1 Message-ID: <20190815074930.GF11632@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: Takashi Yano , cygwin@cygwin.com References: <20190812224403.37e4ccfdcfb7046ed70fef16@nifty.ne.jp> <20190812153613.GN11632@calimero.vinschen.de> <20190813104753.GU11632@calimero.vinschen.de> <20190814204100.659fe40d928eae15338198a7@nifty.ne.jp> <20190814204717.caf6884b1216bbeee2f586d6@nifty.ne.jp> <20190814134900.GY11632@calimero.vinschen.de> <20190815042126.7c2f0baf57b4a82f7d013f74@nifty.ne.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9j2ELPqTsVbCO5A+" Content-Disposition: inline In-Reply-To: <20190815042126.7c2f0baf57b4a82f7d013f74@nifty.ne.jp> User-Agent: Mutt/1.11.3 (2019-02-01) X-SW-Source: 2019-08/txt/msg00194.txt.bz2 --9j2ELPqTsVbCO5A+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2351 On Aug 15 04:21, Takashi Yano wrote: > 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. >=20 > Strangely, this problem also disappears with this patch. >=20 > 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 =3D NULL; > + //tls->signalfd_select_wait =3D NULL; > event =3D true; > break; > default: The problem with not setting signalfd_select_wait to NULL here is that only a subsequent read or sigwaitinfo will do, so there's a time post-select which will reroute the signal wrongly. > Moreover, this EINTR is not set by sigwait_common() but set by > select_stuff::wait(). >=20 > With following debug print, the message shows: > 1 [main] script 1082 select_stuff::wait: signal =3D 20 > script: poll failed: Interrupted system call > Script done, file is typescript >=20 > however, the signal 20 (SIGCHLD) is registered to signalfd by > script and should be caught. >=20 > 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 =3D %d\n", _my_tls.infodata.si_signo); > set_sig_errno (EINTR); > res =3D select_signalled; /* Cause loop exit in cygwin_select */ > break; So the signal is then caught in the wrong spot. Bummer. Perhas the entire signalfd_select_wait idea was flawed from the beginning. I guess the signalfd implementation needs a restart, but I only have a week left before I'll be mostly abroad for a couple of weeks. Any ideas greatly appreciated. Corinna --=20 Corinna Vinschen Cygwin Maintainer --9j2ELPqTsVbCO5A+ Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1VDooACgkQ9TYGna5E T6AQIA/+MuiS9lup2hgfStP9ukDVQlNzF6tzNsFL+A1qP9WQmB1bQhG7xEKcbtni 08NPLZ23tI9/8BAUxqeT7vSj873qd/a7/w4NhP5P9J4sr+IXomppSCRJNA0QzzJE zx/mon4fwOF7qVkylwCigepSYosgYFjr4/FqNF/FA9dsFKXkRfHaPlhk6th5cNJj 4GuFqkIgfo7rYVIpn43M5183pZbfzqMBTm1oXnDNlRxz5JJJ4qA8soi5Hsy0Cb50 huTNxVSrRxt/tupqgyZLq/F4LpKnNVaUvsWg6FQZLOYBvsk92+vuLAfXmSAMuLK7 VdNhX8ylsJpVmnstAeV1tetjhSkfuyTM3WpRevb6e+L4w+JGtu974HNHiPXvVD/l BWkueIHgs2oUEVybTlBiHmpb81cclftZG5vdt8OK6LmpuRBjFffdnPmkZWmh+6RU AdgBhycimfXcHaO+bOfl9Jmspn+RvfferQyQY1Vaa5OdU9fLPhiU3B4eUv7yl6kq 0ydpes3XpOmyYfOX4E8EW/LVz8U1oA4vVetEoXhdmJ6ayq2caWYAYrBoeTTRMU8v HwQla7AFkT5zL7RRoevunN6F5OXYnYchkFFVu9wDAVTxuwh7LpmVTNBfBth0C4fX 1Hkroe6apGyXEC2YscV+mHLi6A6cXQ/PfhY/Oiha50dFp1ayktg= =dKh3 -----END PGP SIGNATURE----- --9j2ELPqTsVbCO5A+--