Subject: Re: B20: hang on pipe to grep
From: [email-masked] (Gary V. Vaughan)

21 Nov 1998 03:34:16 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Geoffrey Noer <[email-masked]>
Cc: [email-masked]

Geoffrey Noer wrote:
> 
> On Tue, Nov 17, 1998 at 12:52:07PM -0600, Stephen L. Favor wrote:
> >
> > The following causes B20 to hang on my WINNT box.  It may run for a
> > while before hanging:
> >
> > % while true; do echo $PATH | grep bin; done
> 
> Yes, this is the major showstopper bug in b20.  It will be fixed in
> the upcoming b20.1 update release.  Current status is that we know
> what the problem is and are working on implementing the solution.

This may be related... if not I could try to make a test case.

I have an application which used to compile and work perfectly under
b19.  I have upgraded to b20, and made all my mounts text!=binary, but
also been careful to use O_BINARY for all the files, descriptors and
pipes that are opened.  I also have CYGWIN='  tty binmode' in the
environment before I launch the shell.

The problem is that the app creates a pair of pipes and then forks, the
child process sets stdin and stdout each to an end of one of the pipes
before execing /bin/sh.  Under b19 the parent could write shell commands
to its end of one pipe, and read the results from the other pipe.   The
shell seems to hang, leaving the parent to timeout (15 seconds later),
fork and exec again and retry in an infinite loop.

Actually there is a bit more going on than this, but the bottom line is
that it *did* work under b19 and aside from my no longer using binary
mounts, and opening the pipes with O_BINARY, the only significant change
is the upgrade to b20.  I noticed this problem without O_BINARY pipes
and had thought that adding that option might fix it, so it has been
tested (and fails) in both modes.

Is there a way to get gdb to follow the child after a fork()?  I could
probably debug things myself if there were... I always seem to remain in
the parent process and the child tears away at full speed...

Is that enough info to give me a pointer to might might be going on, or
do I need to strip down the app as a test case?

Cheers and TIA,
	Gary V. Vaughan
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".