GNU bug report logs - #22086
25.1.50; [PATCH] Integrate the musl hybrid malloc patch for elf systems

Previous Next

Package: emacs;

Reported by: Wolfgang Jenkner <wjenkner <at> inode.at>

Date: Thu, 3 Dec 2015 18:02:01 UTC

Severity: important

Tags: patch

Found in version 25.1.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


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

From: Daniel Colascione <dancol <at> dancol.org>
To: Rich Felker <dalias <at> aerifal.cx>, Ken Brown <kbrown <at> cornell.edu>
Cc: Wolfgang Jenkner <wjenkner <at> inode.at>, 22086 <at> debbugs.gnu.org,
 Paul Eggert <eggert <at> cs.ucla.edu>
Subject: Re: bug#22086: 25.1.50; [PATCH] Integrate the musl hybrid malloc
 patch for elf systems
Date: Mon, 21 Dec 2015 12:08:46 -0800
[Message part 1 (text/plain, inline)]
On 12/20/2015 08:06 PM, Rich Felker wrote:
> On Sun, Dec 20, 2015 at 10:37:24PM -0500, Ken Brown wrote:
>> On 12/20/2015 5:33 PM, Paul Eggert wrote:
>>> While thinking over this patch I'd like to propose what should be a
>>> simpler approach. This new proposal is more radical, and so should not
>>> be applied to the emacs-25 branch, but it should make the port to musl
>>> etc. automatic.
>>>
>>> The simpler approach is to remove gmalloc.c, and to use the system
>>> memory allocator, i.e., to behave as if SYSTEM_MALLOC is defined on all
>>> platforms.
>>>
>>> We can still support hybrid malloc for Cygwin, if SYSTEM_MALLOC wouldn't
>>> work on Cygwin for some reason; and we can support the similar hybrid on
>>> Darwin, if it's still needed.
>>
>> SYSTEM_MALLOC doesn't work on Cygwin, largely because Cygwin's
>> malloc doesn't support malloc_set_state and malloc_get_state.  There
>> may be other problems too.  (It's been a while since I tried it.)
> 
> I don't see how this is possible; malloc_[gs]et_state do not exist on
> other systems either. Presumably this is some hack needed for the
> dumper, which wouldn't be needed if malloc weren't used pre-dumping.

We really shouldn't be dumping the native heap at all, really.
Eventually, Emacs should be a position-independent executable (as should
every other program), and to unexec a PIE, we need to emit relocations,
and to emit relocations, we need to know where all the pointers are. We
can't do that if the internal heap structure is opaque to us.

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 9 years and 101 days ago.

Previous Next


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