user1805103
user1805103

Reputation: 129

_CrtIsValidHeapPointer(block) exception on load

I am trying to migrate a VS2012 WinForm application to VS2015 as am getting an exception as soon as the the application starts to load. I am hoping for some help in figuring out what the issue is.

The basic application uses VS2012 C++/CLI with OpenCV, CUDA, and two other libraries. When run in debug mode, things worked fine.

Now, I am migrating the app to VS2015. I upgraded the project and recompiled each library using VS2015 in debug mode. With one of the helpful suggestions, I also ran AppVerif. Now, I get the following error as soon as the app tries to load:

....
'SV11.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cudart64_80.dll'. Module was built without symbols.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_imgproc320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_calib3d320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_stitching320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_imgcodecs320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_xfeatures2d320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_cudaarithm320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_cudaimgproc320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_cudawarping320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\concrt140d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_flann320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_cudafeatures2d320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_cudalegacy320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nppc64_80.dll'. Module was built without symbols.
'SV11.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nppi64_80.dll'. Module was built without symbols.
'SV11.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cufft64_80.dll'. Module was built without symbols.
'SV11.exe' (Win32): Loaded 'C:\OpenCV\opencv\build\bin\Debug\opencv_cudafilters320d.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\npps64_80.dll'. Module was built without symbols.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\msvcr120_clr0400.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. Symbols loaded.
'SV11.exe' (Win32): Unloaded 'C:\Windows\System32\psapi.dll'
'SV11.exe' (Win32): Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\8b6060e8b4fb6d9cd49ef13963733d06\mscorlib.ni.dll'. 
'SV11.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. Symbols loaded.

SV11.exe has triggered a breakpoint.

'SV11.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\Administrator\Documents\Visual Studio 2012\Projects\SV11\x64\Debug\SV11.exe'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll'. Symbols loaded.
'SV11.exe' (Win32): Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_64\System\8b3ae8328c7d1d423a4331cdf2af5eee\System.ni.dll'. 
'SV11.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Symbols loaded.

Exception thrown at 0x00007FFE3F2C2496 (verifier.dll) in SV11.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.


=======================================
VERIFIER STOP 000000000000000C: pid 0x580: Exception raised while verifying the heap block. 

000002A17BAF1000 : Heap handle used in the call.
3605D8E8000189EC : Heap block involved in the operation.
0000000000000000 : Size of the heap block.
00000000C0000005 : Reserved.


=======================================
This verifier stop is not continuable. Process will be terminated 
when you use the `go' debugger command.

=======================================

SV11.exe has triggered a breakpoint.

Here is a screen shot of the call stack:

enter image description here

I have seen stuff saying that these kinds of errors can come about from mixing code compiled in Release and Debug modes. I do not think that is the case because everything was compiled in debug mode specifying "multi-threaded debug dll" where appropriate. Here is a screen shot of one of the library properties: enter image description here

So, my question is how can I figure out what the problem is? I have also seen stuff mentioning mixing managed and unmanaged code. However, I do not think that is it because the same code ran fine using VS2012. One thing I do see is a reference to msvcr120 which I think is associated with VS2012 not vs2105.

Any help appreciated.

Upvotes: 0

Views: 852

Answers (1)

mksteve
mksteve

Reputation: 13085

Run using application verifier.. This is a tool which checks for correctness the code which is running.

The access violation and the debug heap assertion are separate failures. When running under application verifier with a debugger attached, it should break with a callstack which better describes the problem, and should simplify the search for what is going wrong.

Upvotes: 1

Related Questions