Silverfrost Forums

Welcome to our forums

Fortran DLL is crashing

20 May 2015 1:01 #16322

Hi,

I have Fortran dll that is crashing when I call one of it's functions, and I'm not sure why.

It's actually crashing within salflibc.dll, it seems to to calling something that isn't there (you can see the callstack in the screenshot).

I've had a look with dependency walker to try and figure out what's missing, but I'm clueless when it comes to this (I've been googling for a solution for the past few hours).

Any ideas what my problem is here? Thanks v much.

Dom

Callstack:

http://i59.tinypic.com/2s7hw7a.jpg

Dependency walker:

http://i61.tinypic.com/rbwj5u.jpg [/img]

20 May 2015 3:24 #16323

If the routine in your Fortran DLL has corrupted the stack, the information in the stack trace is not reliable.

The information you have given is too sparse to indicate what/where the problem lies. Can you recompile/rebuild with the /DEBUG compiler and reproduce the problem with the debug build? What is the name of the DLL, and what is the routine within the DLL that you called? How big is the Fortran source of the DLL code?

21 May 2015 12:52 #16327

Thanks for the reply.

I think I found the cause of the issue. It looks like it's because of the allocate() calls in the Fortran code. When I run the subroutine without any allocate()s, it seems to run ok. Is this expected? Do I need to provide an alllocator to the dll or something?

Thanks

21 May 2015 1:50 #16330

Ignore the last reply, that was a red herring.

The problem was with some files that weren't being loaded correctly (they were't in the directory that the calling application was expecting).

Thanks

Please login to reply.