From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: D03 test hang on cygwin with latest sources
Date: Mon, 24 Nov 2008 17:32:30 +0000 [thread overview]
Message-ID: <20081124173230.31422068@news01> (raw)
In-Reply-To: <081120211244.ZM30106@torch.brasslantern.com>
On Thu, 20 Nov 2008 21:12:44 -0800
Bart Schaefer <schaefer@brasslantern.com> 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 <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
next prev parent reply other threads:[~2008-11-24 17:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-21 4:08 Vin Shelton
2008-11-21 5:12 ` Bart Schaefer
2008-11-24 17:32 ` Peter Stephenson [this message]
2008-11-24 22:31 ` Phil Pennock
2008-11-25 9:56 ` Peter Stephenson
2008-11-25 23:26 ` Peter A. Castro
2008-12-01 12:20 ` Peter Stephenson
2008-12-02 3:42 ` Peter A. Castro
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=20081124173230.31422068@news01 \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.dk \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).