This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: 1.3.2, 1.1.8: Pipelines losing data? (Windows 2000) (fwd)



I wrote into the mailing list a while back.  Basically, doing a :
less <file> | grep word
Was failing intermittantly under cygwin in Windows 2000. I recieved the
following message, and as I no longer have access to the computers which
were suffering from the problem, I've forwarded this message to the list,
in case anyone has a solution.

(The original thread should be in the July archives, and the url to the
problem file should still be valid.)

-Rusty

---------- Forwarded message ----------
Date: Fri, 7 Sep 2001 11:19:50 -0500 (CDT)
From: D.J. Miller II <jamesm@realtime.net>
Reply-To: jamesm@bga.com
To: sears@cis.ohio-state.edu
Subject: RE: 1.3.2, 1.1.8: Pipelines losing data? (Windows 2000)

Hi, Russell,

I found the following post from you in the cygwin mailing list archive
(http://sources.redhat.com/ml/cygwin/2001-07/threads.html#00028):
> To: "Sheldon, Ken" <ksheldon at context dot com>
> Subject: RE: 1.3.2, 1.1.8: Pipelines losing data? (Windows 2000)
> From: russell christian sears <sears at cis dot ohio-state dot edu>
> Date: Wed, 11 Jul 2001 10:42:45 -0400 (EDT)
> cc: <cygwin at cygwin dot com>
>
> Sorry about the long response time.
>
> I'm not trying to use grep as a pager, instead, I'm using it like cat.
> (If it sees that it's writing to a pipe instead of a terminal, it behaves
> like cat.)  I'm concerned that the cygwin libraries are somehow mangling
> the pipe.  I've only been able to reproduce it on systems with an almost
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> identical configuration to mine, (Dell Dimension 4100, Windows 2000
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Professional) but I am worried that it could affect other users, and
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> result in mangled or incorrect output.
[...]
> > -----Original Message-----
> > From: russell christian sears [mailto:sears@cis.ohio-state.edu]
> > Sent: Monday, July 02, 2001 8:21 AM
[...]
> > When I run the command `less file.txt | grep cygwin` it sometimes fails to
> > find a match in the file, even though the file does contain the string.
> >
> > It seems to be sporadic, but I have been able to reproduce the problem on
> > three machines, each of which ran at about 700mhz.  Other commands that
[...]
> > Also, the string "cygwin" always appears at the end of a line in the file,
> > which may be related to this bug.
> >
> > I have tried both version 1.1.8 and the current cygwin distribution.
> > (1.3.2)  Both seem to suffer from this problem.
> >
> > As a control, I've checked this against a Linux system, and the bug did
> > not exist there.

Well, hello from one of those other users!

I'm running cygwin 1.3.2 on Windows 2000 ("WinNT Ver 5.0 build 2195
Service Pack 1") on a Dell Dimension 4100 with a ~1 GHz pentium ("x86
Family 6 Model 8 Stepping 10 GenuineIntel ~1000 Mhz") and am seeing a
problem similar to yours with pipes.  In particular, when I run the
following one-line sh script at the bash prompt (I've put line breaks in
it here in this message for readability) I get really erratic results:

  find . -type f -print |
      while read f; do
          echo $f | grep CVS > /dev/null;
          if [ $? -ne 0 ]; then
              echo $f;
          fi;
      done

(In other words, the one liner is supposed to recurse from the current
working directory all the way down and print out only filenames which do
not contain "CVS" in their names or in the names of any of their parent
directories.)

There are two interesting feature about the results of the above
script.  First is that the results change from run to run; in other
words there's a race condition in there somewhere.  Second is that it
appears that "extra" data is appearing on the pipe, or perhaps "old
data" at a "new time."

If I replace the pipe between ``echo $f'' and ``grep CVS...'' with a
temporary file then the problem disappears:

  find . -type f -print |
      while read f; do
          echo $f > ~/tmp/filename
          grep CVS filename > /dev/null;
          if [ $? -ne 0 ]; then
              echo $f;
          fi;
      done

Have you gotten any more information from any cygwin folks about this
"pipelines losing data" problem?  If not, feel free to forward this
message to them.
____________________________________________________________

               James Miller in Austin, Texas

       Internet:   jamesm@bga.com       (198.3.118.20)
      alternate:   jamesm@wixer.bga.com (198.3.118.3)

____________________________________________________________


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]