[1.0.2] Irix 5.3: static uninitialized data not zeroed

Jeremiah W. James jerry@cs.ucsb.edu
Fri Apr 17 13:04:00 GMT 1998


I recently attempted to build XEmacs 20.4 on several platforms with egcs 
1.0.2.  It worked quite well with all but the Irix 5.3 platform.  There, 
temacs was successfully built and the xemacs binary was dumped.
However, when the new binary was run, it immediately segfaulted.

When temacs dumps the new binary, all of the variables in the (S)Bss
section are dumped with their runtime values.  Hence, when the new
xemacs binary is run, many of the uninitialized variables have nonzero
values.  The startup code promptly zeroes out the global uninitialized
variables ... but it doesn't zero out the static uninitialized
variables.  This fools the program into thinking that it has initialized
memory management (since __malloc_initialized is set to 1), leading to
the segfault when it tries to access the heap through the (zeroed)
global heap pointer.

I'd like to determine if this is a problem with the egcs startup code on
Irix 5, or a problem with the XEmacs dump code.  However, this is
unknown territory for me.  Can someone tell me how to determine which
program is at fault?  (BTW, I've posted a similar request to
comp.emacs.xemacs, so hopefully somebody in one camp or the other will
be able to help with this!)

Thanks,
-- 
Jerry James
Email: jerry@cs.ucsb.edu
WWW:   http://www.cs.ucsb.edu/~jerry/



More information about the Gcc-bugs mailing list