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 GAA05607 for ; Thu, 14 Nov 1996 06:57:37 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA08978; Wed, 13 Nov 1996 14:53:46 -0500 (EST) Resent-Date: Wed, 13 Nov 1996 14:53:46 -0500 (EST) From: "Bart Schaefer" Message-Id: <961113103844.ZM29420@candle.brasslantern.com> Date: Wed, 13 Nov 1996 10:38:44 -0800 In-Reply-To: Ray Jones "more problems w/ irix" (Nov 13, 10:23am) References: <9611131723.AA14148@dbank> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.820 20aug96) To: Ray Jones , zsh-workers@math.gatech.edu Subject: Re: more problems w/ irix MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"vk5lF.0.CC2.ATYYo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2399 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Nov 13, 10:23am, Ray Jones wrote: } Subject: more problems w/ irix } } to test it further and see how it responds when given more files than } OPEN_MAX, i tried the "cat < * > /dev/null" in a directory w/ about } 4000 files (OPEN_MAX is 2500). now i'm getting a crash in halloc(), } or (if i turn enable zsh_mem) malloc(). Different bug, I suspect. Note that "cat < *" is the same as writing "cat < file1 < file2 < file3 < file4 ..." and is in fact converted by xpandredir() [glob.c] to exactly the same syntax tree that you'd get if you typed out all the redirections explicitly. Later on, in execcmd() [exec.c], when the redirections are processed, there is no check done to be sure that there are not more redirections attempted than the current value of OPEN_MAX (fdtable_size after PWS's patch). There *is* a test for whether open() returns failure, but then in addfd() zsh pretty much ignores failures of dup() via movefd(); and addfd() is itself void, so execcmd() has no chance. It ould be the case that IRIX doesn't obey its own limits on number of open files -- if open() or dup() continues to succeed even after the soft limit on number of files is reached, zsh happily continues adding fds beyond the end of fdtable[], scribbling on random heap. You should try compiling with --enable-zsh-debug and watch for Peter's "fdtable too small" warnings. I bet you'll get them. If you do get them, then the fdtable *does* need to grow dynamically as fds are added to it; it can't be preallocated at the time limits are examined. But we don't know that for sure yet. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern