This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bootstrap failure in stage1 fix-header, !HAVE_DESIGNATED_INITIALIZERS


 > From: Zack Weinberg <zack@wolery.cumb.org>
 > 
 > On Sat, Aug 19, 2000 at 10:06:39PM -0400, Kaveh R. Ghazi wrote:
 > > Recent CVS dies in stage1 whenever one uses cc to bootstrap on
 > > mips-sgi-irix6.2 and sparc-sun-solaris2.7.  Fix-header gobbles up
 > > memory until it runs out and xmalloc fails.
 > > 
 > > The trigger appears to be the HAVE_DESIGNATED_INITIALIZERS else-clause
 > > since if I force the compiler to take the else path, it always fails
 > > even with gcc.
 > 
 > Bizarre; none of the code under !HAVE_DESIGNATED_INITIALIZERS should
 > be allocating memory.
 > 
 > I'll look into this as soon as I get a chance, but if you could change
 > xmalloc so it aborts on failure, run the offending process under the
 > debugger, and send me a backtrace, I'd much appreciate it.
 > zw

Ok.

BTW, I think I found a hint as to why it dies.  The _cpp_IStable and
_cpp_trigraph_map arrays are never initialized.  Somehow in the way
fix-headers uses the code, the initialization routine is bypassed and
this might trigger some kind of infinite loop which happens to
allocate memory.  See below, (this is stage1 "make stmp-fixproto" from
i686-pc-linux-gnu with the patch to force the !HAVE_DESIGNATED_INITIALIZERS
clause.)

 > fixproto: populating `include'
 > 
 > Cannot reallocate 604864528 bytes after allocating 40256 bytes
 > make: *** [stmp-fixproto] Error 1


(gdb) bt
#0  0x400344e1 in __kill () from /lib/libc.so.6
#1  0x40034156 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40035868 in abort () at ../sysdeps/generic/abort.c:88
#3  0x806108c in xrealloc (oldmem=0x4010e008, size=604864528)
    at ../../egcs-CVS20000820/libiberty/xmalloc.c:169
#4  0x804e850 in _cpp_expand_token_space (list=0xbffff86c, count=256)
    at ../../egcs-CVS20000820/gcc/cpplex.c:485
#5  0x80508bf in lex_line (pfile=0xbffff838, list=0xbffff86c)
    at ../../egcs-CVS20000820/gcc/cpplex.c:1768
#6  0x80530fa in lex_next (pfile=0xbffff838, clear=1)
    at ../../egcs-CVS20000820/gcc/cpplex.c:3277
#7  0x8053823 in _cpp_run_directive (pfile=0xbffff838, dir=0x8069300,
    buf=0xbffff784 "__VERSION__ \"2.96 20000819 (experimental)\"\n", count=43)
    at ../../egcs-CVS20000820/gcc/cpplex.c:3575
#8  0x804ddec in cpp_define (pfile=0xbffff838,
    str=0x807f188 "__VERSION__=\"2.96 20000819 (experimental)\"")
    at ../../egcs-CVS20000820/gcc/cpplib.c:1408
#9  0x805b986 in initialize_builtins (pfile=0xbffff838)
    at ../../egcs-CVS20000820/gcc/cppinit.c:613
#10 0x805c1c5 in cpp_start_read (pfile=0xbffff838, print=0x0, fname=0xbffffbe9
    "/home/ghazi/gcc-testing/build/gcc/include/cxxabi.h")
    at ../../egcs-CVS20000820/gcc/cppinit.c:867
#11 0x8049cb6 in read_scan_file (
    in_fname=0xbffffbe9 "/home/ghazi/gcc-testing/build/gcc/include/cxxabi.h",
    argc=4, argv=0xbffffa54) at ../../egcs-CVS20000820/gcc/fix-header.c:623
#12 0x804ad9c in main (argc=8, argv=0xbffffa44)
    at ../../egcs-CVS20000820/gcc/fix-header.c:1152
(gdb) p _cpp_IStable
$1 = '\000' <repeats 255 times>
(gdb) p _cpp_trigraph_map
$2 = '\000' <repeats 255 times>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]