trying to find a testcase for what is currently an issue in PR29975 I ran into this: vondele@pcihopt1:/scratch/vondele/clean/cp2k/obj/Linux-x86-64-gfortran/sdbg> gfortran t.f90 t.f90:0: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. vondele@pcihopt1:/scratch/vondele/clean/cp2k/obj/Linux-x86-64-gfortran/sdbg> cat t.f90 MODULE M1 INTEGER :: I END MODULE M1 USE M1, ONLY: I,&
Confirmed. Backtrace: (gdb) r t.f90 Starting program: /home/ig25/libexec/gcc/i686-pc-linux-gnu/4.3.0/f951 t.f90 Failed to read a valid object file image from memory. t.f90:1: cat t.f90 1 Error: Unclassifiable statement at (1) Program received signal SIGSEGV, Segmentation fault. 0x0809a6d7 in gfc_next_char_literal (in_string=0) at /home/ig25/gcc/trunk/gcc/fortran/scanner.c:711 711 if (gfc_current_locus.lb->linenum == continue_line + 1)
(In reply to comment #1) > Confirmed. > > Backtrace: > > (gdb) r t.f90 > Starting program: /home/ig25/libexec/gcc/i686-pc-linux-gnu/4.3.0/f951 t.f90 > Failed to read a valid object file image from memory. > t.f90:1: > > cat t.f90 > 1 > Error: Unclassifiable statement at (1) > > Program received signal SIGSEGV, Segmentation fault. > 0x0809a6d7 in gfc_next_char_literal (in_string=0) > at /home/ig25/gcc/trunk/gcc/fortran/scanner.c:711 > 711 if (gfc_current_locus.lb->linenum == continue_line + 1) > looks like you discovered an independent bug, in my case the 'cat t.f90' wasn't part of the program (but it is the command line that wraps) and in my case there is no error message.
Jerry is our expert on this side of things. Although he has said that he is in temporary hiding from gfortran, I have CC'd him:) Paul
I'll give it a go. Just be patient please. :)
The patch is straight forward. Need to check for end of file after advance_line in scanner.c in a couple of places. I just need to finish testing and package the submit. Maybe tonight.
Subject: Re: incomplete file triggers ICE jvdelisle at gcc dot gnu dot org wrote: > ------- Comment #5 from jvdelisle at gcc dot gnu dot org 2007-02-14 20:31 ------- > The patch is straight forward. Need to check for end of file after > advance_line in scanner.c in a couple of places. I just need to finish testing > and package the submit. Maybe tonight. > > > Good-oh! I knew that you would go straight for it. Paul
Subject: Bug number PR30779 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01321.html
Subject: Bug 30779 Author: jvdelisle Date: Thu Feb 15 06:48:09 2007 New Revision: 121982 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121982 Log: 2007-02-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/30779 * scanner.c (gfc_next_char_literal): Add check for end of file after call to advance_line. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/scanner.c
Subject: Bug 30779 Author: jvdelisle Date: Thu Feb 15 06:51:42 2007 New Revision: 121983 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121983 Log: 2007-02-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/30779 * gfortran.dg/error_recovery_3.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/error_recovery_3.f90 Modified: trunk/gcc/testsuite/ChangeLog
Fixed on 4.3.
Subject: Bug 30779 Author: jvdelisle Date: Fri Feb 16 23:42:11 2007 New Revision: 122059 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122059 Log: 2007-02-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/30779 * scanner.c (gfc_next_char_literal): Add check for end of file after call to advance_line. 2007-02-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/30779 * gfortran.dg/error_recovery_3.f90: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/error_recovery_3.f90 Modified: branches/gcc-4_2-branch/gcc/fortran/ChangeLog branches/gcc-4_2-branch/gcc/fortran/scanner.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
No need to go to 4.1. This is an ICE on invalid.