Bug 1575137 - Segmentation fault in Fortran compiler "if (.not.checkFmt(fmt)) then"
Summary: Segmentation fault in Fortran compiler "if (.not.checkFmt(fmt)) then"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 28
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-04 20:51 UTC by Joe Pelayo
Modified: 2018-11-01 06:41 UTC (History)
12 users (show)

Fixed In Version: gcc-8.1.1-2.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-01 06:41:48 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 85138 0 None None None 2018-09-17 18:45:20 UTC

Description Joe Pelayo 2018-05-04 20:51:37 UTC
Description of problem:
All fortran (mpif90.mpich, mpif90.openmpi, gfortran, f95) compilers present the error:

siesta-3.2/Src/FoX/fsys/fox_m_fsys_format.F90:1294:0:

     if (.not.checkFmt(fmt)) then
 
error interno del compilador: Segmentation fault

when trying to compile any version of the Siesta code.


Version-Release number of selected component (if applicable): Stock.


How reproducible: Always, regardless of the Siesta version or compiler choice.


Steps to Reproduce:
1. Download siesta-4.0.tgz: 
https://launchpad.net/siesta/4.0/4.0/+download/siesta-4.0.tgz
2. Extract the file, and enter the "Obj" directory.
3. $ ../Src/obj_setup.sh
   $ ../Src/configure FC=gfortran
   $ make

Actual results:
Compilation fails with the aforementioned error message.

Expected results:
A successful compilation, as with any other Fedora release (particularly 27)

Additional info:
The system is completely up to date, running the 4.16.5-300.fc28.x86_64 kernel.

Comment 1 Marek Polacek 2018-05-05 14:52:17 UTC
(gdb) bt
#0  0x0000000000f440d8 in gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*, gfc_expr*, vec<tree_node*, va_gc, vl_embed>*) ()
    at ../../gcc/fortran/trans-expr.c:4890
#1  0x0000000000f43f4f in gfc_conv_function_expr(gfc_se*, gfc_expr*) ()
    at ../../gcc/fortran/trans-expr.c:6811
#2  0x0000000000f43413 in gfc_conv_expr(gfc_se*, gfc_expr*) ()
    at ../../gcc/fortran/trans-expr.c:7922
#3  0x0000000000f4532c in gfc_conv_expr_val(gfc_se*, gfc_expr*) ()
    at ../../gcc/fortran/trans-expr.c:7975
#4  0x00000000006b5f57 in gfc_conv_unary_op(enum tree_code, gfc_se *, gfc_expr *) (
    code=code@entry=TRUTH_NOT_EXPR, se=se@entry=0x7fffffffda60, 
    expr=expr@entry=0x237dc70) at ../../gcc/fortran/trans-expr.c:2799
#5  0x00000000006a9012 in gfc_conv_expr_op (expr=0x237dc70, se=0x7fffffffda60)
    at ../../gcc/fortran/trans-expr.c:3317
#6  gfc_conv_expr (se=0x7fffffffda60, expr=0x237dc70)
    at ../../gcc/fortran/trans-expr.c:7918
#7  0x0000000000f4532c in gfc_conv_expr_val(gfc_se*, gfc_expr*) ()
    at ../../gcc/fortran/trans-expr.c:7975
#8  0x00000000014ab63d in gfc_trans_if_1(gfc_code*) [clone .part.10] ()
    at ../../gcc/fortran/trans-stmt.c:1427
#9  0x00000000014ab5ce in gfc_trans_if_1 (code=<optimized out>)
    at ../../gcc/fortran/trans-stmt.c:1469
#10 gfc_trans_if (code=code@entry=0x237dd50) at ../../gcc/fortran/trans-stmt.c:1464
#11 0x0000000000f3a7a6 in trans_code (cond=0x0, code=0x237dd50)
    at ../../gcc/fortran/trans.c:1916
#12 gfc_trans_code(gfc_code*) () at ../../gcc/fortran/trans.c:2155
#13 0x0000000000f3e217 in gfc_generate_function_code(gfc_namespace*) ()
    at ../../gcc/fortran/trans-decl.c:6507
#14 0x0000000000683457 in gfc_generate_module_code (ns=<optimized out>)
    at ../../gcc/fortran/trans.c:2222
#15 0x0000000000f1d982 in translate_all_program_units (gfc_global_ns_list=0x22269b0)
    at ../../gcc/fortran/parse.c:6108
#16 gfc_parse_file() () at ../../gcc/fortran/parse.c:6324
#17 0x0000000000f3a0a4 in gfc_be_parse_file() () at ../../gcc/fortran/f95-lang.c:204
#18 0x00000000014ef238 in compile_file() () at ../../gcc/toplev.c:456
#19 0x0000000000eee7e9 in do_compile () at ../../gcc/toplev.c:2133
#20 toplev::main(int, char**) () at ../../gcc/toplev.c:2268
#21 0x0000000000eef8bf in main (argc=3, argv=0x7fffffffdfd8) at ../../gcc/main.c:39

Comment 2 Marek Polacek 2018-05-05 15:00:22 UTC
Also reproduced with trunk but this uses modules and I don't know how to provide a preprocessed source file with that.

Comment 3 Henrique C. S. Junior 2018-05-19 17:11:18 UTC
Looks like the same problem.

checking for EOR character used by mpif90... LF
checking for ASSOCIATED in restricted expression bug... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for flag to alter module search path... -I
checking for suffix of module files... mod
checking whether module filenames are uppercased... no
configure: creating ./config.status
config.status: creating arch.make
config.status: creating FoX-config
(cd FoX; make )
make[1]: Entering directory '/home/henrique/Build/siesta-4.0.1/Obj/FoX'
mkdir -p objs/lib objs/finclude
(cd fsys; make VPATH=/home/henrique/Build/siesta-4.0.1/Src/FoX/fsys)
make[2]: Entering directory '/home/henrique/Build/siesta-4.0.1/Obj/FoX/fsys'
mpif90 -c -g -O2   -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DFC_EOR_LF  /home/henrique/Build/siesta-4.0.1/Src/FoX/fsys/fox_m_fsys_abort_flush.F90 
mpif90 -c -g -O2   -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DFC_EOR_LF  /home/henrique/Build/siesta-4.0.1/Src/FoX/fsys/fox_m_fsys_array_str.F90 
mpif90 -c -g -O2     /home/henrique/Build/siesta-4.0.1/Src/FoX/fsys/fox_m_fsys_realtypes.f90
mpif90 -c -g -O2   -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DFC_EOR_LF  /home/henrique/Build/siesta-4.0.1/Src/FoX/fsys/fox_m_fsys_format.F90 
/home/henrique/Build/siesta-4.0.1/Src/FoX/fsys/fox_m_fsys_format.F90:1294:0:

     if (.not.checkFmt(fmt)) then
 
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [../arch.make:40: fox_m_fsys_format.o] Error 1
make[2]: Leaving directory '/home/henrique/Build/siesta-4.0.1/Obj/FoX/fsys'
make[1]: *** [Makefile:124: fsys_lib] Error 2
make[1]: Leaving directory '/home/henrique/Build/siesta-4.0.1/Obj/FoX'
make: *** [Makefile:197: FoX/.FoX] Error 2

Comment 6 Jakub Jelinek 2018-09-17 18:34:45 UTC
Can't reproduce with current trunk.

Comment 7 Jakub Jelinek 2018-09-17 18:45:20 UTC
Ah, seems to have been fixed with http://gcc.gnu.org/r261362 .

Comment 8 PREETI 2018-11-01 04:56:31 UTC
Hello,

I am using GCC 8.1.0 for compiling Telemac Software in window PC. I am facing the same above mentioned problem. Can anyone help me out that how to fix it. I have downloaded the files given by Jakub Jelinek at "http://gcc.gnu.org/r261362"

Thanks!
Regards
Preeti


Note You need to log in before you can comment on or make changes to this bug.