World's shortest csh core dump + zsh `bug'

World's shortest csh core dump + zsh `bug'

Post by Paul Makepea » Sun, 21 Mar 1993 02:41:25



Here is the (distillation) of a friend's .zshrc file that went horribly amiss:

alias l='/bin/ls -F'
l () { /bin/ls -als $* | more }

Hence typing `l' at the prompt gives this nightmare:

penguin.25> alias l='/bin/ls -F'                                       ~ 5:19pm
penguin.26> l () { /bin/ls -als $* | more }                            ~ 5:19pm
penguin.27> l
( scary pause... )                                                     ~ 5:19pm
zsh: fork failed: no more processes    # Oh shi...
zsh: fork failed: no more processes
.
.                                       # load meter - Ping!
.

penguin.28> uptime                                                     ~ 5:19pm
  5:39pm  up 32 days,  3:50,  3 users,  load average: 3.57, 1.04, 0.42
                                                      ^^^^
                              (This is _tame_, it hits even more on bigger machines)

A  `ps' in another window revealed *lots* of zsh's.

This came about after my friend used my original .zshrc and then adapted a
few extra from his .cshrc, without paying too much attention to what was there
previously.

I know the obvious alias/function definition is a bit daft when presented as is, but nested
as it was (through three other aliases related to `ls'), hidden in a startup file, it's more
understandable that this might happen.

It would be nice to get a warning (like csh's alias loop) before the machine gets crippled...
(On a large machine that could cope with huge numbers of processes, this cause the
xmeter to level at a steady altitude of about 15 (ow!) before finally giving up.)

--- End of zsh (otherwise superb and thoroughly recommended!) gripe  ---

Can you get a quicker core dump ? (sorry, no alias cor='kill -6  -1' ! )

host% csh
(annoying csh startup; rehash, rehash, rehash...)
host% !#:h
segmentation fault (core dumped)

*giggle!*

--
Paul Makepeace  INMOS Ltd, Bristol, U.K. | EMail(UK) ukc!inmos!paulm


PS My zsh is 2.3.1, maybe 2.4's OK -- ? Please put me on the mailing list someone! Thanx.