- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page