public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Jon Beniston" <jon@beniston.com>
To: <cygwin@cygwin.com>
Subject: expect - broken pipe
Date: Wed, 20 Jan 2016 12:57:00 -0000	[thread overview]
Message-ID: <000c01d15378$52e56000$f8b02000$@beniston.com> (raw)

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

                 reply	other threads:[~2016-01-20 11:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000c01d15378$52e56000$f8b02000$@beniston.com' \
    --to=jon@beniston.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).