From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail231.csoft.net (mail231.csoft.net [96.47.74.235]) by sourceware.org (Postfix) with ESMTPS id 0F3A73858023 for ; Tue, 11 Jan 2022 18:45:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F3A73858023 Received: from mail231.csoft.net (localhost [127.0.0.1]) by mail231.csoft.net (Postfix) with ESMTP id C0CC5CBBA for ; Tue, 11 Jan 2022 13:45:00 -0500 (EST) Received: from mail231 (mail231 [96.47.74.235]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) (Authenticated sender: jeremyd) by mail231.csoft.net (Postfix) with ESMTPSA id AA9F9CBB5 for ; Tue, 11 Jan 2022 13:45:00 -0500 (EST) Date: Tue, 11 Jan 2022 10:45:00 -0800 (PST) From: Jeremy Drake X-X-Sender: jeremyd@resin.csoft.net To: cygwin@cygwin.com Subject: Re: posix_spawn issues on i686 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (BSO 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="14594298871808-893947222-1641926700=:11760" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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: Tue, 11 Jan 2022 18:45:03 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --14594298871808-893947222-1641926700=:11760 Content-Type: text/plain; charset=US-ASCII On Mon, 10 Jan 2022, Jeremy Drake wrote: > From https://github.com/msys2/MSYS2-packages/issues/2801 > > MSYS2 recently rebuilt GNU make 4.3, and I found that after rebuilding, it > broke rather horribly on i686, where any attempt to run a command resulted > in "Invalid argument" errors. Some debugging revealed that rebuilding > make resulted in it using posix_spawn now instead of vfork. Passing > --disable-posix-spawn to make's configure script results in a working i686 > make. > > Can you create a simple, self-contained testcase in plain C? 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. --14594298871808-893947222-1641926700=:11760 Content-Type: text/x-c; name=posix_spawn.c Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=posix_spawn.c I2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5j bHVkZSA8c3RyaW5nLmg+DQoNCiNpbmNsdWRlIDx1bmlzdGQuaD4NCiNpbmNs dWRlIDxzcGF3bi5oPg0KI2luY2x1ZGUgPHN5cy93YWl0Lmg+DQoNCmV4dGVy biBjaGFyICoqZW52aXJvbjsNCg0KaW50IG1haW4oKQ0Kew0KICAgIHBpZF90 IHBpZDsNCiAgICBjaGFyICphcmd2W10gPSB7InNoIiwgIi1jIiwgImVjaG8g aGkiLCBOVUxMfTsNCiAgICBwb3NpeF9zcGF3bmF0dHJfdCBhdHRyOw0KICAg IGludCBzdGF0dXM7DQogICAgc2hvcnQgZmxhZ3MgPSBQT1NJWF9TUEFXTl9S RVNFVElEUzsNCg0KICAgIGlmICgoc3RhdHVzID0gcG9zaXhfc3Bhd25hdHRy X2luaXQoJmF0dHIpKSAhPSAwKSB7DQogICAgICAgIHByaW50ZigicG9zaXhf c3Bhd25hdHRyX2luaXQ6ICVzXG4iLCBzdHJlcnJvcihzdGF0dXMpKTsNCgly ZXR1cm4gc3RhdHVzOw0KICAgIH0NCiAgICBpZiAoKHN0YXR1cyA9IHBvc2l4 X3NwYXduYXR0cl9zZXRmbGFncygmYXR0ciwgZmxhZ3MpKSAhPSAwKSB7DQog ICAgICAgIHByaW50ZigicG9zaXhfc3Bhd25hdHRyX3NldGZsYWdzOiAlc1xu Iiwgc3RyZXJyb3Ioc3RhdHVzKSk7DQoJcmV0dXJuIHN0YXR1czsNCiAgICB9 DQoNCiAgICBzdGF0dXMgPSBwb3NpeF9zcGF3bigmcGlkLCAiL2Jpbi9zaCIs IE5VTEwsICZhdHRyLCBhcmd2LCBlbnZpcm9uKTsNCiAgICBpZiAoc3RhdHVz ID09IDApIHsNCiAgICAgICAgcHJpbnRmKCJDaGlsZCBwaWQ6ICVpXG4iLCBw aWQpOw0KICAgICAgICBkbyB7DQogICAgICAgICAgaWYgKHdhaXRwaWQocGlk LCAmc3RhdHVzLCAwKSAhPSAtMSkgew0KICAgICAgICAgICAgcHJpbnRmKCJD aGlsZCBzdGF0dXMgJWRcbiIsIFdFWElUU1RBVFVTKHN0YXR1cykpOw0KICAg ICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICBwZXJyb3IoIndhaXRwaWQi KTsNCiAgICAgICAgICAgIHJldHVybiAxOw0KICAgICAgICAgIH0NCiAgICAg ICAgfSB3aGlsZSAoIVdJRkVYSVRFRChzdGF0dXMpICYmICFXSUZTSUdOQUxF RChzdGF0dXMpKTsNCiAgICB9IGVsc2Ugew0KICAgICAgICBwcmludGYoInBv c2l4X3NwYXduOiAlc1xuIiwgc3RyZXJyb3Ioc3RhdHVzKSk7DQogICAgfQ0K ICAgIHJldHVybiBzdGF0dXM7DQp9DQo= --14594298871808-893947222-1641926700=:11760--