From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102195 invoked by alias); 12 Aug 2016 10:14:55 -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 102178 invoked by uid 89); 12 Aug 2016 10:14:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-95.1 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy=H*i:mmySsrnL, H*f:sk:zEDRAXi, H*f:CAOTD34aZ, H*i:CAOTD34aZ X-HELO: calimero.vinschen.de Received: from ipbcc0190b.dynamic.kabel-deutschland.de (HELO calimero.vinschen.de) (188.192.25.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Aug 2016 10:14:44 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 3E409A803FA; Fri, 12 Aug 2016 12:14:42 +0200 (CEST) Date: Fri, 12 Aug 2016 11:05:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: 2.5.1: kill(pid, sig) before waitpid() returns -1 for sig != 0 Message-ID: <20160812101442.xljlwtty4elc2csp@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20160811141305.3em7tpcrxsushraa@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="e3visnxabsuhb4nj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2-neo (2016-07-23) X-SW-Source: 2016-08/txt/msg00213.txt.bz2 --e3visnxabsuhb4nj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1937 Hi Erik, On Aug 12 10:44, Erik Bray wrote: > On Thu, Aug 11, 2016 at 4:13 PM, Corinna Vinschen > wrote: > > On Aug 11 11:51, Erik Bray wrote: > >> [...] > >> In response to the originally issue, this was fixed *specifically* for > >> the case of kill(pid, 0). But my reading of the above is that kill() > >> should return 0 in this case regardless of the signal (modulo > >> permissions, etc.). On Linux, for example, when calling kill with pid > >> of a zombie process the kernel will happily deliver the signal to the > >> relevant task_struct; it will just never be acted on since the task > >> will never run again. > > > > I'm not sure why cgf only fixed that for sig 0 at the time, since, as > > you noted, the text from POSIX-1.2008 does not state that this is > > *restricted* to sig 0. >=20 > Yep, my thoughts exactly. Funny that nobody noticed at the time, even thought the full POSIX text was quoted. > >> The below (untested) patch demonstrates the change I'm suggesting, > >> though I don't know what other code, if any, might be involved in > >> this. > > > > The original patch laid the groundwork by making sure that there are > > two states, EXITED and REAPED. Removing the explicit check for 0 is > > the right thing to do, afaics, so I tested and applied your patch as is, > > see > > https://cygwin.com/git/?p=3Dnewlib-cygwin.git;a=3Dcommitdiff;h=3D86f79a= f827729f3968d8b3b8f860ac29d200da0d >=20 > Thank you so much! I think this is much better behavior. >=20 > (And thanks for the correction of my name--I'm used to it being > misspelled but rarely do people notice and correct :) I belong to the misspelled kind myself (Corrina? No, Corinna! Can't you read?), so I was quite embarrassed when I did it myself :} Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --e3visnxabsuhb4nj Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXraGSAAoJEPU2Bp2uRE+gL2QP/0t9iq7nlcpUFON67CadA3ob bE8K0vTB6oife03ZXrkzkQ+0dZUrk6zshntGMaYKIccks38ceDcC2hQQkmrWhoI6 JWzoB6XwW+4r+8kNfu1I4Bjc8eNHhTrNFxco6JAmdxLvAg5XG8UQaFBfXO77Nw1p RzdtYJrufSlp+1NvZGp4ljaoIUISbEyyS7Md3XCZXNChaDUHiDsBcTp3Y+hCXpCt Sz2gPUJ10VifmgyQ1/rH4Rif9ILvfE+oipNcCRXUkw6WsX0uxGw8YOp0RDoTe/Jl Mmruo7khvO5gZEdJqVg/5RjiDF5qMqVqosg/MdbFj6F5drSlJmR6CUzS6h8J/9Xs dHwVT9DqwsFXsWY50v3lRFRrd6RwuGI8G6gDGnAbVVbLOnM7yphHJAsdbYHaonJ0 vipSBjOP44qGEyw/tHzGCas9XnePY9T8UMLalidD8hmULi7qLt3lKOIdFckgpzf6 ewQO9OxEXmxCDt08l/gfvNcwJ0mo3515WTK1Kj4Iyq32OLiaHSuwNEt2sRRRPHS4 3WBZMYisX/Rq+M8OSJ663HT8R/G6j2sIh60pKuIANIjCaVPUPtrrMjvbSDzFgrUg FQLEr75Ra0YpW1rZA5sNDmXjPkqwV2DLR+DxX0vrUQ1YNyUOCNREPLl7u2RVOU9J GzNfeqsfUjQtvtnEEd18 =potg -----END PGP SIGNATURE----- --e3visnxabsuhb4nj--