[net.bugs.4bsd] Bug with two pipes to a process

whm@arizona.UUCP (06/06/83)

I ran into a strange problem with a system that I did this last
semester.  The system provided rudimentary history and
programabilty for an "arbitrary" program that had a command
language of some type.  The basic idea was to have a master program
that would read the user's input and pass it to a slave program
and then pass the output of the slave program back to the user.
To do this, I needed to "see" all input and output for the program
being run by the master program.  I did this by opening a pair of
pipes to the slave program from the master program, one for
standard input and one for standard output.  

For most programs, this crude scheme worked out without any problems.
However, for some programs that produced a line of output that was
not newline terminated, the data on the "last" line would never appear.
Two programs in point are ucbmail and ex.  I tried opening just a
read pipe to the various programs in question, and there were no
problems; all the data written by the program could be read through
the pipe.  The problem only occurred when a write pipe was also
open to the program.  All streams were unbuffered.  BTW-This was
on 4.1bsd.

I've since decided to use a more sophisticated IPC mechanism, such
as mpx files or the new Berkeley IPC stuff, but I'm still curious
about the bug.  Anybody have any ideas?

					Bill Mitchell