public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* expect - broken pipe
@ 2016-01-20 12:57 Jon Beniston
  0 siblings, 0 replies; only message in thread
From: Jon Beniston @ 2016-01-20 12:57 UTC (permalink / raw)
  To: cygwin

Hi,

I'm trying to run the GCC DejaGNU testsuite on 32-bit Cygwin. It randomly
fails with the message:

"parent: sync byte write: broken pipe"

This occurs frequently if the testsuite is run in parallel (i.e. make -j4),
but occasionally when not in parallel too.

It seems this error message is generated by the 'expect' program,
specifically from exp_command.c. This does roughly the following:

pipe(sync_fds);
pipe(sync2_fds);
.
pid = fork();
if (pid) { /* parent */
    close(sync_fds[1]);
    close(sync2_fds[0]);

    /* wait for slave to initialize */
    while (((rc = read(sync_fds[0],&sync_byte,1)) < 0) && (errno == EINTR))
{
        /* empty */;
    }
   ...
   /* tell slave to go on */
    wc = write(sync2_fds[1]," ",1);
    if (wc == -1) {
       expErrorLog("parent: sync byte write: %s\r\n",Tcl_ErrnoMsg(errno));
    }

So, the write to the pipe is failing randomly with errno==EPIPE. Any idea
why this might be?

What is strange, is if I remove the call to close(sync2_fds[0]), then the
write never fails. Closing the unused end of the pipe seems fairly standard
behaviour as that is what is given as an example in the pipe() man page.

Cheers,
Jon


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-20 11:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20 12:57 expect - broken pipe Jon Beniston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).