delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/11/17:14:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_NEUTRAL
X-Spam-Check-By: sourceware.org
Message-ID: <4E44461F.50201@cornell.edu>
Date: Thu, 11 Aug 2011 17:14:07 -0400
From: Ken Brown <kbrown AT cornell DOT edu>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: emacs and large-address awareness under recent snapshots
References: <4E40093D DOT 10107 AT cornell DOT edu> <20110808162556 DOT GM11601 AT calimero DOT vinschen DOT de> <87sjpbhij7 DOT fsf AT Rainer DOT invalid> <4E404424 DOT 9000600 AT cornell DOT edu> <4E40526C DOT 9080605 AT cornell DOT edu> <4E406C21 DOT 7010007 AT cs DOT umass DOT edu> <20110809082652 DOT GA9492 AT calimero DOT vinschen DOT de> <4E4117AF DOT 3030305 AT cornell DOT edu> <4E414054 DOT 6040206 AT cornell DOT edu> <4E4142F7 DOT 8020708 AT cornell DOT edu> <20110809152155 DOT GB17030 AT calimero DOT vinschen DOT de> <4E417AB6 DOT 5070306 AT cornell DOT edu> <4E41EDE9 DOT 4040004 AT cornell DOT edu> <4E41EF48 DOT 1030503 AT cs DOT utoronto DOT ca> <4E429C32 DOT 601 AT cornell DOT edu>
In-Reply-To: <4E429C32.601@cornell.edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 8/10/2011 10:56 AM, Ken Brown wrote:
> On 8/9/2011 10:39 PM, Ryan Johnson wrote:
>> Given that the static heap is only 12MB, with most of that arguably
>> occupied by stuff that isn't going away, what if we did "just ignore the
>> static heap" (mostly)? Anything freed from that regionjust gets dropped
>> on the floor and all new requests are served from the cygwin heap? I
>> assume temacs stays away from the dynamic heap, since otherwise the dump
>> would be corrupted.
>
> I tried forcing malloc to reinitialize itself in emacs.c, and emacs
> crashed almost immediately.  A gdb backtrace showed that the memory got
> corrupted as soon as realloc got called on objects that were originally
> stored in the static heap.  After reinitialization, malloc had no
> knowledge of memory allocation in the static heap.

I think there's an obvious solution to this.  At the time of 
reinitialization, we save the previous malloc state.  Then if realloc is 
called on a pointer to something in the static heap, we temporarily 
restore the old state and let realloc proceed as it did in temacs prior 
to dumping.

Unless I've (again) missed something obvious, it shouldn't be too hard 
to do this.  I'm about to go on vacation, but I should have a new emacs 
release within a couple weeks.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019