zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Ray Jones <rjones@ptc.com>, zsh-workers@math.gatech.edu
Subject: Re: more problems w/ irix
Date: Wed, 13 Nov 1996 10:38:44 -0800	[thread overview]
Message-ID: <961113103844.ZM29420@candle.brasslantern.com> (raw)
In-Reply-To: Ray Jones <rjones@ptc.com> "more problems w/ irix" (Nov 13, 10:23am)

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


  reply	other threads:[~1996-11-13 19:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-13 17:23 Ray Jones
1996-11-13 18:38 ` Bart Schaefer [this message]
1996-11-13 18:43   ` rjones
1996-11-14 10:01 ` Peter Stephenson
1996-11-14 15:08   ` Zefram
1996-11-14 15:23     ` Richard Coleman
1996-11-14 15:38       ` Zefram
1996-11-14 16:05         ` Richard Coleman
1996-11-15 11:09     ` Peter Stephenson

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=961113103844.ZM29420@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=rjones@ptc.com \
    --cc=schaefer@nbn.com \
    --cc=zsh-workers@math.gatech.edu \
    /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).