From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100151 invoked by alias); 8 Jan 2019 21:05:40 -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 100140 invoked by uid 89); 8 Jan 2019 21:05:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-100.4 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=reading, face X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (217.72.192.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Jan 2019 21:05:37 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MVdYY-1gomcN1T88-00RVq9 for ; Tue, 08 Jan 2019 22:05:35 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 4D75EA8075F; Tue, 8 Jan 2019 22:05:34 +0100 (CET) Date: Tue, 08 Jan 2019 21:05:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Bash heredoc on FD 3 Message-ID: <20190108210534.GI593@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20190107190313.GD593@calimero.vinschen.de> <5c33ec76.1c69fb81.10fee.7eef@mx.google.com> <20190108112705.GF593@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="47eKBCiAZYFK5l32" Content-Disposition: inline In-Reply-To: <20190108112705.GF593@calimero.vinschen.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-01/txt/msg00038.txt.bz2 --47eKBCiAZYFK5l32 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2376 On Jan 8 12:27, Corinna Vinschen wrote: > On Jan 7 16:19, Steven Penny wrote: > > On Mon, 7 Jan 2019 20:03:13, Corinna Vinschen wrote: > > > I can't reproduce this with my latest code. It works fine for me > > > every time, independently of POSIXLY_CORRECT. > > >=20 > > > I uploaded new snapshots to https://cygwin.com/snapshots/ with all > > > the latest changes. Please try again. > >=20 > > I retested with cygwin1-20190107.dll.xz. My results below. Note that "s= uccess" > > means that with Bash, the script runs without error, regardless of > > "POSIXLY_CORRECT" variable as you said. "failure" is to mean that with = Bash, > > running with "POSIXLY_CORRECT" produces this error: > >=20 > > awk: error: can't open source file `/dev/fd/3' for reading (Permissi= on > > denied) > >=20 > > Windows 10: success > > Windows 8.1: failure > > Windows 7: failure > > [...] >=20 > I could reproduce this on W8.1. After some debugging it turned out that > this is, in fact, not related to POSIXLY_CORRECT at all. >=20 > POSIXLY_CORRECT only changes the way the file is used in gawk. If > POSIXLY_CORRECT isn't set, it just uses the incoming file descriptor 3 > due to some code handling the path "/dev/fd/" differently. > This works fine under all circumstances because it does not trigger my > new code for /proc//fd/ at all. >=20 > However, as soon as POSIXLY_CORRECT is set, my new code is triggered and > falls flat on its face on pre-W10 systems (serves me right for > developing and testing on W10 only). The reason is that file delete > semantics have changed on W10. On pre-W10, reopening a file by handle > (equivalent to the Win32 API call ReOpenFile) does not work on files for > which the delete dispostion has been set. This works fine on W10, > though. >=20 > Back to the drawing board. I have an idea or two how to workaround this > shortcoming of pre-W10 systems. >=20 > Just FTR, I really like what MSFT changes in W10 under the hood. I'm > especially happy that the changes for WSL are exposed to the Windows > subsystem, too, so we can profit from them as well. Personally I'm > not looking back to pre-W10 systems at all. I added some changes to make this work in older systems as well. I uploaded new snapshots to //cygwin.com/snapshots/ Please try. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer --47eKBCiAZYFK5l32 Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlw1EJ4ACgkQ9TYGna5E T6ALDxAAkhEJGfTHmc3V3u9EU5mlRR+/+sNOw6GR7XIxbFTWJMJQ3CYBmdCNY6nM o8L63L7AF6zD/Ku2BsIBkB/Wnseg4zFhXNkm54gui2T5/5FWTiMvm9hN1wJTgyBA lTDl5LGsvBRCK4jCa/QEZQOB1GI4TTqEWkQwyFqhbRBZKMaEo7eWtGMe+b+Yft3M VUohiLEK0Xj7DanGQ7SNnWE2CJp4oRmz5K43uRDPs61KKLuB6K+yZkFoJD+kBlWO DJbU5XEiOxyJCohbyVLbdKT8XlcNU7Q4zIKQ9KIpRB2jkyL2TjmdkiHgEHmIjHxI pBBmrhXkZcRl8PgtvYSf6xf7+3ZpSvXLxvNvCGnsX0D6Kg+mxCrnAzqz9kL5dbyZ NcLXnDX8tOQxbKNxhRoPULaVo312xu2LsvGwlEtLVJI7ArkLjLesGU5IbUZQ2ZFy xAnF+xIEtuRqfFYVFXOVzP/5Lwc9fBdo3S3lWnLUlZrl5t2+9WOeRE94MEt4twB1 EnFiZOC1FqQ6qX1ZYwgMJMS1jXm+SzWrAtz8PW4Dsqadyngr2J1Sf8446HampdKp SL2+V9jkR4qeVoAkpVLbnjqLAIAdFnbeJOTV8lkyAJXxfbgKga0T40cBJbHBdGcV ICAGo2PpYA4120V9NUr8u2Qqm8CcIn3+UYJvmkR4FRMgkfTCCkk= =IL8o -----END PGP SIGNATURE----- --47eKBCiAZYFK5l32--