zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Cc: 245678-submitter@bugs.debian.org
Subject: Re: Bug#245678: zsh: built-in rm -rf fills up the memory
Date: Mon, 10 May 2004 11:16:23 +0100	[thread overview]
Message-ID: <16158.1084184183@csr.com> (raw)
In-Reply-To: "Bart Schaefer"'s message of "Sun, 09 May 2004 16:51:03 PDT." <Pine.LNX.4.44.0405091647230.29962-100000@toltec.zanshin.com>

Bart Schaefer wrote:
> } [ h->used + (new - old) > HEAP_ARENA_SIZE ]
> } 63432 + (63504 - 63432) > 16360
> 
> Aha!  Note that h->used > HEAP_ARENA_SIZE all by itself!
> 
> Comparing to HEAP_ARENA_SIZE is likely wrong, it should compare to the 
> maximum of either HEAP_ARENA_SIZE or the previously-mmapped page size.
> I'm not entirely sure of that ...
> 
> ... but that's why it begins re-zhalloc()-ing.  In the non-MMAP case it
> falls back on realloc() when a single allocation exceeds HEAP_ARENA_SIZE.
> 
> So what probably needs to happen to prevent the out-of-memory condition
> is that we need to explicitly munmap the old mmap'd block, somewhere.
> 
> And then we need to emulate realloc() behavior somehow, in terms of
> knowing whether to actually re-mmap-and-copy or whether the existing
> mapped pages are large enough to contain the additional requested space.

Looks like a rewrite of hrealloc is definitely in order...

Does the bad behaviour go away if USE_MMAP is undefined?

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


  reply	other threads:[~2004-05-10 10:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040424162150.GA4210@ay.vinc17.org>
2004-04-25  1:36 ` Clint Adams
2004-04-25 20:45   ` Bart Schaefer
2004-04-25 21:12     ` Clint Adams
2004-04-25 21:38       ` Clint Adams
2004-04-26 17:10       ` Bart Schaefer
2004-05-08  4:35         ` Clint Adams
2004-05-08 14:02           ` Clint Adams
2004-05-08 14:13             ` Clint Adams
2004-05-09 22:54               ` Bart Schaefer
2004-05-09 22:48             ` Bart Schaefer
2004-05-09 23:30               ` Clint Adams
2004-05-09 23:36                 ` Clint Adams
2004-05-09 23:51                   ` Bart Schaefer
2004-05-10 10:16                     ` Peter Stephenson [this message]
2004-05-10 14:09                       ` Clint Adams
2004-05-10 15:54                       ` Bart Schaefer
2004-05-10 16:19                     ` Peter Stephenson
2004-05-10 16:51                       ` Bart Schaefer
2004-05-10 17:23                         ` 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=16158.1084184183@csr.com \
    --to=pws@csr.com \
    --cc=245678-submitter@bugs.debian.org \
    --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).