From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16810 invoked by alias); 26 Mar 2011 02:10:40 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15901 Received: (qmail 10784 invoked from network); 26 Mar 2011 02:10:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110325191023.ZM31052@torch.brasslantern.com> Date: Fri, 25 Mar 2011 19:10:23 -0700 In-reply-to: <9cf85fb41e83cdaa17ad01277e478571.squirrel@gameframe.net> Comments: In reply to nix@myproxylists.com "Re: How to add string to end of each array element without loops" (Mar 26, 3:37am) References: <9861b13e6828d43041a5b489f016664a.squirrel@gameframe.net> <110325150350.ZM30913@torch.brasslantern.com> <9cf85fb41e83cdaa17ad01277e478571.squirrel@gameframe.net> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: How to add string to end of each array element without loops MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Mar 26, 3:37am, nix@myproxylists.com wrote: } } Now however, im getting a segfault when an array elements exceeds over } 4 million elements even there are enough RAM in my box. A segfault doing what, exactly? Perhaps run with: exec 2>/tmp/zsh$$trace setopt xtrace I can create and reference arrays of that size without a problem: schaefer<523> typeset -A a schaefer<524> a=({4000000..1} {1..4000000}) schaefer<525> echo $#a 4000000 schaefer<526> a=({5000000..1} {1..5000000}) schaefer<527> echo $#a 5000000 and then after noodling around a bit: schaefer<533> b=($a) schaefer<534> echo $#b 5000000 even if I guarantee there are multiple simultaneous copies of the array: schaefer<535> foo() { local -a c; c=($b); print $#c } schaefer<536> foo 5000000 so it's not something magic about 4 million. } Is there a way to increase this limit? There was nothing to that with } 'limit' command. The limit command (and ulimit) deal with OS-imposed limitations on the resource usage of a process. It's entirely possible that it's one of those that you're running up against, but difficult to guess which one without knowing what the shell was doing at the moment of failure. Generally speaking zsh doesn't impose any of its own restrictions except for function recursion depth and number of simultaneous monitored jobs (both of which are limited to 1000).