StackOverflow Exception in Umanaged Dll When Called from Managed DLL

Posted by Ngu Soon Hui on Stack Overflow See other posts from Stack Overflow or by Ngu Soon Hui
Published on 2010-03-24T02:33:14Z Indexed on 2010/03/24 2:43 UTC
Read the original article Hit count: 727

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about unmanaged

Related posts about managed