Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV 3.0 - investigate crash in release mode

Hello!

I work on an application that uses many OpenCV functions and I'm trying to make the transition to 3.0 since it's been released. I downloaded it from here: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download (I use VS2013.) Since 3.0 is mostly compatible with 2.x code, within a short time, I got a compiling code.

The strange thing is that it crashes in 64 bit in release mode: Unhandled exception at 0x000007FED0483430 (opencv_world300.dll) in XDesktopDev.exe: 0xC0000005: Access violation reading location 0x0000000000000048.

It happens here in my code on a line where Kalman filter is used (presumably within the predict() function?): Mat prediction = kalmanFilter.predict();

So I tried to debug the issue by running it in debug mode, but strangely, it doesn't crash in debug mode. I found this to be quite interesting since debug mode usually has additional asserts so I expected I could reproduce it in debug mode.

The next thing I tried to get additional information about the crash is I built OpenCV using cmake (so I get the pdb files needed for debug info). I used the source files from from the same package that I used for the binaries (linked above). I used mostly the default options for building, what I modified is that I selected to build opencv_world, because that's what is distributed in the OpenCV binaries (build\x64\vc12\lib) and that's what I used when the crash happened. And here comes the strange part: with my build, the crash doesn't happen (in the same 64 bit, release mode configuration). With that, I've pretty much ran out of ideas about how to investigate this crash. The only thing I can think of now is that maybe prebuilt binaries were built with different options (additional optimizations turned on?) that were off for me, but then again, I don't know what exact options were used for the prebuilt libs - is this information available anywhere?

BTW I also tried to run it in 32 bit, and it also doesn't crash that way, not in release, nor in debug mode.

So it looks like, this crash in only happening in 64 bit, only in release mode, only with the prebuilt libs. And I found no way how to investigate it further. Any tips?

Thanks