X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B504389AC74
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1641986733;
	bh=TI2DTmzjDgif15r+1inxAJWnwzcjiiRBn8z99xkA0Vk=;
	h=Date:From:To:Subject:References:In-Reply-To:List-Id:
	 List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
	 Reply-To:From;
	b=x+iUKkKvMh1S/jQeVoUMY/orkqNlNWW431pbxhw/pGK7i00ugN6eTO2YecdAsjmDR
	 9P7gMGP0hl/IAYueyety8+nrWqwIm1JIg6UwcEOn86934o5dpQHagdJvUks3RMOlC4
	 SgD4ESAwyWKnvYZ6epKHatxEkQMigmECH7h3acrs=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
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
Date: Wed, 12 Jan 2022 12:24:21 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: posix_spawn issues on i686
Message-ID: <Yd66ZZ3kEecT0KTc@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <alpine.BSO.2.21.2201101132030.11760@resin.csoft.net>
 <alpine.BSO.2.21.2201111042390.11760@resin.csoft.net>
 <0a091366-a949-d7d0-6ad1-030ddd11c7dc@cornell.edu>
 <Yd6wZ0r7EXOGcQfQ@calimero.vinschen.de>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <Yd6wZ0r7EXOGcQfQ@calimero.vinschen.de>
X-Provags-ID: V03:K1:AARHww8L6Jcvmvevd1X9qEIhSwvdnuZsptGk1G3rkeXSyM+4Ja+
 Ixs96yuuQrjuB1TYu+Rc63Z8D6bRQvTdAHSX5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SPIKE_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 <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Reply-To: cygwin@cygwin.com
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
