public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Cc: キャロウ マーク <github@callow.im>
Subject: Re: Pipes truncating data in cygwin from main and cygwin-3_4-branch
Date: Tue, 15 Aug 2023 15:42:19 +0900	[thread overview]
Message-ID: <20230815154219.f03a40176f281f598ab0ffc4@nifty.ne.jp> (raw)
In-Reply-To: <CCC360AD-21B1-40E4-8B6B-FCFAF5612939@callow.im>

On Tue, 15 Aug 2023 09:53:16 +0900
キャロウ マーク wrote:
> > On Aug 15, 2023, at 9:30, Takashi Yano <takashi.yano@nifty.ne.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”`). 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.yano@nifty.ne.jp>

  parent reply	other threads:[~2023-08-15  6:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <13B0370E-B61A-44B9-A885-5FF1B8F4AC5F@callow.im>
2023-08-15  0:30 ` Takashi Yano
     [not found]   ` <CCC360AD-21B1-40E4-8B6B-FCFAF5612939@callow.im>
2023-08-15  6:42     ` Takashi Yano [this message]
     [not found]       ` <FCF9C3F3-7ED6-406A-8420-05379E4C5875@callow.im>
2023-08-15  9:45         ` Takashi Yano
2023-08-15 10:01         ` キャロウ マーク

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230815154219.f03a40176f281f598ab0ffc4@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@cygwin.com \
    --cc=github@callow.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).