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

I may be doing something terribly wrong but...

NsK
Novice
308 Views
I obtain with Intel Visual Fortran Composer XE 2011 Integration for Microsoft Visual Studio* 2010, 12.0.3470.2010, VS 2010, on my Windows 64 machine a:

"Debug Assertion Failed!
Program: *
File: **\\winsig.c
Line: 417

Expression("Invalid signal error",0)
blahblahblah....
"

and a stack overflow, trying to Debug || Run in release the following code:

[fortran]PROGRAM PointTest
implicit none
real,pointer,dimension(:,:,:) :: pa,pb
real,target,allocatable,dimension(:,:,:) :: a,b

allocate(a(80,80,42),b(80,80,42))
a=0.0
b=1.0         
pa=>a(1:78,1:80,1:42)
pb=>b(1:78,1:80,1:42)
pa=pb                  ! <-- At this point the problem appears
write(*,*) "Hey"

END PROGRAM PointTest[/fortran]

but if instead i do :
[fortran]pa=>a(1:76,1:80,1:42)
pb=>b(1:76,1:80,1:42)
[/fortran]

everything is ok.

I guess that this is due to a stack limitation and that i'm doing something very stupid...but what exactly ???


0 Kudos
1 Solution
Steven_L_Intel1
Employee
308 Views
Stack overflow, yes. I'm not sure why such a large stack temp is created, but... Two ways of fixing this. 1) in the project properties , Linker, System, set "Stack reserve size" to a larger value than the default 1 million. Start with 100000000 and rebuild. 2) Set Fortran > Optimization > Heap arrays to 0 and rebuild.

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
309 Views
Stack overflow, yes. I'm not sure why such a large stack temp is created, but... Two ways of fixing this. 1) in the project properties , Linker, System, set "Stack reserve size" to a larger value than the default 1 million. Start with 100000000 and rebuild. 2) Set Fortran > Optimization > Heap arrays to 0 and rebuild.
0 Kudos
NsK
Novice
308 Views
Many thanks for that, it did the trick.
0 Kudos
Steven_L_Intel1
Employee
308 Views
Ok, now I did the math. The array slice is about 4MB and the compiler chose to create a temp for it before assigning. As I noted earler, the linker defaults to a measly 1MB of stack.
0 Kudos
Reply