ICE in Java frontend with --enable-checking (lastfile in gcc/dbxout.c invalid)

Andreas Jaeger aj@suse.de
Mon Nov 1 00:09:00 GMT 1999


I configured with --enable-checking and got the following ICE while
bootstrapping the java frontend:

make[3]: Entering directory `/usr/src/build-cc/gcc/java'
stage1/xgcc -Bstage1/ -B/opt/gcc-2.96/i686-pc-linux-gnu/bin/ -c  -DIN_GCC    -W -Wall -O2 -g -O2  -W -Wall    -I. -I.. -I../../../cvs/gcc/gcc/java -I../../../cvs/gcc/gcc/java/.. -I../../../cvs/gcc/gcc/java/../config -I../../../cvs/gcc/gcc/java/../../include ../../../cvs/gcc/gcc/java/parse-scan.c
In file included from ./parse-scan.y:107:
../../../cvs/gcc/gcc/java/lex.c: In function `yylex':
../../../cvs/gcc/gcc/java/lex.c:530: warning: variable `c' might be clobbered by `longjmp' or `vfork'
../../../cvs/gcc/gcc/java/lex.c:609: warning: variable `literal_index' might be clobbered by `longjmp' or `vfork'
../../../cvs/gcc/gcc/java/lex.c:702: warning: variable `stage' might be clobbered by `longjmp' or `vfork'
../../../cvs/gcc/gcc/java/lex.c:703: warning: variable `seen_digit' might be clobbered by `longjmp' or `vfork'
../../../cvs/gcc/gcc/java/lex.c:704: warning: variable `seen_exponent' might be clobbered by `longjmp' or `vfork'
xgcc: Internal compiler error: program cc1 got fatal signal 11
make[3]: *** [parse-scan.o] Error 1
make[3]: Leaving directory `/usr/src/build-cc/gcc/java'
make[2]: *** [jv-scan] Error 2
make[2]: Leaving directory `/usr/src/build-cc/gcc'

The ICE happens in cc1:
 stage1/cc1 parse-scan.i -quiet -dumpbase parse-scan.c -g -O2 -O2 -W -Wall -W -Wall -version -o parse-scan.s
Program received signal SIGSEGV, Segmentation fault.

gdb reports:

strcmp (p1=0x4020eca0 "./parse-scan.y", p2=0x403e1640 <Address 0x403e1640 out of bounds>) at ../sysdeps/generic/strcmp.c:39
39            c2 = (unsigned char) *s2++;
(gdb) up
#1  0x818aa63 in dbxout_source_file (file=0x87354b8, filename=0x4020eca0 "./parse-scan.y") at ../../cvs/gcc/gcc/dbxout.c:533
533       if (filename && (lastfile == 0 || strcmp (filename, lastfile)))
(gdb) p filename
$1 = 0x4020eca0 "./parse-scan.y"
(gdb) p lastfile
$2 = 0x403e1640 <Address 0x403e1640 out of bounds>

Has lastfile been GCed?  

(gdb) bt
#0  strcmp (p1=0x4020eca0 "./parse-scan.y", p2=0x403e1640 <Address 0x403e1640 out of bounds>) at ../sysdeps/generic/strcmp.c:39
#1  0x818aa63 in dbxout_source_file (file=0x87354b8, filename=0x4020eca0 "./parse-scan.y") at ../../cvs/gcc/gcc/dbxout.c:533
#2  0x818ab81 in dbxout_source_line (file=0x87354b8, filename=0x4020eca0 "./parse-scan.y", lineno=1105) at ../../cvs/gcc/gcc/dbxout.c:564
#3  0x847c921 in output_source_line (file=0x87354b8, insn=0x4013e520) at ../../cvs/gcc/gcc/final.c:3037
#4  0x84783e9 in final_start_function (first=0x4013e520, file=0x87354b8, optimize=2) at ../../cvs/gcc/gcc/final.c:1647
#5  0x804f443 in rest_of_compilation (decl=0x4017c180) at ../../cvs/gcc/gcc/toplev.c:4386
#6  0x868be20 in finish_function (nested=0) at ../../cvs/gcc/gcc/c-decl.c:6713
#7  0x866a53a in yyparse () at c-parse.y:314
#8  0x804c744 in compile_file (name=0x40122da0 ":") at ../../cvs/gcc/gcc/toplev.c:3200
#9  0x80513b0 in main (argc=15, argv=0xbffff7c4) at ../../cvs/gcc/gcc/toplev.c:5567


My system: Linux 2.2.13, i686, glibc 2.1.2.

gcc was configured with:
../cvs/gcc/configure --prefix=/opt/gcc-2.96 --enable-shared --enable-threads \
         --enable-checking --with-gnu-as --with-gnu-ld --enable-cpp

I run cvs update at 31th October, 12:00 UTC (before the GCC merge).

Andreas
-- 
 Andreas Jaeger   
  SuSE Labs aj@suse.de	
   private aj@arthur.rhein-neckar.de


More information about the Gcc-bugs mailing list