From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1746 invoked from network); 24 Nov 2008 17:33:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Nov 2008 17:33:08 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 1481 invoked from network); 24 Nov 2008 17:32:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Nov 2008 17:32:57 -0000 Received: (qmail 20410 invoked by alias); 24 Nov 2008 17:32:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26087 Received: (qmail 20396 invoked from network); 24 Nov 2008 17:32:48 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 24 Nov 2008 17:32:48 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [208.87.233.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id C4C3C80525B4 for ; Mon, 24 Nov 2008 18:32:44 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly04g.srv.mailcontrol.com (MailControl) with ESMTP id mAOHW27Z007579 for ; Mon, 24 Nov 2008 17:32:40 GMT Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Nov 2008 17:32:30 +0000 Date: Mon, 24 Nov 2008 17:32:30 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: D03 test hang on cygwin with latest sources Message-ID: <20081124173230.31422068@news01> In-Reply-To: <081120211244.ZM30106@torch.brasslantern.com> References: <20a807210811202008o34865319qe1840896992ac48d@mail.gmail.com> <081120211244.ZM30106@torch.brasslantern.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Nov 2008 17:32:30.0496 (UTC) FILETIME=[A095BA00:01C94E5A] X-Scanned-By: MailControl A_08_51_00 (www.mailcontrol.com) on 10.71.0.114 X-Virus-Scanned: ClamAV 0.92.1/8671/Mon Nov 24 16:06:17 2008 on bifrost X-Virus-Status: Clean On Thu, 20 Nov 2008 21:12:44 -0800 Bart Schaefer wrote: > On Nov 20, 11:08pm, Vin Shelton wrote: > } > } Peter - > } > } It looks like something bad happened with your process redirection > } changes. After building from the latest CVS sources, I ran the > } testsuite and got a hang in D03. A ZTST_verbose=2 trace follows. > } > } The last time I built the shell on this platform, 2008-10-12, this > } test passed. > > I'm not sure historical success means anything here, because there > previously was no test of >(...) except in the context of > >(...). Right, the behaviour isn't new. It seems as if the subprocess is reading EOF from the input. % foo() { print $1; print hello >$1; [[ -e $1 ]] || print Ouch! } % foo >(sleep 1; read foo || print Failed) /proc/self/fd/12 Failed I don't understand why it would do that, given the order in which things apparently happen (there's roughly a second gap between the messages, as you'd expect). Waiting the other way round, I get % foo() { print $1; (sleep 1; print hello) >$1; [[ -e $1 ]] || print Ouch! } % foo >(read foo || print Failed) /proc/self/fd/12 foo: write error: bad file descriptor Failed I printed $ERRNO and it's zero. Note that the read in the subprocess only fails *after* the attempt to write fails. It's also not clear to me why this is so different from "print hello | read foo", which works, except to note that pipes in this case exchange a sync word. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070