From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by sourceware.org (Postfix) with ESMTPS id A4DC03858416 for ; Wed, 12 Jan 2022 11:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4DC03858416 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 1N336J-1mMTn647Sf-013NfF for ; Wed, 12 Jan 2022 12:24:22 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 87BBFA80B83; Wed, 12 Jan 2022 12:24:21 +0100 (CET) Date: Wed, 12 Jan 2022 12:24:21 +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: X-Provags-ID: V03:K1:AARHww8L6Jcvmvevd1X9qEIhSwvdnuZsptGk1G3rkeXSyM+4Ja+ Ixs96yuuQrjuB1TYu+Rc63Z8D6bRQvTdAHSX5h4x1VREnLO1FU7ONfCdS5Ne3vCNvSw2v35 KQdK8qFW06QoSE3gE5rSZUwt7p0Ts5RrKj73TjIjZUwPDSopT2Lh9cQSHwh+21Zg/DM+EQP GSCpSJATIB8p6KgxHF9sw== X-UI-Out-Filterresults: notjunk:1;V03:K0:sk9tMCw4zgU=:QYupukvy65wV4TYfFTPpy1 CYjQTLo6zC/lbCi2wTE+Ccb+NT2GWcJmOBxGobKpIF0EllGSY0azEmrMXdxJXMpCdc2M0zv0G xpaqL23n6wsYqvdjh9Rg/3T9VbbZB7Q+RC3HDmMeKPPA7usw4Ogaz0uFAhtRsA1sNCLbmECai WUbRwH2699/4UjVvnhBLC/JemoMar5sQ3JMEWC1tMTBQihIe3uMRirbFp4WLBjaxEGx6gIHcR 8CFqmGXVwPzinlq6MW0KCYCrBzmwOEfvYAt0CYVPhTikhR+ecitDIDEMwqFWj5+IyroEPwCxo Oheu/pUTv41BAdZC4munB6R5XrR0I2OeD1ZuPya81nmhZ9Pa26sFsr2VudbS5g3o8sniU/wSd 0e60ck5ACTeHh5y66frPFFVzogXa040DabQobX3A0ke+yhQRmotIfQ9diSIor3H2/TauxYMq+ qJMG6dKEKpfmPoGV7VvPXy/Wn7+EMST6vhd9nptOteqx7AQgaMbKCghyqOqqjJoiFqTQhbg3d DHrF51F8HExxAdcQ10lt3+nUtPIRzSKTgKQRl7Oqa4ahQbt9v6DC6ko4SAeRkMURkRe9rFwS3 cr/gBy4Ojgbd8jXQaFZkPgmTn5+jfoYa1ART48AYlfQeckETctf7yJJcvdkwWRXWz5rS2cdmq nUc0R0PIdXSzDE8egpcwJeSvnH0TvQqEvC1z84iMZldr465v7Fzlv6CrlUvozCnWZWHd/IGGD A27gN9BmSGaCxOmx X-Spam-Status: No, score=-93.8 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_NUMSUBJECT, 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 11:24:26 -0000 On Jan 12 11:41, Corinna Vinschen wrote: > 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. New developer snapshot is up at https://cygwin.com/snapshots/ Please test. Thanks, Corinna