zsh-workers
 help / color / mirror / code / Atom feed
* Multio / process substitution bug
@ 2011-05-18 14:43 Bart Schaefer
  2011-06-29 15:08 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2011-05-18 14:43 UTC (permalink / raw)
  To: zsh-workers

Given the following which you probably recognize from zsh-users:

alias -g file_err='>(sed s/^/file_err:/)'
alias -g file_out='>(sed s/^/file_out:/)'
alias -g file_mix='>(sed s/^/file_mix:/)'
outanderr() { print STDOUT; print -u2 STDERR }

The following command:

torch% outanderr 1>&1 >file_out 2>&2 2>file_err >& file_mix
STDOUT
file_out:STDOUT
STDERR
file_err:STDERR

is now hung forever waiting in signal_suspend() for the file_mix process
to exit.  Keyboard signals are disabled so the only way to interrupt it
is to kill it from another shell.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Multio / process substitution bug
  2011-05-18 14:43 Multio / process substitution bug Bart Schaefer
@ 2011-06-29 15:08 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2011-06-29 15:08 UTC (permalink / raw)
  To: zsh-workers

So I did a little more investigation on this ...

On Wed, May 18, 2011 at 7:43 AM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> Given the following which you probably recognize from zsh-users:
>
> alias -g file_err='>(sed s/^/file_err:/)'
> alias -g file_out='>(sed s/^/file_out:/)'
> alias -g file_mix='>(sed s/^/file_mix:/)'
> outanderr() { print STDOUT; print -u2 STDERR }
>
> The following command:
>
> torch% outanderr 1>&1 >file_out 2>&2 2>file_err >& file_mix
> STDOUT
> file_out:STDOUT
> STDERR
> file_err:STDERR
>
> is now hung forever waiting in signal_suspend() for the file_mix process
> to exit.  Keyboard signals are disabled so the only way to interrupt it
> is to kill it from another shell.
>

Turns out everything is hung because the multio pseudo-"cat" loops
(forked in exec.c:closemn()) still have any previous such loops'
standard input open, so none of them are seeing end-of-file in order
to exit.

This is in spite of the fact that the last thing closemn() does before
it begins looping is to call closeallelse().  I haven't figured out
why that fails to close the descriptors opened for other multios, but
that's the root of the problem.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-29 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 14:43 Multio / process substitution bug Bart Schaefer
2011-06-29 15:08 ` Bart Schaefer

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).