git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: cat-file timing window on Cygwin

From
Jason Pyeron <jpyeron@pdinc.us>
Date
Aug 27, 2017, 18:53 UTC
Message-ID
<C7EA6E1174C3400B98A9F64FF0E8DEC4@blackfat>
In-Reply-To
<0822303f-63b1-13e2-be43-8e2e4dab478e@ramsayjones.plus.com>
Show 39 quoted lines
> -----Original Message-----
> From: Ramsay Jones
> Sent: Sunday, August 27, 2017 11:48 AM
> To: Adam Dinwoodie
> Cc: Jeff King; git@vger.kernel.org; Johannes Schindelin
> Subject: Re: cat-file timing window on Cygwin
> 
> 
> 
> On 27/08/17 12:33, Adam Dinwoodie wrote:
> > On Sun, Aug 27, 2017 at 03:06:31AM +0100, Ramsay Jones wrote:
> >> On 26/08/17 22:11, Adam Dinwoodie wrote:
> >>> On Sat, Aug 26, 2017 at 11:53:37AM -0700, Jeff King wrote:
> >>>> Interesting. I find it a little hard to believe there's 
> so obvious 
> >>>> a bug as "fflush(NULL) flushes stdin", but well...that's 
> what it seems like.
> >>>>
> >>>> If that's truly what it is, this is the minimal 
> reproduction I came 
> >>>> up
> >>>> with:
> >>>>
> >>>> -- >8 --
> >>>> #include <stdio.h>
> >>>>
> >>>> int main(void)
> >>>> {
> >>>> 	char buf[256];
> >>>> 	while (fgets(buf, sizeof(buf), stdin)) {
> >>>> 		fprintf(stdout, "got: %s", buf);
> >>>> 		fflush(NULL);
> >>>> 	}
> >>>> 	return 0;
> >>>> }
> >>>> -- 8< --
> >>>>
> >>>> If this really is the bug, then doing something like 
> "seq 10 | ./a.out"
Tests good on latest snapshot. Fails on 
Cygwin DLL version info:
        DLL version: 2.8.2
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 313
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Installations name: Installations
        Cygdrive default prefix:
        Build date:
        Shared id: cygwin1S5
Show 48 quoted lines
> >>>> would drop some of the input lines.
> >>>
> >>> ...yep.  It does.  Specifically, I consistently only get 
> the firsts
> >>> line:
> >>>
> >>>     $ seq 10 | ./a.exe
> >>>     got: 1
> >>>     
> >>>     $
> >>>
> >>> If I introduce a delay between the lines of stdin (which 
> I tested by 
> >>> just typing stdin from the keyboard), it works as expected.
> >>>
> >>> Looks like this one will need to go to the Cygwin mailing 
> list; I'll 
> >>> take it there shortly.  Thank you all for your help 
> getting this far!
> >>
> >> This is apparently fixed in cygwin v2.8.3 [see commit 78ade082fe, 
> >> ('Revert "errno: Stop using _impure_ptr->_errno completely"', 
> >> 19-07-2017), commit 9cc89b0438 ("cygwin: Use errno instead of 
> >> _impure_ptr->_errno", 19-07-2017), commit a674199fc9 
> ("cygwin: Bump 
> >> DLL version to 2.8.3",
> >> 19-07-2017) and commit d2ae2f00b8 ("cygwin: add fflush fix 
> to release 
> >> notes", 19-07-2017)].
> >>
> >> I haven't had a chance to try v2.8.3 yet (it's 3am and I'm 
> about to 
> >> go get some sleep).
> > 
> > Cygwin 2.8.3 hasn't been released yet,
> 
> Heh, yes, I found that out myself this afternoon. ;-)
> 
> >                                         but I've just tested the 
> > latest development snapshot with Jeff's simple test case, 
> and it works 
> > as expected, so I'm going to assume the Git test will start passing 
> > once that version of the Cygwin DLL is released too.
> 
> Hmm, I'm not keen on installing "snapshot"(s), so I think I 
> will wait for the release to test it. (However, as a matter 
> of interest, how would I obtain/install/test this snapshot 
> release - is it a 'low-risk' exercise?)
Using https://cygwin.com/snapshots/x86_64/cygwin-20170823.tar.xz

D:\inst\cygwin\cygwin-20170823>usr\bin\bash.exe bash-4.4$ seq 10 | ./a.exe got: 1 got: 2 got: 3 got: 4 got: 5 got: 6 got: 7 got: 8 got: 9 got: 10 bash-4.4$ cat cygcheck.out

Cygwin Configuration Diagnostics Current System Time: Sun Aug 27 14:35:25 2017

Windows 10 Professional Ver 10.0 Build 14393
    Cygwin DLL version info:
        DLL version: 2.9.0
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 317
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Installations name: Installations
        Cygdrive default prefix:
        Build date:
        Snapshot date: 20170823-15:44:28
        Shared id: cygwin1S5
bash-4.4$
v/r,
Jason Pyeron
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
Previous: Ramsay JonesNext: Ramsay Jones
Message 10 of 11 in “cat-file timing window on Cygwin”
  1. Adam DinwoodieAug 25, 2017
  2. Jeff KingAug 25, 2017
  3. Ramsay JonesAug 26, 2017
  4. Adam DinwoodieAug 26, 2017
  5. Jeff KingAug 26, 2017
  6. Adam DinwoodieAug 26, 2017
  7. Ramsay JonesAug 27, 2017
  8. Adam DinwoodieAug 27, 2017
  9. Ramsay JonesAug 27, 2017
  10. Jason PyeronAug 27, 2017
  11. Ramsay JonesSep 8, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.