zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Matthew Braun <matthew@ans.net>, zsh-workers@sunsite.dk
Subject: Re: unlimited file descripters causes problems for zsh-4.0.2
Date: Fri, 19 Oct 2001 16:40:41 +0000	[thread overview]
Message-ID: <1011019164041.ZM8348@candle.brasslantern.com> (raw)
In-Reply-To: <200110182344.TAA12655@sassy.aa.ops.us.uu.net>

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   


  reply	other threads:[~2001-10-19 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-18 23:44 Matthew Braun
2001-10-19 16:40 ` Bart Schaefer [this message]
2001-10-19 17:56   ` Bart Schaefer
2001-10-21 19:07     ` Bart Schaefer
2001-10-21 20:17       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1011019164041.ZM8348@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=matthew@ans.net \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).