From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26982 invoked from network); 19 Oct 2001 16:41:30 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Oct 2001 16:41:30 -0000 Received: (qmail 3798 invoked by alias); 19 Oct 2001 16:41:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16086 Received: (qmail 3772 invoked from network); 19 Oct 2001 16:41:23 -0000 From: Bart Schaefer Message-Id: <1011019164041.ZM8348@candle.brasslantern.com> Date: Fri, 19 Oct 2001 16:40:41 +0000 In-Reply-To: <200110182344.TAA12655@sassy.aa.ops.us.uu.net> Comments: In reply to Matthew Braun "unlimited file descripters causes problems for zsh-4.0.2" (Oct 18, 7:44pm) References: <200110182344.TAA12655@sassy.aa.ops.us.uu.net> X-Mailer: Z-Mail (5.0.0 30July97) To: Matthew Braun , zsh-workers@sunsite.dk Subject: Re: unlimited file descripters causes problems for zsh-4.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 18, 7:44pm, Matthew Braun wrote: } } caused by zsh-4.0.2 doing an memory alloc for the max number of file } descriptors, which in this case is (2^32)-1 (2GB). [...] } 1. Change the code back to "fdtable_size = OPEN_MAX;" } problem I see: fascist The only time anything is weritten into fdtable, the code first checks whether it needs to make it larger, so this is hardly "facist". It was probably a bad idea to use zopenmax() in that context in the first place. What I'm more concerned about is closeallelse() in exec.c, which is going to make up to several billion close() calls (plus a lot of unnecessary looping) every time a process with a redirection is started; but which I think could be caused to leak descriptors if it doesn't scan all the way to the actual maximum fd. } One thing I did notice was the global int "max_zsh_fd" is never } initialized before first using its value. It appears we are currently } counting on it being automatically initialized to zero (by the compiler } or linker). This variable should get initialized in the code I assume. No, it's perfectly valid to assume that the compiler will initialize a variable to zero. That's required by all definitions of the C language. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net