GNU bug report logs - #9273
23.3; malloc initialization should (sometimes) happen at runtime

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Tue, 9 Aug 2011 20:12:02 UTC

Severity: normal

Found in version 23.3

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 9273 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "9273 <at> debbugs.gnu.org" <9273 <at> debbugs.gnu.org>
Subject: Re: bug#9273: 23.3;	malloc initialization should (sometimes) happen
	at runtime
Date: Sat, 13 Aug 2011 10:53:25 -0400
On 8/13/2011 10:41 AM, Eli Zaretskii wrote:
>> Date: Sat, 13 Aug 2011 09:48:52 -0400
>> From: Ken Brown<kbrown <at> cornell.edu>
>> CC: "9273 <at> debbugs.gnu.org"<9273 <at> debbugs.gnu.org>
>>
>> _heapinfo is indeed consistent with the current heap.  But the pointer
>> that was passed to realloc points into the old heap.  So applying BLOCK
>> to that pointer yields an absurd result.  I can easily catch such cases
>> by testing for ptr<  _heapbase, as in my patch to _free_internal_nolock,
>> but I have to figure out the best way to handle them once I've caught
>> them.
>
> malloc a buffer, then copy the contents of the old one to the new
> one.  You will have to know the size of the old block, which means you
> will have to access the old copy of _heapinfo.

Thanks!  That's much easier than what I was trying to do.

Ken




This bug report was last modified 14 years and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.