emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unexelf.c 1.49 causes segfault


From: Bob Halley
Subject: unexelf.c 1.49 causes segfault
Date: 17 Sep 2002 03:35:29 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

I'm running RH 7.3 GNU/Linux, with current patches.  Kernel is Marcelo
2.4.19.  HW is dual athlon 1800 MP.

I'm running -current.  The change to unexelf.c (revision 1.49) causes
emacs to segfault when building it with "make bootstrap":

../src/bootstrap-emacs -batch --no-site-file --multibyte -l autoload --eval 
'(setq generated-autoload-file "/proj/src/emacs/lisp/loaddefs.el")' -f 
batch-update-autoloads $wins
Directories: /proj/src/emacs/lisp /proj/src/emacs/lisp/calc 
/proj/src/emacs/lisp/calendar /proj/src/emacs/lisp/emacs-lisp 
/proj/src/emacs/lisp/emulation /proj/src/emacs/lisp/eshell 
/proj/src/emacs/lisp/gnus /proj/src/emacs/lisp/international 
/proj/src/emacs/lisp/language /proj/src/emacs/lisp/mail 
/proj/src/emacs/lisp/net /proj/src/emacs/lisp/obsolete 
/proj/src/emacs/lisp/play /proj/src/emacs/lisp/progmodes 
/proj/src/emacs/lisp/term /proj/src/emacs/lisp/textmodes 
/proj/src/emacs/lisp/toolbar
make[1]: *** [autoloads] Error 139
make[1]: Leaving directory `/proj/src/emacs/lisp'
make: *** [bootstrap] Error 2

Investigation with gdb shows the segfault occurring when emacs tries
to strncmp (*p, "MALLOC_CHECK_=", 14) == 0) inside of
malloc_initialize_hook().  Everythings looks OK before the call to
strncmp, and 'p' is valid, but as soon as it is called it segfaults
and the stack frame is trashed (or weird):

(gdb) where
#0  0x40014852 in _r_debug () from /usr/X11R6/lib/libXaw3d.so.7
#1  0x080d364b in malloc_initialize_hook () at emacs.c:707
#2  0x420799ba in ptmalloc_init () from /lib/i686/libc.so.6
#3  0x4207dfa4 in malloc_hook_ini () from /lib/i686/libc.so.6
#4  0x4207a0ad in malloc () from /lib/i686/libc.so.6
#5  0x421156bb in __register_frame () from /lib/i686/libc.so.6
#6  0x4201740a in __libc_global_ctors () from /lib/i686/libc.so.6
#7  0x4201748a in init () from /lib/i686/libc.so.6
#8  0x4000b782 in _dl_init_internal () from /lib/ld-linux.so.2

I have no idea what _r_debug() is, or why gdb thinks that is what was
called (or why it was called instead of strncmp(), if that is what
happened).

This happens with RH's gcc (2.96-112), and with gcc 3.2.

If I revert the unexelf.c to version 1.48 and then build, everything
works OK again.

I do not understand enough about ELF to offer suggestions about
unexelf.c.

/Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]