Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Unexpected crash in namelist read

$
0
0

Hello,

the following code leads to a crash in namelist read with the Intel compiler, but not any other Fortran compiler I have access to:

program ifort_nml_bug
  implicit none
  integer     :: n, k(5)
  namelist /nml/ n, k
  k = -1
  n = -1
  read(*,nml=nml)
  print *, k
end program ifort_nml_bug

The namelist input file:

&nml
k =
n = 2
/

The demo:

% ifort -g -traceback ifort_nml_bug.f90 && ./a.out < ifort_nml_bug.nml
forrtl: severe (17): syntax error in NAMELIST input, unit -4, file /proc/24888/fd/0, line 3, position 3
Image              PC        Routine            Line        Source
a.out              0806F9D0  Unknown               Unknown  Unknown
a.out              0804ED8B  Unknown               Unknown  Unknown
a.out              0804A06B  MAIN__                      7  ifort_nml_bug.f90
a.out              08049F66  Unknown               Unknown  Unknown

This occurs with ifort 14, 15, 16 & 17.0.

Commenting out the line with "n=2" in the namelist input makes the crash go away, so there is some input parsing problem.

Thanks,

Harald

 


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>