From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57162 invoked by alias); 8 Feb 2019 12:23:44 -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 57154 invoked by uid 89); 8 Feb 2019 12:23:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-125.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=hurt, our X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (217.72.192.75) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Feb 2019 12:23:42 +0000 Received: from calimero.vinschen.de ([217.91.18.234]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MAxLT-1gyNn801sH-00BLh3; Fri, 08 Feb 2019 13:23:39 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 5BFBCA8045C; Fri, 8 Feb 2019 13:23:38 +0100 (CET) Date: Fri, 08 Feb 2019 12:23:00 -0000 From: Corinna Vinschen To: Michael Haubenwallner Cc: cygwin@cygwin.com Subject: Re: [ANNOUNCEMENT] TEST: Cygwin 3.0.0-0.7 Message-ID: <20190208122338.GN13951@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: Michael Haubenwallner , cygwin@cygwin.com References: <02da4eeb-fcce-b1bc-e6eb-68ff3ec0cf74@ssi-schaefer.com> <20190207182735.GG13951@calimero.vinschen.de> <8a2f041f-f8f7-6e17-5d97-5a168440009b@ssi-schaefer.com> <20190208113158.GH13951@calimero.vinschen.de> <17e339bb-2115-bf22-7291-04215aab3150@ssi-schaefer.com> <20190208122126.GM13951@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q59ABw34pTSIagmi" Content-Disposition: inline In-Reply-To: <20190208122126.GM13951@calimero.vinschen.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-02/txt/msg00069.txt.bz2 --Q59ABw34pTSIagmi Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2736 On Feb 8 13:21, Corinna Vinschen wrote: > On Feb 8 12:51, Michael Haubenwallner wrote: > >=20 > >=20 > > On 2/8/19 12:31 PM, Corinna Vinschen wrote: > > > On Feb 8 07:46, Michael Haubenwallner wrote: > > >> > > >> On 2/7/19 7:27 PM, Corinna Vinschen wrote: > > >>> On Feb 7 17:14, Michael Haubenwallner wrote: > > >>>> On 2/5/19 4:18 PM, Corinna Vinschen wrote: > > >>>>> Hi folks, > > >>>>> > > >>>>> > > >>>>> I uploaded a new Cygwin test release 3.0.0-0.7 > > >>>>> > > >>>> > > >>>>> Please test. > > >>>>> > > >>>> > > >>>> There's another regression - regarding spawn, exec and waitpid, > > >>>> loosing the exitstatus somewhere in between: > > >>>> > > >>> > > >>> Any chance you could take a look? I haven't much time for Cygwin t= he > > >>> next couple of days. > > >> > > >> Ok, will do. Any hints probably? > > >=20 > > > Thanks! The only thing coming to mind is the removal of the parent > > > handle when switching PID method. Or maybe the permission restriction > > > on the process handles? > >=20 > > For now it seems like there's an inconsistency with PIDs: > > A first process PID 100, receives PID 101 from spawn(), > > but in the new process getpid() returns 102: > >=20 > > $ ./dospawn /bin/bash -c 'echo $$' > > 12625 > > waitpid: pid 12624 status 0x0 >=20 > Oh, hmm. If you call spawnve, rather than execve, a new child pid > is generated in spawnve, rather than just keeping the callers pid. >=20 > However, apparently the child invents its own pid in pinfo::thisproc > after being spawned. But actually this should only occur for forked > processes aore processes started from non-Cygwin parents. Does that help, by any chance: diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 78506d43de29..0b274287d9f6 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -656,7 +656,7 @@ child_info_spawn::handle_spawn () !DuplicateHandle (GetCurrentProcess (), moreinfo->myself_pinfo, GetCurrentProcess (), &h, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) - h =3D NULL; + h =3D INVALID_HANDLE_VALUE; =20 /* Setup our write end of the process pipe. Clear the one in the struct= ure. The destructor should never be called for this but, it can't hurt to = be diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 445bd35b224e..d10c4fc4580c 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -62,6 +62,8 @@ pinfo::thisproc (HANDLE h) cygheap->pid =3D create_cygwin_pid (); flags |=3D PID_NEW; } + else if (h =3D=3D INVALID_HANDLE_VALUE) + h =3D NULL; =20 init (cygheap->pid, flags, h); procinfo->process_state |=3D PID_IN_USE; Corinna --=20 Corinna Vinschen Cygwin Maintainer --Q59ABw34pTSIagmi Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxddMoACgkQ9TYGna5E T6BkVw//eNfMD8zILZVkchE8SCaVwgwQRfsromskME5dJeRRwf5A4YR+ZOdgWFi2 6SI2KhZYZ+uZRoawjenHwZcGdL65lXxToepkUh+Y/qZXyL/wAAqslj9fXJWa50qe mYATNqSLg2TlPqr8I8N/HMVOGYKKevNjiB8YCQzazlA9vZkUhWh5q3+7v8qbGAiO gTQ5eH5ow7DeN2YvyzUOT5GiYWKLZXeoeDQFdz93byy3Wupi836ff+grxAgh6day WnBjOiESJARX249oHMEFJaAE8J1RrpSatD3Uzi0f3jdFClb/9vjT/hPrCGlTGMJ2 BhnVtrtFLuvpmehvNqy2PiAcak4KCintrMTzIS+prKCcyStPjHTqYd6Bd0g5v7U2 mXnVldF+o0lDJL0i7ab67uv2fTu2sHCBSxcy5ZAJMIhFA8x4/1ZQTqzqBIfqfpWw mEF7fvDzlv5vXLwpJMMEzuFnG2R8lCAZG4gz9SK1uI7RXgdt1xKSm1beP5gPKMBh 7spgNtOJfGQ2W25MjVPNLWK3RDU4viZPgImJZDuK3uxmJcxz4YSGnH6TIyWv9tZd ylsIY7sRxohrA3l++CB1FTV0rbuLD1+FJoajpqLUVGD9jqCYIzF5VjlXC7KYH8Rn 25sl7opU/T1OKWiQGT2G/GgNxvvnP5gKpGIWEN/J2CWPQeaU6xg= =GJAW -----END PGP SIGNATURE----- --Q59ABw34pTSIagmi--