Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Fortran forrtl: severe (174): SIGSEGV, segmentation fault in derived type data

$
0
0

 "m.f90" :
  1 module typedef
  2 implicit none
  3 type::mytype
  4     integer::mn(2,2)
  5     complex(kind=8)::w
  6     integer,allocatable::sz(:)
  7 end type
  8 end module typedef
  9 subroutine mysub(mtp)
 10 use typedef
 11 implicit none
 12 type(mytype)::mtp(6)
 13 integer::lm
 14 complex(kind=8)::f0(6),f1(6)
 15 do lm=1,6
 16     write(*,*)"a",lm
 17     f0(lm)=mtp(lm).w
 18     f1(lm)=f0(lm)
 19 end do
 20 end subroutine
 21 program main
 22 use typedef
 23 implicit none
 24 type(mytype)::mtp(6)
 25 call mysub(mtp)
 26 end program

I compiled this program with "ifort m.f90" then run it "./a.out",  then error occured: 
forrtl: severe (174): SIGSEGV, segmentation fault occurred

If I compiled it with "ifort m.f90 -CB" then No error occured

If I changed the 4th line into "integer::mn(3,3)" or just delete it, then compiled it with "ifort m.f90" No error occured.

This problem puzzled my a lot, is something wrong with my program?

my compiler is ifort version 14.0.3 on Mac OS

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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