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

Release DLL throwing Stack Overflow Exception in C#

ankitsethi
Beginner
2,206 Views
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
0 Kudos
6 Replies
Steven_L_Intel1
Employee
2,206 Views
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.
0 Kudos
ankitsethi
Beginner
2,206 Views

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

0 Kudos
Steven_L_Intel1
Employee
2,206 Views
You could try enabling Traceback for the DLL. Or try building a Debug configuration with optimization and see if it does the same thing.
0 Kudos
anthonyrichards
New Contributor III
2,206 Views
Are you allocating arrays?
0 Kudos
ankitsethi
Beginner
2,206 Views
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
0 Kudos
ankitsethi
Beginner
2,206 Views
I am not allocating any arrays dynamically. All the array sizes are fixed.
Ankit
0 Kudos
Reply