more on the emacs-20.3 segfault

Andreas Schwab schwab@issan.cs.uni-dortmund.de
Mon May 31 00:41:00 GMT 1999


Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> writes:

|> > This won't change anything.  You cannot install the malloc hook before the
|> > dynamic linker has passed control to the executable, when it is already
|> > too late.  A constructor won't help either because initializers are called
|> > after the initial atexit.
|> 
|> Yes, but using __malloc_initialize_hook seems to work just fine for me
|> with glibc-2.2.1.  Patch for emacs-20.3 appended below.  Only issue
|> before I forward it to the Emacs maintainers is whether it works with
|> libc5, where __malloc_initialize_hook wasn't a weak symbol.  Can you
|> all check whether the patch works for you as well ?

Unfortunately this has a very nasty side effect: the protection against
MALLOC_CHECK_ does not work any more.  That means that Emacs will crash if
MALLOC_CHECK_ is defined in the environment, and there is no way to fix
that within Emacs (the malloc_initialize_hook runs too late).

Andreas.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org


More information about the Libc-hacker mailing list