- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have received a customers dll which should work with my software.
If I run it debug mode it does work well, in release version I get :
forrtl: severe (157): Program Exception - access violation
the dll is called from another dll, which is part of my program.
I suspect there is something wrong in terms of the size of assumed
in- and outputs, specifically when the function I called is returning data to
my program.
How can I go about figuring out what is wrong?
Is there a way to get more diagnostic feedback for this type of error in the release version?
Despite putting diagnostic to full, I don't even get a linenumber. (Which would be useful for
me, as it would confirm that it is indeed on the call to the function in the customers dll that
the access violation occurs.)
Is there some way to check in debug mode the size of the arrays that are returned?
Wouter
If I run it debug mode it does work well, in release version I get :
forrtl: severe (157): Program Exception - access violation
the dll is called from another dll, which is part of my program.
I suspect there is something wrong in terms of the size of assumed
in- and outputs, specifically when the function I called is returning data to
my program.
How can I go about figuring out what is wrong?
Is there a way to get more diagnostic feedback for this type of error in the release version?
Despite putting diagnostic to full, I don't even get a linenumber. (Which would be useful for
me, as it would confirm that it is indeed on the call to the function in the customers dll that
the access violation occurs.)
Is there some way to check in debug mode the size of the arrays that are returned?
Wouter
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think only way is to debug release version in Visual studio and look at assembler code and check values passed to routine and returned looking into CPU registers and memory.
Other way is to ask provider of dll to put there some debug output (for example to text file) summary of passed parameters and summary of output values. It will be the fastest way.
Other way is to ask provider of dll to put there some debug output (for example to text file) summary of passed parameters and summary of output values. It will be the fastest way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you added the "Generate Traceback Information" /traceback - it is under Run-time. This should give the line number in your code where the error occurs.
David
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wouter,
The usual cause for memory access errors when calling 3rd party library functions is in not using the proper calling convention or mis-matching arguments (reference verses value, size of integer, BOOL verses LOGICAL).
If the supplier of the library has not provided the FORTRAN interfaces, generally in a .MOD file, then a likely culprit is passing argument by reference or value as opposed to value or reference. Argument size can be in error as well (using integer where dword is required). Add strings in FORTRAN are not NULL terminated.
If the interface .MOD file is not supplied by the vendor, then you must write one for your own purpose and where it correctly specifies the calling convention and arguments. You will have to ascertain what these are from the C++ (or other) API provided by the .DLL documentation.
Jim Dempsey
The usual cause for memory access errors when calling 3rd party library functions is in not using the proper calling convention or mis-matching arguments (reference verses value, size of integer, BOOL verses LOGICAL).
If the supplier of the library has not provided the FORTRAN interfaces, generally in a .MOD file, then a likely culprit is passing argument by reference or value as opposed to value or reference. Argument size can be in error as well (using integer where dword is required). Add strings in FORTRAN are not NULL terminated.
If the interface .MOD file is not supplied by the vendor, then you must write one for your own purpose and where it correctly specifies the calling convention and arguments. You will have to ascertain what these are from the C++ (or other) API provided by the .DLL documentation.
Jim Dempsey

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