zsh-workers
 help / color / mirror / code / Atom feed
* Shell exits on bad coproc redirection
@ 2001-08-17 15:42 Bart Schaefer
  2001-08-17 16:05 ` Peter Stephenson
  2001-08-23  1:34 ` Geoff Wing
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Schaefer @ 2001-08-17 15:42 UTC (permalink / raw)
  To: zsh-workers

This affects 3.0.8 and 4.0.1 as well as 4.1.0-dev-1, but NOT 3.0.6.

schaefer[503] Src/zsh -f
zagzig% echo $ZSH_VERSION
4.1.0-dev-1
zagzig% print >&p
zsh: coprocess: bad file descriptor
zagzig% coproc sleep 1
[1] 14033
zagzig% 
[1]  + done       sleep 1
zagzig% print >&p
schaefer[504] echo $?
141

So the shell is dying of a SIGPIPE.

The problem seems to be a combination of these two items (ChangeLog-3.1):

1999-10-10  Bart Schaefer  <schaefer@zsh.org>

        * Src/exec.c: Plug lead of a copy of the coproc input descriptor.

(ahem, that should say "leak").

Sun May 18 18:57:08 1997  Zolt<E1>n Hidv<E9>gi  <hzoli@cs.elte.hu>

        * Src/builtin.c, Src/exec.c, Src/init.c, Src/signals.c, Src/jobs.c:
          Do not handle SIGPIPE specially for shells with job control

Anybody remember why we stopped handling SIGPIPE?  Is Zoltan still out there
anywhere?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Shell exits on bad coproc redirection
  2001-08-17 15:42 Shell exits on bad coproc redirection Bart Schaefer
@ 2001-08-17 16:05 ` Peter Stephenson
  2001-08-17 16:34   ` Bart Schaefer
  2001-08-23  1:34 ` Geoff Wing
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2001-08-17 16:05 UTC (permalink / raw)
  To: Zsh hackers list

Bart Schaefer wrote:
> The problem seems to be a combination of these two items (ChangeLog-3.1):
> 
> 1999-10-10  Bart Schaefer  <schaefer@zsh.org>
> 
>         * Src/exec.c: Plug lead of a copy of the coproc input descriptor.
> 
> (ahem, that should say "leak").
> 
> Sun May 18 18:57:08 1997  Zolt<E1>n Hidv<E9>gi  <hzoli@cs.elte.hu>
> 
>         * Src/builtin.c, Src/exec.c, Src/init.c, Src/signals.c, Src/jobs.c:
>           Do not handle SIGPIPE specially for shells with job control
> 
> Anybody remember why we stopped handling SIGPIPE?  Is Zoltan still out there
> anywhere?

Presumably that's the root of the near-discussion we had just before the
last release:

>> There's the SIGPIPE issue from 12223 (only partly fixed by 12222?).
>
> I haven't thought about this since, but after jogging my memory by reading
> 12223, 12222 is good enough for the real problem, and the rest was just my
> paranoia.  The issue was that if a `tee' spawned by a multio exits early,
> the parent shell will get SIGPIPE and exit, too; but that's probably not a
> bug.

Multios and coprocs are pretty similar in this respect.  I'm not
particularly attached to `probably not a bug'; I would probably trade it in
for `seems to reflect the current intention of the code' in return for a go
on your playstation.

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


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: Shell exits on bad coproc redirection
  2001-08-17 16:05 ` Peter Stephenson
@ 2001-08-17 16:34   ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2001-08-17 16:34 UTC (permalink / raw)
  To: Peter Stephenson, Zsh hackers list

On Aug 17,  5:05pm, Peter Stephenson wrote:
} Subject: Re: Shell exits on bad coproc redirection
}
} > Sun May 18 18:57:08 1997  Zoltan Hidvegi  <hzoli@cs.elte.hu>
} > 
} >           Do not handle SIGPIPE specially for shells with job control
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[">" now quotes something different]
} > paranoia.  The issue was that if a `tee' spawned by a multio exits early,
} > the parent shell will get SIGPIPE and exit, too; but that's probably not a
} > bug.
} 
} Multios and coprocs are pretty similar in this respect.  I'm not
} particularly attached to `probably not a bug'; I would probably trade it in
} for `seems to reflect the current intention of the code' in return for a go
} on your playstation.

If we were talking about a shell script, I'd be completely in agreement.
But Zoltan's log entry is talking about shells with job control.  Why
should an interactive shell ever exit on SIGPIPE?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Shell exits on bad coproc redirection
  2001-08-17 15:42 Shell exits on bad coproc redirection Bart Schaefer
  2001-08-17 16:05 ` Peter Stephenson
@ 2001-08-23  1:34 ` Geoff Wing
  1 sibling, 0 replies; 4+ messages in thread
From: Geoff Wing @ 2001-08-23  1:34 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer <schaefer@brasslantern.com> typed:
: This affects 3.0.8 and 4.0.1 as well as 4.1.0-dev-1, but NOT 3.0.6.
[...]
: So the shell is dying of a SIGPIPE.
: Sun May 18 18:57:08 1997  Zolt<E1>n Hidv<E9>gi  <hzoli@cs.elte.hu>
:         * Src/builtin.c, Src/exec.c, Src/init.c, Src/signals.c, Src/jobs.c:
:           Do not handle SIGPIPE specially for shells with job control
: Anybody remember why we stopped handling SIGPIPE?  Is Zoltan still out there
: anywhere?

http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=3157


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

end of thread, other threads:[~2001-08-23  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-17 15:42 Shell exits on bad coproc redirection Bart Schaefer
2001-08-17 16:05 ` Peter Stephenson
2001-08-17 16:34   ` Bart Schaefer
2001-08-23  1:34 ` Geoff Wing

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