GNOME Bugzilla – Bug 664277
Segmentation error parsing a Fortran 77 file
Last modified: 2011-11-21 17:36:43 UTC
When parsing a fortran 77 file I have a segmentation error after the message: ******************************************************************** Error in file /home/su_php/dev/OCTANT/src/support/ALG_AjustementPolynomial.F line: 290, state: 21 ******************************************************************** I have reduced the file enough to produce the error. But I can have no crash if I remove (or move) ordinary comments (not Doxygen special comments ‽ The file is in Fortran 77 in fixed format. Joined is the fortran file and the Doxygen parameter file
Dear Philippe, You write "oined is the fortran file and the Doxygen parameter file" but I don't see them. Please attach Albert
Oops... I forgot it. I redo it and now the message if: ******************************************************************** Error in file /home/su_php/dev/OCTANT/doc/doxygen/ALG_AjustementPolynomial.F line: 288, state: 21 ******************************************************************** Since there is not exactly the same number of lines. If I remove lines 79 to 81 (3 comment lines, the segfault disapear)
Created attachment 201609 [details] To reproduce segfault
The problem in this case is that the input file is recognized as a free formatted Fortran file, this is not the case it is a fixed formatted file. A "temporary" solution for this case is to have the first line as: C -*- coding: utf-8 -*- or to have an extra first line with just a C in the first position. This bug is a duplicate of bug_625601
*** This bug has been marked as a duplicate of bug 625601 ***
OK. Setting all comments with 'C' instead of '!' corrects the crashes. If I understand correctly '!' tells the parser to consider the code as free form while 'C' if for fixed form.
Dear Philippe, It is not as easy as this, but whit a C or * in the firs column it recognizes it as fixed form. There is a BUG report about recognizing fixed versus free format but it is quite complex to get a routine that is full proof. Albert