StackOverflow Exception in Umanaged Dll When Called from Managed DLL
- by Ngu Soon Hui
My question is similar to this one here, but there are some difference.
I have a fortran dll as the backend, and a C# exe as the front end. I use PInvoke to pass data between them.
There are 22 parameters between the C# and the fortran code. And some of them are integer, double, pointers ( C# pointers), array and whatnot. So it's a mix of types.
The problem is that for small arrays, the code works fine, however, for large arrays (~10k element size), a stackoverflowexception was thrown right after my code enters into the managed code.
Any idea why this is the case, and how to fix this?