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

Handler: Saw access violation

larryscheier
Beginner
449 Views
I have a computation intensive, large mixed fortran/C project (win32 DLL) which I rebuilt using VS2010 and Intel Fortran Composer 2011 Update 7 (in release mode). This was linked against several C libraries (several Win32 DLL's and one Win32 exe) built with VS2005-SP2 (all in release mode). When running the legacy exe (which calls the rebuilt fortran DLL) on an Intel multicore processor, two bad things happen: 1) none of the processor cores use more than 10% so the runtime is very slow, 2) toward the end, the program crashes with the following error message: "Handler: Saw access violation.. Stack trace terminated abnormally." Normally, when I run the exe and all the DLL's built in VS2005 and Intel Fortran 10.1, the program works fine and one of the cores runs at 100%.

This was just a test to see if I could mix VS2005-built exe/DLL's with VS2010-built Composer DLL. Is this expected to fail or can I do something to improve the odds of success?

Thanks!
Larry
0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
449 Views
I suspect VS2005 built Fortran/C++ DLL's are using VS2005 C-Runtime DLL's/statics and VS2010 built Fortran/C++ DLLs are using VS2010 C-Runtime DLL's/statics. And that you have exposed a compatibility issue related not to the code generated by the compiler but in the combination of and expectation of different versioned DLL's can work compatibly.

The fact that the program is jumping around from core to core indicates a context switch, possibly between threads in your app, or page faults, or other system activity.
0 Kudos
larryscheier
Beginner
449 Views
Ok, I removed the VS2010 build and now everything is being built within the VS2005-SP2 environment. All fortran DLL's were rebuilt in VS2005-SP2, release mode, using Intel Visual Fortran Compiler XE 12.1.1.258 [IA-32]. I see an improvement in the core usage (up to 60%) but the crash with error message "Handler: Saw access violation" (no line number reported) is still happening. I will try to rebuild in debug mode to see if I can figure out why the crash is happening. It's an error message I've never seen before. This crash did not happen in release mode for Intel Visual Fortran Compiler 10.1.
0 Kudos
larryscheier
Beginner
449 Views
Ok, I have resolved the problem. The new compiler found a couple cases of "Dummy character variable has length greater than actual length" which happened when a dummy argument in a C routine was passing a variable string to a fortran subroutine expecting a fixed string. The "Handler: Saw access violation" error occured on a line in which the code was trying to change a dummy argument that was being passed in as a pre-defined constant, e.g.,

Call BadProgramming(.FALSE.)

Subroutine BadProgramming(FirstTimeFlag)
LOGICAL FirstTimeFlag
FirstTimeFlag = .TRUE.
...

Obviously, you can't change a constant.

I still have to run some different compiler options to see which results in the fastest speed.
0 Kudos
Reply