X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:date:message-id:mime-version
	:content-type:content-transfer-encoding; q=dns; s=default; b=kQ6
	FqI3VSTS5SLEkFYrr8TBHcPl4Pemm3zT/UrrK7KihJdzYLnGDiKYyBeDn+xVZy+7
	yOF68qWEs+S9L7JRJYaTXbpg5kBkXv0mG9Lbm/SyGYJttjMNTCHOdksPSyNimGBS
	DpxbR6JRmA9giYsfnNsJmGJMunVhp+sqmnqHGFDg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:date:message-id:mime-version
	:content-type:content-transfer-encoding; s=default; bh=LvfK15409
	e9bwlXSSBlMRxoF4tQ=; b=GGpgPGF7D0wEUiSVmFauD8qMe9UaPbB+KMXj9KyWz
	t/rrcN+i/FiajsIZUos3MWO3vMOUeM6IuTMcfvW9TlSTmoIclWTn2R1GfAdLtB5P
	TTQHQ8Ao4Pf56uD4bbAlH+HZJqfUi0tvfXHuOQt1Jzg0rZZqUWncINX8ScBRGp7O
	mo=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.2 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=H*RU:sk:smtprel, Hx-spam-relays-external:sk:smtprel, HX-HELO:sk:smtprel, H*r:sk:smtprel
X-HELO: smtprelay.hostedemail.com
X-Session-Marker: 6A62656E6973746F6E40756B322E6E6574
X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,jon@beniston.com,:,RULES_HIT:10:41:355:379:541:542:960:968:973:988:989:1155:1260:1277:1311:1313:1314:1345:1381:1437:1515:1516:1518:1534:1541:1587:1593:1594:1711:1730:1747:1777:1792:2110:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3865:3866:3867:3870:3871:3872:3874:4184:4605:5007:6117:6119:7903:8660:8957:10004:10400:10848:11658:11914:12043:12296:12517:12519:12663:13069:13071:13095:13148:13230:13311:13357:14093:14097:21060:21080:21094:30054,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none
X-HE-Tag: crown41_3fb871d06704f
X-Filterd-Recvd-Size: 1864
From: "Jon Beniston" <jon@beniston.com>
To: <cygwin@cygwin.com>
Subject: expect - broken pipe
Date: Wed, 20 Jan 2016 11:47:20 -0000
Message-ID: <000c01d15378$52e56000$f8b02000$@beniston.com>
MIME-Version: 1.0
Content-Type: text/plain;	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

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

