zsh-workers
 help / color / mirror / code / Atom feed
* Re: bug with for and |&
@ 2000-12-19 13:48 Sven Wischnowsky
  2000-12-22  7:01 ` Andrej Borsenkow
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 2000-12-19 13:48 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> The problem is general to cases where a current-shell construct on the left
> of the pipeline contains an external command.  It doesn't matter what's on
> the right of the pipeline.  The code on the left seems to be executing all
> right.
> 
> % exec 3>&2
> % { ls; print Finished >&3 } |& cat
> Finished
> 
> and it hangs in zwaitjobs, waiting for the job to finish, which it never
> does.  Change `ls' to `print foo' and the problem goes away.

Rats. I still can't reproduce it, neither with (on Linux), nor without 
(on DU) the patch. So I guess there must be some kind of race
condition somewhere...


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* RE: bug with for and |&
  2000-12-19 13:48 bug with for and |& Sven Wischnowsky
@ 2000-12-22  7:01 ` Andrej Borsenkow
  0 siblings, 0 replies; 4+ messages in thread
From: Andrej Borsenkow @ 2000-12-22  7:01 UTC (permalink / raw)
  To: zsh-workers

>
> Peter Stephenson wrote:
>
> > The problem is general to cases where a current-shell construct
> on the left
> > of the pipeline contains an external command.  It doesn't matter what's on
> > the right of the pipeline.  The code on the left seems to be executing all
> > right.
> >
> > % exec 3>&2
> > % { ls; print Finished >&3 } |& cat
> > Finished
> >
> > and it hangs in zwaitjobs, waiting for the job to finish, which it never
> > does.  Change `ls' to `print foo' and the problem goes away.
>
> Rats. I still can't reproduce it, neither with (on Linux), nor without
> (on DU) the patch. So I guess there must be some kind of race
> condition somewhere...
>


Sorry for "me too", but neither do I. It works here all right. It may well be
some uninitialized variable.

-andrej


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

* Re: bug with for and |&
  2000-12-19 10:33 ` Peter Stephenson
@ 2000-12-19 12:36   ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2000-12-19 12:36 UTC (permalink / raw)
  To: Zsh hackers list

The problem is general to cases where a current-shell construct on the left
of the pipeline contains an external command.  It doesn't matter what's on
the right of the pipeline.  The code on the left seems to be executing all
right.

% exec 3>&2
% { ls; print Finished >&3 } |& cat
Finished

and it hangs in zwaitjobs, waiting for the job to finish, which it never
does.  Change `ls' to `print foo' and the problem goes away.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* Re: bug with for and |&
       [not found] <1001218181948.ZM20470@candle.brasslantern.com>
@ 2000-12-19 10:33 ` Peter Stephenson
  2000-12-19 12:36   ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2000-12-19 10:33 UTC (permalink / raw)
  To: Zsh hackers list

> On Dec 18,  2:22pm, Akim Demaille wrote:
> }
> } /tmp % for i in 1 2
> } do                 
> } ls                   
> } done |& tee /tmp/foof
> } # I have to C-c C-c to stop it.
> } # s/|&/|/ makes it work properly.
> 
> For what it's worth, I'm *not* able to reproduce this here.
> 
> The difference may be that I have Sven's patch from zsh-workers/13247 applied

That doesn't make any difference to me.  The extra `&' is certainly the
problem.  You can work around it by sticking 2>&1 after the ls; 2>&1 after
the `done' has the same effect as the original.  There's problem some
difficulty with the logic in execcmd().

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

end of thread, other threads:[~2000-12-22  7:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-19 13:48 bug with for and |& Sven Wischnowsky
2000-12-22  7:01 ` Andrej Borsenkow
     [not found] <1001218181948.ZM20470@candle.brasslantern.com>
2000-12-19 10:33 ` Peter Stephenson
2000-12-19 12:36   ` Peter Stephenson

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