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

Stack Overflow

Kate_Johnson
Beginner
546 Views
Is there anyway to work around a stack overflow in an executable in the DOS command prompt window? I have an executable that I don't want to change the Fortran file of. I read some things about an exe called editbin.exe, but am unsure how to use it. Thanks for your help
0 Kudos
2 Replies
Steven_L_Intel1
Employee
546 Views
Kate,

First, please read Don't Blow Your Stack on the general topic.

Are you willing to rebuild the program, without changing the source? That is the easiest way to deal with this. My first recommendation would be to add the /heap-arrays compile option. In Visual Studio, this is Fortran > Optimization > Heap Arrays > 0 . If that doesn't help, then you can increase the size of the stack through the property Linker > System > Stack Reserve Size. This defaults to a measly 1MB - set a larger value here. I suggest starting witrh 10 million, and doubling if you need more. Don't go over 500 million. From the command line, add /link /stack:nnnnn to the end of the ifort line, where nnnnn is the value you want.

You can use editbin if you wish. The syntax you want is:

editbin /stack:nnnnn myprog.exe

Run this from a Fortran build envrionment command prompt.
0 Kudos
SergeyKostrov
Valued Contributor II
546 Views
Quoting Kate Johnson
Is there anyway to work around a stack overflow in an executable in the DOS command prompt window?...

Hi Kate,

Is your executablea 16-bit MS-DOSprogram or a 32-bitConsole application? Please clarify.

Best regards,
Sergey
0 Kudos
Reply