zsh-workers
 help / color / mirror / code / Atom feed
* Quick way to lock up your shell
@ 2008-12-11 17:35 Bart Schaefer
  2008-12-11 17:52 ` Peter Stephenson
  2008-12-11 20:42 ` Dan Nelson
  0 siblings, 2 replies; 5+ messages in thread
From: Bart Schaefer @ 2008-12-11 17:35 UTC (permalink / raw)
  To: zsh-workers

schaefer<501> FOO==(cat)

The shell is now hung forever waiting for a "cat" that will never exit,
because cat's standard input is neither closed nor connected to anything
(expect to the parent zsh, which isn't writing to it).

This happens at least as far back as 4.2.0, so it's not a new problem.

Similar things can happen with <<(cat) except in that case the shell is
not locked up, it has a background job of whose status it loses track.
I haven't figured out exactly how to reproduce that one, but once it
gets that way even killing the job externally will leave zsh believing
that the job is still active (so e.g. "wait" hangs until interrupted).


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

* Re: Quick way to lock up your shell
  2008-12-11 17:35 Quick way to lock up your shell Bart Schaefer
@ 2008-12-11 17:52 ` Peter Stephenson
  2008-12-11 18:10   ` Richard Hartmann
  2008-12-11 20:42 ` Dan Nelson
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2008-12-11 17:52 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Bart Schaefer wrote:
> schaefer<501> FOO==(cat)
> 
> The shell is now hung forever waiting for a "cat" that will never exit,

Cats are like that.  The think to do is to shut the door in its face;
then it will immediately decide it wants to leave after all and start
scratching at the door.

Hope this helps.

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


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

* Re: Quick way to lock up your shell
  2008-12-11 17:52 ` Peter Stephenson
@ 2008-12-11 18:10   ` Richard Hartmann
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Hartmann @ 2008-12-11 18:10 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Bart Schaefer, zsh-workers

On Thu, Dec 11, 2008 at 18:52, Peter Stephenson <pws@csr.com> wrote:

> Cats are like that.  The think to do is to shut the door in its face;
> then it will immediately decide it wants to leave after all and start
> scratching at the door.

The main thing is to cover/hide/lock away everything that smells
nice. Dogs fear their owners, cats don't.
So in this case, fire up another shell and

  echo fish >! plate

or in the case of a cat I used to own (or did it own me?):

  echo anythingthatisnotrocksolid >! plate


Richard


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

* Re: Quick way to lock up your shell
  2008-12-11 17:35 Quick way to lock up your shell Bart Schaefer
  2008-12-11 17:52 ` Peter Stephenson
@ 2008-12-11 20:42 ` Dan Nelson
  2008-12-11 22:55   ` Richard Hartmann
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Nelson @ 2008-12-11 20:42 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

In the last episode (Dec 11), Bart Schaefer said:
> schaefer<501> FOO==(cat)
> 
> The shell is now hung forever waiting for a "cat" that will never
> exit, because cat's standard input is neither closed nor connected to
> anything (expect to the parent zsh, which isn't writing to it).
> 
> This happens at least as far back as 4.2.0, so it's not a new problem.

I can't reproduce this myself; the only thing redirected inside =()
should be stdout.  It won't hang on any of my systems.  Tested zsh
between 4.1.1 and 4.3.9, on AIX, FreeBSD, Linux, and Solaris.

$ zsh -f
dan% FOO==(cat)
[hit ^T here]
load: 3.00  cmd: cat 59991 [ttyin] 0.00u 0.02s 0% 156k
[hit ^D here]
dan% 

lsof run in another tty while cat was waiting showed:

cat     59991  dan    0u  VCHR        0,157  0t96493    157 /dev/ttypg
cat     59991  dan    1w  VREG        0,112        0     21 /tmp (/dev/md0)
cat     59991  dan    2u  VCHR        0,157  0t96493    157 /dev/ttypg


-- 
	Dan Nelson
	dnelson@allantgroup.com


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

* Re: Quick way to lock up your shell
  2008-12-11 20:42 ` Dan Nelson
@ 2008-12-11 22:55   ` Richard Hartmann
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Hartmann @ 2008-12-11 22:55 UTC (permalink / raw)
  To: Dan Nelson; +Cc: Bart Schaefer, zsh-workers

On Thu, Dec 11, 2008 at 21:42, Dan Nelson <dnelson@allantgroup.com> wrote:

> I can't reproduce this myself; the only thing redirected inside =()
> should be stdout.  It won't hang on any of my systems.  Tested zsh
> between 4.1.1 and 4.3.9, on AIX, FreeBSD, Linux, and Solaris.

A serious answer, how boring ;)

richih@adamantium ~ % zsh -f
adamantium% zsh --version
zsh 4.3.6 (i686-pc-linux-gnu)
adamantium% FOO==(cat) # ^T^D will not work, here
^T^C%
adamantium% FOO==(cat)
^C%
adamantium%


Richard


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

end of thread, other threads:[~2008-12-11 22:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-11 17:35 Quick way to lock up your shell Bart Schaefer
2008-12-11 17:52 ` Peter Stephenson
2008-12-11 18:10   ` Richard Hartmann
2008-12-11 20:42 ` Dan Nelson
2008-12-11 22:55   ` Richard Hartmann

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