SURF detect crashed with TBB (Bug #1349)


Added by p x over 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:Andrey Kamaev % Done:

0%

Category:features2d
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

I updated and built OpenCV 2.32 SVN yesterday with the latest stable version of TBB using CMake 2.85 and Microsoft Visual Studio 2010 x64.

But SURF detect crashed in both cv cpp example code and my own program. It's my first time to build OpenCV with TBB, I followed the guide in the wiki. I've tried TBB3 in Intel C++ Composer XE, but it's the same problem.

Error Message:

Debug Assertion Failed!

Program: .......
Module: tbb_debug.dll
File: ../../src/tbb/mutex.cpp
Line: 43

Expression: false
mutex::scoped_lock: illegal mutex state

VS Call Stack(sorry for Chinese characters):

msvcr100d.dll!_CrtDbgBreak() 行 85 C

msvcr100d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x000000005a0b8520, int nLine=1019, const char * szModule=0x0000000000000000, const char * szFormat=0x0000000000000000, char * arglist=0x00000000086bebb8) 行 287 C
msvcr100d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x000000005a0b8520, int nLine=1019, const char * szModule=0x0000000000000000, const char * szFormat=0x0000000000000000, char * arglist=0x00000000086bebb8) 行 242 C
msvcr100d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x000000005a0b8520, int nLine=1019, const char * szModule=0x0000000000000000, const char * szFormat=0x0000000000000000, ...) 行 258 + 0x2c 字节 C
mfc100d.dll!AfxAssertFailedLine(const char * lpszFileName=0x000000005a0b8520, int nLine=1019) 行 25 + 0x27 字节 C++
mfc100d.dll!CWnd::DestroyWindow() 行 1019 + 0x3a 字节 C++
mfc100d.dll!CToolTipCtrl::DestroyToolTipCtrl() 行 76 C++
mfc100d.dll!AFX_MODULE_THREAD_STATE::~AFX_MODULE_THREAD_STATE() 行 372 C++
mfc100d.dll!AFX_MODULE_THREAD_STATE::@scalar deleting destructor'() + 0x17 字节 C++
mfc100d.dll!CThreadSlotData::DeleteValues(CThreadData * pData=0x0000000000272750, HINSTANCE+ * hInst=0x0000000000000000) 行 354 + 0x3d 字节 C++
mfc100d.dll!CThreadSlotData::DeleteValues(HINSTANCE+ * hInst=0x0000000000000000, int bAll=1) 行 396 C++
mfc100d.dll!AfxTermLocalData(HINSTANCE+ * hInst=0x0000000000000000, int bAll=1) 行 494 C++
mfc100d.dll!DllMain(HINSTANCE+ * hInstance=0x0000000059aa0000, unsigned long dwReason=0, void * formal=0x0000000000000001) 行 563 + 0xc 字节 C+
mfc100d.dll!+DllMainCRTStartup(void * hDllHandle=0x0000000059aa0000, unsigned long dwReason=0, void * lpreserved=0x0000000000000001) 行 512 + 0x13 字节 C
mfc100d.dll!_DllMainCRTStartup(void * hDllHandle=0x0000000059aa0000, unsigned long dwReason=0, void * lpreserved=0x0000000000000001) 行 477 C
ntdll.dll!0000000077a94371()
[下面的框架可能不正确和/或缺失,没有为 ntdll.dll 加载符号]
ntdll.dll!0000000077a94180()
msvcr100d.dll!+crtExitProcess(int status=3) 行 709 C
msvcr100d.dll!doexit(int code=3, int quick=1, int retcaller=0) 行 622 C
msvcr100d.dll!_exit(int code=3) 行 402 C
msvcr100d.dll!raise(int signum=22) 行 525 C
msvcr100d.dll!+crtMessageWindowA(int nRptType=2, const char * szFile=0x000007fef8808390, const char * szLine=0x00000000086c35e0, const char * szModule=0x000007fef88076c8, const char * szUserMessage=0x00000000086c45e0) 行 377 C
msvcr100d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x000007fef8808390, int nLine=43, const char * szModule=0x000007fef88076c8, const char * szFormat=0x000007fef88076bc, char * arglist=0x00000000086c5718) 行 417 + 0x59 字节 C
msvcr100d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x000007fef8808390, int nLine=43, const char * szModule=0x000007fef88076c8, const char * szFormat=0x000007fef88076bc, char * arglist=0x00000000086c5718) 行 242 C
msvcr100d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x000007fef8808390, int nLine=43, const char * szModule=0x000007fef88076c8, const char * szFormat=0x000007fef88076bc, ...) 行 258 + 0x2c 字节 C
tbb_debug.dll!tbb::assertion_failure(const char * filename=0x000007fef8808390, int line=43, const char * expression=0x000007fef8808388, const char * comment=0x000007fef8808360) 行 68 + 0x5c 字节 C++
tbb_debug.dll!tbb::mutex::scoped_lock::internal_acquire(tbb::mutex & m={...}) 行 50 C++
opencv_features2d232d.dll!tbb::mutex::scoped_lock::acquire(tbb::mutex & mutex={...}) 行 108 C++
opencv_features2d232d.dll!tbb::mutex::scoped_lock::scoped_lock(tbb::mutex & mutex={...}) 行 92 C++
opencv_features2d232d.dll!icvFindMaximaInLayer(const CvMat * sum=0x0000000001c5aae0, const CvMat * mask_sum=0x0000000000000000, const CvSURFParams * params=0x000000000332cdc0, CvMat * * dets=0x0000000003326a20, CvMat * * traces=0x0000000003327aa0, const int * sizes=0x0000000003328b20, int layer=4, int sampleStep=1, CvSeq * points=0x0000000001c7efd0) 行 360 + 0x14 字节 C++
opencv_features2d232d.dll!cv::SURFFindInvoker::operator()(const tbb::blocked_range<int> & range={...}) 行 425 C++
opencv_features2d232d.dll!tbb::internal::start_for<tbb::blocked_range<int>,cv::SURFFindInvoker,tbb::auto_partitioner>::execute() 行 100 C++
tbb_debug.dll!tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task & parent={...}, tbb::task * child=0x000007fffff4b340) 行 441 + 0x10 字节 C++
tbb_debug.dll!tbb::internal::arena::process(tbb::internal::generic_scheduler & s={...}) 行 93 C++
tbb_debug.dll!tbb::internal::market::process(rml::job & j={...}) 行 385 + 0xf 字节 C++
tbb_debug.dll!tbb::internal::rml::private_worker::run() 行 256 C++
tbb_debug.dll!tbb::internal::rml::private_worker::thread_routine(void * arg=0x000007fffff43e80) 行 224 C++
msvcr100d.dll!_callthreadstartex() 行 314 + 0x17 字节 C
msvcr100d.dll!_threadstartex(void * ptd=0x0000000003688dc0) 行 297 C
kernel32.dll!000000007786652d()
ntdll.dll!0000000077a9c521()

Associated revisions

Revision 8f970caa
Added by Andrey Kamaev almost 13 years ago

#1349 tbb::mutex is moved to outer scope to be sure that its initialization is completed before the parallel loop

Revision 8bb99940
Added by Roman Donchenko over 11 years ago

Merge pull request #1349 from ilya-lavrenov:ocl_perf_finish

History

Updated by jab - over 13 years ago

I encountered the same problem also using tbb30_20110704oss, Visual Studio 2010 x64 and the trunk version of openCV (20.10.2011).
Sometimes it seems to work though... but I could not find out yet, what it depends on.

Updated by p x about 13 years ago

Please check it. It's 4 months ago.

Updated by Alexander Shishkov about 13 years ago

  • Description changed from I updated and built [[OpenCV]] 2.32 SVN(trunk) yesterday with the latest stab... to I updated and built OpenCV 2.32 SVN(trunk) yesterday with the latest stable v... More

Updated by Alexander Shishkov about 13 years ago

  • Description changed from I updated and built OpenCV 2.32 SVN(trunk) yesterday with the latest stable v... to I updated and built OpenCV 2.32 SVN(trunk) yesterday with the latest stable v... More

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Alexander Shishkov almost 13 years ago

  • Assignee deleted (Maria Dimashova)

Updated by Andrey Kamaev almost 13 years ago

  • Assignee set to Andrey Kamaev

Updated by Andrey Kamaev almost 13 years ago

Thanks for reporting!

According to the attached stack trace there were an attempt to lock mutex from second thread before it was initialized. The problem should be fix in r7727.

  • Status changed from Open to Done

Updated by Alexander Shishkov almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF