Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

-init=arrays segmentation fault

Daan_v_
Beginner
588 Views

When compiling my code in debug mode, with -init=snan -init=zero -init=arrays (as advised by https://software.intel.com/en-us/articles/checking-for-unitialized-variables-using-init-compiler-flag) I get a segmentation fault when allocating a 'large' array (2GB) in size.

  • ulimit -s unlimited before running so that is not the problem
  • ifort (IFORT) 17.0.4 20170411
  • -init=snan -init=zero pose no problem, except when combined with -init=arrays
  • Allocating integer arrays of 5*10^8 elements (~2GB @ 4 bytes per int)
  • 536870912 is the first failing size (2^29 exactly)
  • Problem occurs on new SKL nodes with 192 GB total ram, BDW nodes

Reproduce with:

program test
  integer, dimension(:), allocatable :: x
  allocate(x(66893*8192))
end program test
ifort -O0 -g -traceback -ftrapuv -debug all -debug-parameters -align -warn all -check all,bounds,uninit -init=snan -init=zero -init=arrays -o alloc alloc.f90

 

Does -check uninit catch every use of an uninitialised array element? Because then I might not need -init=arrays at all.

0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
588 Views

Change one or both of the constants to 8-byte integer

   allocate(x(66893_8 * 8192_8))

Jim Dempsey

0 Kudos
jimdempseyatthecove
Honored Contributor III
588 Views

if that does not work then try

ulimit -m unlimited   (in addition to -s)

Jim Dempsey

0 Kudos
Daan_v_
Beginner
588 Views

Hi Jim,

The first suggestion does not change the behaviour. I am not allowed to set ulimit -m unlimited (but it is set to 187695104 kbytes = 187 GB which should be high enough.

Daan

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
588 Views

>> I am not allowed to set ulimit -m unlimited

But you are allowed to set ulimit -s unlimited

This is quite strange (you should advise your system administrator of this oversight).

Jim Dempsey

0 Kudos
Reply