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

forrt1: severe (170): Program Exception - stack overflow

sublimer22
Beginner
1,578 Views
Hello, and thanks ahead of time for any help!
I have compiled a program (which I did not write) and it works just fine on Mac's but when I try to execute the program on Windows I get the following error message shortly after execution of the program began: "forrt1: severe (170): Program Exception - stack overflow"
I am not an ifort or Fortran user, but trying to compile a program for work.
I did an "ifort --version" and I am using Intel Visual Fortran Compiler XE with verion 12.0.0.104. I have been working on this problem for a few days now and I have tried messing with the flags in the Makefile some, but with no luck.
If I can provide any further information, I'll try to do my best. Thanks again!
0 Kudos
5 Replies
Arjen_Markus
Honored Contributor II
1,578 Views
Your program is probably using temporary arrays of some kind - automatic arrays are one possibility.
They are taken from the stack by default, but on Windows the stack is amazingly small.

Try: /heap-arrays - this option causes such arrays to be allocated on the heap, rather the stack.
It have some performance impact though.

Regards,

Arjen
0 Kudos
TimP
Honored Contributor III
1,578 Views
The primary stack limit adjustments are done the same as any application running under Visual Studio, e.g.
/link /stack:
http://msdn.microsoft.com/en-us/library/8cxs58a6%28v=vs.80%29.aspx

or by editbin (assuming your build options are compatible with it)

Or in the Visual Studio project link properties

Default stack limit, no doubt, is much smaller than on Mac, particularly in ia32 mode. This is among the reasons for popularity of /heap-arrays (an option specific to ifort).

There have been 4 updates since the version of ifort you quoted, not that that directly impacts your question.

If using OpenMP (you didn't give much information) you might need to study also KMP_STACKSIZE.
0 Kudos
sublimer22
Beginner
1,578 Views
I added that flag in and I believe it made forward progress. However, I now get the error:

forrt1: severe (157): Program Exception - access violation
0 Kudos
TimP
Honored Contributor III
1,578 Views
If you haven't tried the diagnostic options, such as /check, that might be a good next step.
0 Kudos
JohnNichols
Valued Contributor III
1,578 Views

I had that problem a few days ago and it was a real problem to get rid off.

I have found that MS Visual Studio is really good for stepping through the program and isolating the errors like this one. You can try it for free. it is also good for setting make file switches.

JMN

0 Kudos
Reply