From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id 316BB393A410 for ; Wed, 12 Jan 2022 10:41:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 316BB393A410 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MC2sF-1nDLpK2jpl-00CNI0 for ; Wed, 12 Jan 2022 11:41:43 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 334B1A80B83; Wed, 12 Jan 2022 11:41:43 +0100 (CET) Date: Wed, 12 Jan 2022 11:41:43 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: posix_spawn issues on i686 Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <0a091366-a949-d7d0-6ad1-030ddd11c7dc@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0a091366-a949-d7d0-6ad1-030ddd11c7dc@cornell.edu> X-Provags-ID: V03:K1:cZy6qT9E5L/Ug/n6r8RE7pMgeuiO5ftaDIHbENSGmObG3rAnhbW HsNNkoiv8zJs1g/bJ2BCTKtL/ER3+MqiOV9V+9eKz7DPuPKoiCXX4cLepk4TPFRjRR56mVP tf7RYtQ97N+96jhJTHdO2EHGIYKEIS+mM6ogICAkFsJOXKh32IbCEuR2C2gTH1I7H1/W6CA +UwDmU0nL8YvYU6fh6zvw== X-UI-Out-Filterresults: notjunk:1;V03:K0:QCBeLjNniRc=:Rowy5y5BPS9Nd2MPwKREOt GfJLnTH0S5muazqLsJCxiez6yEJRwaM8CLNM2nOZza1WYpNV54kx/Tm7U2YPv5flNL9kK5VHD 4sPxUIprNaAYjx6IuMO0DL1+6kDetwjelGNuaLS+MohHBJDEPl2TIGBfQ6ukAzoboEBec8hFr CNhbw/hgsNsQ3nVdLlNlZDudX3oYY6sRsAdrMQW2p+AbzcGX4XPWGIbtDSY40gNsgCYJvDuGB W4lMxBaro37uVpNvH1kIGfpLb6OcmllZllFNkelMIjeunU+PjZp1dOZHHtIbFpwkOSzImCgip 0E3n70/E2EF/Dn7qCdI+lGY1mTist5f6Wgkw1QBB0b7RPyzptPHNn1CY8Zp2L6AwG0K3tO1Y0 T7+T10l/Q4LA8zayqTRq+zoA+g5KBc+7/VYfCWdaUVyTHdS1dZyQLBdTUZSonyxV33HTsGOEc Hynba77J5BLHP7VTY1LF6vjL/4DVZweLcGJMz66NdQZDWAwrlNfb45ZwO1O3oEP6TwdoGgbYB AhJecAaezn1FvyudUQtwE4kQDNQY/IYJ4+3981XDYR9hcSOdngLZtU1Qi5HtN8bL7MefY7nlQ 43EaxAF64mWcGxaPOkIwEAN/UePvAWcy1sZ5LVo2+RXI8z2XGR0CBnlKGol0gZNNNid2xW8Od bmpNAsnAqkpyL4McamVqTizaaM/G64Fvcw7Xy7KTe6qU5NeCtfqFOc6+ZlKVYYHcmBNAmo3iA t5fgo+kW4utmY8VY X-Spam-Status: No, score=-93.5 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_FAIL, SPF_HELO_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2022 10:41:46 -0000 On Jan 11 16:08, Ken Brown wrote: > On 1/11/2022 1:45 PM, Jeremy Drake via Cygwin wrote: > > Sorry, I am not subscribed to the list so don't have the message to reply > > to for threading purposes, but attached please find a C reproducer that > > works on x86_64 but fails on i686. The particular issue seems to be the > > POSIX_SPAWN_RESETIDS flag - not setting that allows i686 to succeed too. Thanks for the STC, Jeremy! > I don't have time to check this carefully, but it looks to me like the > problem is that process_spawnattr calls setegid and seteuid instead of > setegid32 and seteuid32. This causes truncation of the gid and uid. You're right. Additionally the calls to getgid and getuid have to use the internal getgid32 and getuid32 functions. I'll apply a fix. Thanks guys! Corinna