delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/08/15/02:43:04

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 534C63857027
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1692081781;
bh=s5JuqRTtWM8wmBANnSPeEIfJUJb4PCrJ58tWfobXfNE=;
h=Date:To:Cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=V1Z/yFLiOJTfLa6IFCNf2FgwkzHpwmh5YHR8FPl08p/2hC9H/3TwKjGllyGdLGVl+
5wuw8sUorgzQAm54Zh79A6WIm0y1NQq7jOHXGK43hhD38eYcePt0RAcj8ozSoAMR3O
4O/Ctg7q3NC+kPgtBXwIlsYuS1vL3qsVVb1pdHIM=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E9DC3858422
Date: Tue, 15 Aug 2023 15:42:19 +0900
To: cygwin AT cygwin DOT com
Cc: =?ISO-2022-JP?B?GyRCJS0lYyVtJSYhISVeITwlLxsoQg==?= <github AT callow DOT im>
Subject: Re: Pipes truncating data in cygwin from main and cygwin-3_4-branch
Message-Id: <20230815154219.f03a40176f281f598ab0ffc4@nifty.ne.jp>
In-Reply-To: <CCC360AD-21B1-40E4-8B6B-FCFAF5612939@callow.im>
References: <13B0370E-B61A-44B9-A885-5FF1B8F4AC5F AT callow DOT im>
<20230815093042 DOT 4c5fd1034837098aaff45e10 AT nifty DOT ne DOT jp>
<CCC360AD-21B1-40E4-8B6B-FCFAF5612939 AT callow DOT im>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, 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-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Tue, 15 Aug 2023 09:53:16 +0900
$B%-%c%m%&!!%^!<%/(B wrote:
> > On Aug 15, 2023, at 9:30, Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp> wrote:
> > 
> > Your test case does not work in command prompt as well.
> > 
> > Try
> > type testfile | test-pipe sizeoftestfile
> > in command prompt. It will fail.
> 
> Interesting.
> 
> > 
> > New pipe implementation since cygwin 3.4.x provides the pipes
> > more similar to pipe in command prompt for non-cygwin apps.
> 
> What are the differences between these pipes? What changed?

Many changes. But, the change which triggers this behaviour
is setting FILE_SYNCHRONOUS_IO_NONALERT create option.

With this option, seekg() of Microsoft library gets success
for pipes, despite it should not I suppose.

In Linux, man page states that fseek() on pipes will fail.

> > Since your test case is compiled with cl.exe, it is non-cygwin
> > apps.
> 
> 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$B!I(B`). The shell was started by ctest which had been run from PowerShell. Is this cygwin or non-cygwin?

It depends on "bar". If bar is compiled with cl.exe or gcc/g++ in
MSYS2 mingw environment, it is non-cygwin app.

> 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.

Is there any failure case where the pipe reader is cygwin (or MSYS2)
binary?

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019