delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/04/02/11:35:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.1.0.14.2.20020402082214.024e3360@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Tue, 02 Apr 2002 08:33:38 -0800
To: "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com>,
Stuart Brady <sbrady AT ntlworld DOT com>, Cygwin <cygwin AT cygwin DOT com>
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: Bash bug? - piped loops using builtin echo and stdout
In-Reply-To: <4.3.1.2.20020402110914.02666ee8@pop.ma.ultranet.com>
References: <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20020402074837 DOT 02a020e8 AT pop3 DOT cris DOT com>
<Pine DOT LNX DOT 4 DOT 44 DOT 0204021320320 DOT 1603-100000 AT calypso DOT arrow>
Mime-Version: 1.0

Larry, Stuart,

I did not look closely enough at the output when I ran my test. I was 
expecting some more dramatic failure, I guess.

I do _not_ see proper alternation of "foo" and "bar."

The transpositions occur in iterations

33
45
51
54
64
69
74
79
83
98
105
110
114
122
140
147
154
163
174
190
203
208
214
217
...

I don't see a pattern, so I suppose some sort of race condition is 
suggested. Perhaps the wait(2) system call used by the shell after the fork 
for the built-in echo is not really waiting. (BASH should fork for that 
command, right?)

Strace might give useful information or it might perturb things to the 
point the symptom is no longer seen.

Randall Schulz
Mountain View, CA USA


At 08:14 2002-04-02, Larry Hall (RFK Partners, Inc) wrote:
>I can reproduce Stuart's problem on W2K.  I'm on a uni-processor machine. 
>I've only tried it interactively.  Removing the pipe from the process 
>makes "foo" and "bar" alternate as expected.  With the pipe the resultis:
>
>  >while( true ); do echo foo; /bin/echo bar; done | cat
>...
>.
>.
>.
>
>This is with Cygwin 1.3.10.  Just as an alternate data point to avoid too
>much emphasis on Stuart's configuration.
>
>Larry Hall


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

- Raw text -


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