Program that uses OpenCV crashes when page heap is enabled
I would like to enable page heap validation in my application that uses OpenCV-2.4.8 in order to track possible heap corruption problems. I use gflags.exe from Windows Debugging Tools to do that by calling:
gflags /p /enable MyApp.exe /full
So when I enable page heap and run the app I get error:
Unhandled exception at 0x00000000778B08C5 (ntdll.dll) in AvaloqOCRServicesTestApp.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
What am I doing wrong? :(
Apparently this only happens when I include opencv dlls, actual program can be completely empty.
#include <opencv2\opencv.hpp>
int main() {
// Empty...
}
Otherwise, if do not enable page heap everything works fine. I really need to run my app, with having page heap enabled, because I might have heap corruption in my code that only appears on android devices and it is very hard to reproduce. That is why I have ported the code to Windows platform so I can use heap verification tools. I am starting to be quite desperate... :/
BTW I am using Win7 x64 & Visual Studio 2013.
Looking forward to your advice and help :)