Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1 View

seg fault regression

There appears to be a seg fault regression introduced in Intel 2019 Fortran compiler, consider the code:

module testmod
use iso_c_binding
integer, parameter, public :: f_int = c_int64_t
type, bind(c), public :: NextValMType
 integer(f_int) :: ga_handle
end type NextValMType

contains
  function nextvalm_init(n_counter) bind(c)
    type(NextValMType) :: nextvalm_init
    integer(f_int), intent(in), value :: n_counter
    write(6,*)'n_counter=',n_counter
    nextvalm_init%ga_handle=n_counter
  end function
end module

program test
use testmod
type(NextValMType) :: nvm
integer :: i=5
write(6,*)'i=',i
nvm=nextvalm_init(i)
end

This works as expected with gfortran, Intel 2017 and 2018, but not 2019:

> module purge && module load gcc/9.1.0 && gfortran -fdefault-integer-8 intel2019_bug.f90 && ./a.out                  
 i=                    5
 n_counter=                    5                              
> module purge && module load intel/2017.5.239 && ifort -i8 intel2019_bug.f90 && ./a.out                  
 i=                     5         
 n_counter=                     5
> module purge && module load intel/2018.3.222 && ifort -i8 intel2019_bug.f90 && ./a.out                  
 i=                     5                        
 n_counter=                     5
> module purge && module load intel/2019.1.144 && ifort -i8 intel2019_bug.f90 && ./a.out                  
 i=                     5
 n_counter=                     0
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source
a.out              00000000004047C3  Unknown               Unknown  Unknown
libpthread-2.19.s  00007F0B23920870  Unknown               Unknown  Unknown
a.out              00000000004038B7  Unknown               Unknown  Unknown
a.out              00000000004037A2  Unknown               Unknown  Unknown
libc-2.19.so       00007F0B2358AB25  __libc_start_main     Unknown  Unknown
a.out              00000000004036A9  Unknown               Unknown  Unknown

The latest version I have available is 19.0.1.144. Is this a known problem and has it been fixed in subsequent updates?

Many thanks

0 Kudos
2 Replies
Highlighted
Valued Contributor I
1 View

Confirmed. I note, however,

Confirmed. I note, however, that the beta version of ifort 2020, Version 19.1.0.075 Pre-Release Beta Build 20190522, doesn't show this problem. So this problem has already been fixed, or they did some new implementation which made this bug gog away. You might want to check with the Intel Support. BTW. in your test program, it must read:

  integer(f_int) :: i=5

 

0 Kudos
Highlighted
Valued Contributor III
1 View

@Andy May,

@Andy May,

As advised, contacting Intel support is a good next step.

For whatever it's worth, the problem, as shown in the original post, is NOT reproducible with 19.0.1.144 on Windows using the ifort command i.e., "ifort /i8".

0 Kudos