GNU bug report logs -
#9273
23.3; malloc initialization should (sometimes) happen at runtime
Previous Next
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 #23 received at 9273 <at> debbugs.gnu.org (full text, mbox):
On 8/10/2011 11:56 AM, Eli Zaretskii wrote:
>> Date: Tue, 09 Aug 2011 16:09:48 -0400
>> From: Ken Brown<kbrown <at> cornell.edu>
>> I made one naive attempt to do this, but it didn't work (and it was
>> Cygwin specific). Namely, I made unexec (for Cygwin) set
>> _malloc_initialized = 0 before dumping. The resulting emacs aborted
>> as soon as it was started. I haven't figured out what went wrong,
>> but I'm not sure that's the right answer anyway.
The problem was that realloc got called on memory that had been
allocated prior to dumping, and the malloc information that was used
then had disappeared. 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 patch
ready within a couple weeks.
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.