From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.6/8.7.3) with ESMTP id NAA09580 for ; Wed, 20 Nov 1996 13:01:21 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id UAA19481; Tue, 19 Nov 1996 20:45:30 -0500 (EST) Resent-Date: Tue, 19 Nov 1996 20:45:30 -0500 (EST) From: Zoltan Hidvegi Message-Id: <199611200141.CAA00871@hzoli.ppp.cs.elte.hu> Subject: Re: local variable setting problem/bug To: rft@cg.tuwien.ac.at Date: Wed, 20 Nov 1996 02:41:57 +0100 (MET) Cc: zsh-workers@math.gatech.edu In-Reply-To: <9611192131.AA25535@raven.cg.tuwien.ac.at> from Robert F Tobler at "Nov 19, 96 10:31:39 pm" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"l944v2.0.Gm4.vAcao"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2434 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > But even worse than that, try the following function: > > bug() > { > local a=() > local b > local c > } > > On Nextstep 3.3 running zsh 3.00 or zsh 3.01 (with -f option) I get: > zsh: 24224 segmentation fault zsh -f > > On Linux 1.3.52 running zsh 2.6-beta13 I get (after a while): > zsh: fatal error: out of memory > > And on Irix 5.2 running zsh 3.00 it also consumes memory and > won't terminate normally. That's not surprising since local a=() in fact defined a function local and a function a= which executed local b. So the function called local recursively calls itself and there is not exit from this recursion. You probably wanted to use it as bug() { local a a=() ... } You cannot initialise local variables with an array at declaration. You must use a separate assignment for that. Zoltan