Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Strange crashes during deallocation of std::vector (VS2015, Windows 7)

Hey all,

I'm running OpenCV 2.4.11 on Windows 7, compiling with Visual Studio 2015.

I've found that during several function calls (to Stitcher::Stich and cv::findContours, for example), there is a critical memory error that causes the program to crash consistently.

For these errors, I get an error like the following in visual studio:

Debug Assertion Failed!

Program: ...a\code\my-project\software\Debug\my-project.exe
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0
Line: 116

Expression: "reinterpret_cast<uintptr_t *>(_Ptr_ptr)[-1] == _BIG_ALLOCATION_SENTINEL" && 0

When I follow the call stack to find out where the crash happened, it always happens at the end of a function when local variables go out of scope. The error is usually on the line:

my-project.exe!std::_Deallocate<cv::Point_<int> >(cv::Point_<int> * _Ptr, unsigned __int64 _Count) Line 114 C++

or similar (I believe when I call Sticher::stitch the crash is for a vector of type cv::DMatch rather than cv::Point).

If I comment out the specific lines (such as cv::findContours), the program runs just fine. In fact, the program works just fine until cv::findContours actually finds a contour; in this case it immediately crashes with the above memory errors.

I've checked that I have the right .dll files, and I do -- I'm wondering if perhaps I need to rebuild OpenCV for Visual Studio 2015? I'm not sure what else would be causing this problem.

thanks!

Strange crashes during deallocation of std::vector (VS2015, Windows 7)

Hey all,

I'm running OpenCV 2.4.11 on Windows 7, compiling with Visual Studio 2015.

I've found that during several function calls (to Stitcher::Stich and cv::findContours, for example), there is a critical memory error that causes the program to crash consistently.

For these errors, I get an error like the following in visual studio:

Debug Assertion Failed!

Program: ...a\code\my-project\software\Debug\my-project.exe
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0
Line: 116

Expression: "reinterpret_cast<uintptr_t *>(_Ptr_ptr)[-1] == _BIG_ALLOCATION_SENTINEL" && 0

When I follow the call stack to find out where the crash happened, it always happens at the end of a function when local variables go out of scope. The error is usually on the line:

my-project.exe!std::_Deallocate<cv::Point_<int> >(cv::Point_<int> * _Ptr, unsigned __int64 _Count) Line 114 C++

or similar (I believe when I call Sticher::stitch the crash is for a vector of type cv::DMatch rather than cv::Point).

If I comment out the specific lines (such as cv::findContours), the program runs just fine. In fact, the program works just fine until cv::findContours actually finds a contour; in this case it immediately crashes with the above memory errors.

I've checked that I have the right .dll files, and I do -- I'm wondering if perhaps I need to rebuild OpenCV for Visual Studio 2015? I'm not sure what else would be causing this problem.

thanks!