Removal of unexec support from glibc malloc

Eli Zaretskii eliz@gnu.org
Sat Jan 23 07:00:00 GMT 2016


> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sat, 23 Jan 2016 00:49:02 -0500
> Cc: libc-alpha@sourceware.org
> 
> >> This is less of a problem if Emacs never frees a pointer after dump that
> >> it has allocated before dump.  But I think this can happen (otherwise,
> >> all this would be quite easy to address).
> > Yes, it can and does happen, although not much.
> 
> Indeed.  This said, it'd make sense to try and avoid doing it.

AFAICS, it happens due to the following:

  . We call regex.c functions, which reuse an allocated buffer,
    extending it (via realloc) as needed; that buffer gets frozen with
    malloc arena used during dumping

  . We delete the terminal frame used by temacs and free its resources

  . Not 100% sure, but I think we also release/reallocate some
    font-related stuff

It's easy to catch all those cases by setting a breakpoint on realloc
and free during startup.



More information about the Libc-alpha mailing list