- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a C# application which calls a Fortran DLL.The application works fine if I use the DLL built under Debug environment but throws a "Stack Overflow Exception" when I use the the DLL built under Release environment. The speed of computation is very important and hence I want the release version of the DLL.
I have triedcompiling the DLL with /heap-arrays0 but still I get the exception.
I have a external library ".ftn" file which contains a user defined structure with arrays. I use "include" statements in my source to refer to the file and create objects of the structure and pass it to various subroutines.
I am runningIVF Compiler XE 12.0in Visual Studio 2008 on 32-bit Windows 7.
Any help will be greatly appreciated.
Thanks,
Ankit
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you know exactly where in the Fortran code the error occurs? The /heap-arrays option is better set in the Optimization property page - set the property Heap Arrays to 0. (And make sure that it is set in the Release configuration.)
Without knowing where the error occurs, and what the code looks like there,. it's hard to offer advice.
Without knowing where the error occurs, and what the code looks like there,. it's hard to offer advice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I tried setting the /heap-array option to 0 in the Optimization property page but still the exception is thrown.
How would I find out where the error occurs? I tried enabling unmanaged code debugging in C# but that does not help ( I am not sure if that works for Release DLL).
Thanks
Ankit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could try enabling Traceback for the DLL. Or try building a Debug configuration with optimization and see if it does the same thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you allocating arrays?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried the Debug configuration with optimization and replicated all the options of the Release configuration. The Debug DLL still works without any issues.
Enabling traceback does not generate any information.
Ankit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not allocating any arrays dynamically. All the array sizes are fixed.
Ankit

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