This is the mail archive of the cygwin 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]
Other format: [Raw text]

RE: Bash is very, very stable (was: Bash returns incorrect process status)

Ronald Landheer-Cieslak wrote:
> Dolton Tony AB wrote:
> > I've noticed that bash doesn't get issued too often.
> It doesn't for three reasons:
> 1. the maintainer for Cygwin (that would be me) is very busy

Oooh!  Did you really mean to put your head above the parapet like

> 2. The current version of Bash is very, very stable

Now that's just silly!  You're just tempting fate... ;-)

I have a problem with the cygwin port of bash which may be related to
the other reported problems with child processes.

Scenario, I often do something like this:

for i in *.c;do echo '***' $i '***';some-non-builtin-command;done|less

This works fine on Linux and various Unices, producing output like

*** file1.c ***
output for file1.c
*** file2.c ***
output for file2.c
*** file3.c ***
output for file3.c


Under cygwin, this breaks down.  The output from echo is not correctly
interleaved with the output of the external command, producing
something like this:

*** file1.c ***
output for file1.c
*** file2.c ***
*** file3.c ***
output for file2.c
output for file3.c

AFAICT, the bunched builtin output always precedes the bunched
external output.  This suggests that either:
a) output from external commands is buffered whereas the output of
builtin commands is not. 
b) the external commands are run asynchronously as background tasks.

This only appears to be a problem if the output of the for-loop is a
pipe, but it may just be that piping the output increases the
likelihood of the problem occurring.

I can usually work around this by substituting /bin/echo for the
builtin echo - this works, but it's noticeably slower.

Although I've attached cygcheck output, the problem has been around
for several versions of cygwin/bash and it manifests itself on NT4.0,
W2K and (I think) Win98, so I don't suppose it'll cast any light on
the problem.

To head off any "PTC" type responses, I've no Windows environment on
my home PCs at the moment, and my boss wouldn't take kindly to me
working on cygwin.  However, I'll gladly test any fixes if you need

Now, repeat after me...

  I, Ronald Landheer-Cieslak,
  will never claim in public
  that a program I maintain
  is "very, very stable"
  (even if it is).

Sorry if I spoiled your day ;-)

Phil Betts


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

Attachment: cygcheck.txt
Description: cygcheck.txt

Unsubscribe info:
Problem reports:

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