This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-2.95.2 crash when optimizing
- To: gnu-gcc-bug at moderators dot isc dot org
- Subject: Re: gcc-2.95.2 crash when optimizing
- From: Kurt Skauen <kurt dot skauen at c2i dot net>
- Date: Wed, 12 Jan 2000 22:52:17 GMT
- Newsgroups: gnu.gcc.bug
- Organization: Tele2 Norway AS Public Access
- References: <66wzpxwz.fsf@single.bogus.loc>
Hi, all. I have now figured out what triggered the bug.
I did as Martin v. Loewis suggested, and pushed one of
the offending files through the preprocessor. I then
moved it to a linux box, where I installed gcc 2.95.2
(Bad experience! No fun compiling gcc on a P90 :) )
The compiler did not crash here, but I noticed that
the memory usage fluxated a lot at the end of the compilation
and since I was uncertain how sbrk() behaved when feeded
negative values, I disabled malloc's trimming so it never
released any memory to the system when free() vas called.
This caused the compiler to stopped crashing! After verifying
that sbrk() indeed worked, I throwed a memset() into sbrk() so it
would clear all newly allocated memory, and the compiler
started to work even whith the trimming enabled!
The conclution to all this must be that some spot in gcc
relies on malloc() to return cleared memory :(
It should be possible for the maintainers to reproduse
this by inserting a memset( newmem, -1, size ) or someting
similar in xmalloc(). But if you belive I can have some useful
information, please send me a mail and I will try to help.
BTW: Is sbrk() supposed to return cleared memory?
--
Kurt Skauen
Author of AltOS (http://altos.funcom.com/)