From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: gawk 3.1.1: bug in stdout redirection on WinNT 4.0 Date: Mon, 12 May 2003 10:23:15 CDT Organization: Rice University, Houston, TX Lines: 22 Message-ID: <3ebfbc63.sandmann@clio.rice.edu> References: <3EB7C0D6 DOT 7030206 AT lml DOT ls DOT fi DOT upm DOT es> <9003-Tue06May2003200634+0300-eliz AT elta DOT co DOT il> <3EB8F9A6 DOT 4050307 AT lml DOT ls DOT fi DOT upm DOT es> <2427-Wed07May2003165629+0300-eliz AT elta DOT co DOT il> <3EBA4A19 DOT 9090902 AT lml DOT ls DOT fi DOT upm DOT es> <7458-Thu08May2003190131+0300-eliz AT elta DOT co DOT il> <3EBF8E05 DOT 3050102 AT lml DOT ls DOT fi DOT upm DOT es> NNTP-Posting-Host: clio.rice.edu X-Trace: joe.rice.edu 1052754541 3116 128.42.105.3 (12 May 2003 15:49:01 GMT) X-Complaints-To: abuse AT rice DOT edu NNTP-Posting-Date: Mon, 12 May 2003 15:49:01 +0000 (UTC) X-NewsEditor: ED-1.5.9 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > The following minimal program reproduces the bug: Confirmed on Win2K SP3 using V2.03 refresh Bug does *NOT* happen on V2.04 alpha in my testing So there is some fix I didn't back port properly into the refresh (sigh) > Using bash as a shell lets the program behaves correctly. Apparently > there is an obscure flaw in NT output redirection, that is uncovered by > the complex code of fstat in some circumstances. The bug has been discussed in detail on the DJGPP worker's list, about 18 months ago when we started fixing Windows 2000 incompatibilities. It is very difficult to determine if a pre-opened handle is a file or not, and doing seeks on them quite often breaks things (fstat seeks to find the size). > I'll try to repeat the test with the new djgpp v2.04 alpha version, if I > can find some spare time (no promises). Your excellent diagnosis and minimal program helped a lot, thanks. I think we have this fixed, but it wouldn't hurt to try it yourself.