X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 057A83858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1692090622; bh=OEqHJ6TaAuHzuhaESzVOXmG7tJWnwBKLKqurIZrIdAE=; h=Subject:Date:In-Reply-To:Cc:To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=BpTz5Ecuknma18KtL+OgX6lTuiqAeV/9o46vihso6RlE8Ds48wkDSegqpONF2W9vh Zy3J3ZCTr+2q5fPcGcGJN0zHMbq/ufz17SGu50VM267/zYtGiDVYXH5uRtRnkPjANh iYueGqx2UFx5U27pF5/js7Il053upNRgr9DU0/fA= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E0C073858020 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: Pipes truncating data in cygwin from main and cygwin-3_4-branch Date: Tue, 15 Aug 2023 18:09:50 +0900 In-Reply-To: <20230815154219.f03a40176f281f598ab0ffc4@nifty.ne.jp> Cc: cygwin AT cygwin DOT com To: Takashi Yano References: <13B0370E-B61A-44B9-A885-5FF1B8F4AC5F AT callow DOT im> <20230815093042 DOT 4c5fd1034837098aaff45e10 AT nifty DOT ne DOT jp> <20230815154219 DOT f03a40176f281f598ab0ffc4 AT nifty DOT ne DOT jp> X-Mailer: Apple Mail (2.3731.700.6) X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ssd1.hungerhost.com X-AntiAbuse: Original Domain - cygwin.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - callow.im X-Get-Message-Sender-Via: ssd1.hungerhost.com: authenticated_id: github AT callow DOT im X-Authenticated-Sender: ssd1.hungerhost.com: github AT callow DOT im X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin AT cygwin DOT 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: , From: =?utf-8?b?44Kt44Oj44Ot44Km44CA44Oe44O844KvIHZpYSBDeWd3aW4=?= Reply-To: =?utf-8?B?44Kt44Oj44Ot44Km44CA44Oe44O844Kv?= Content-Type: multipart/mixed; boundary="===============8620814253510878654==" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" --===============8620814253510878654== Content-Type: multipart/signed; boundary="Apple-Mail=_C85CDD8E-C157-40BF-BE80-4EC9C4391654"; protocol="application/pgp-signature"; micalg=pgp-sha512 --Apple-Mail=_C85CDD8E-C157-40BF-BE80-4EC9C4391654 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 15, 2023, at 15:42, Takashi Yano = wrote: >=20 >>=20 >>>=20 >>> New pipe implementation since cygwin 3.4.x provides the pipes >>> more similar to pipe in command prompt for non-cygwin apps. >>=20 >> What are the differences between these pipes? What changed? >=20 > Many changes. But, the change which triggers this behaviour > is setting FILE_SYNCHRONOUS_IO_NONALERT create option. >=20 > With this option, seekg() of Microsoft library gets success > for pipes, despite it should not I suppose. On what create is this option specified? I have the seekg() test because = on some systems you can seek on stdin when it is being redirected to = read from a file, or so I read somewhere. Perhaps I should always buffer = stdin on Windows to avoid this problem. I will put some tracing in `test-pipe.c++` to see whether it is = currently buffering or not. >=20 > In Linux, man page states that fseek() on pipes will fail. >=20 >>> Since your test case is compiled with cl.exe, it is non-cygwin >>> apps. >>=20 >> When the failure first appeared the bash shell included with Git for = Windows was being used to run the pipe (`bash -c "cat foo | bar=E2=80=9D`)= . The shell was started by ctest which had been run from PowerShell. Is = this cygwin or non-cygwin? >=20 > It depends on "bar". If bar is compiled with cl.exe or gcc/g++ in > MSYS2 mingw environment, it is non-cygwin app. >=20 >> in = https://github.com/git-for-windows/git/issues/4464#issuecomment-1671137446= the author provided minimal adaption to the reproducer to compile it = with g++ and reproduced the failure on Cygwin. It looks like the failure = happens for both cygwin and non-cygwin. It is probably related to the = new pipe implementation you mentioned. >=20 > Is there any failure case where the pipe reader is cygwin (or MSYS2) > binary? We=E2=80=99ve only tested non-Cygwin consumers. When the author of the = above GitHub issue comment was testing on Cygwin he compiled the = consumer with mingw-w64 g++. Regards -Mark --Apple-Mail=_C85CDD8E-C157-40BF-BE80-4EC9C4391654 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEzBAEBCgAdFiEE7YIgIVSPLJapfaYaETbJ7D8AEGMFAmTbQN4ACgkQETbJ7D8A EGOpCAf/crszKfrFtELIwF7O1ahH1KStImBbQtF8DhUw2gzhUJgi30+OK9ZNoSb5 Eex6WF+6n5H8rjsW2B2MhN8i00mWhWAzh/ekKy31FEO5CaTQKy+zEnMzdmWDJSPa MpMZBLgj37tMP2igrLO8s95s/EjP565hobSYwNaX0sKntQn/I7xgaGTQ4hjvKOfK sOk1nsFgX+BTxwaKEmVf5pw6RoPjSKXZ9+4skaPR+bT6FTKozk+KjHQ19p5wzIIu WDSVN5lV4EQf0MWi3uE0dXqfMAoj3vR+UeV9aQ/9+cjEirIHhJxVUCCL8EF3fMFW M77XLMoDvYfgQ8tfap27BGgkgmmLug== =tsB+ -----END PGP SIGNATURE----- --Apple-Mail=_C85CDD8E-C157-40BF-BE80-4EC9C4391654-- --===============8620814253510878654== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- 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 --===============8620814253510878654==--