简单的qt(4.7.3)和开放式的(2.3.1)在2008年5月的节奏中用电终止:
...
The thread Win32 Thread (0x2418) has exited with code 0 (0x0).
The thread Win32 Thread (0x1cc4) has exited with code 0 (0x0).
The thread Win32 Thread (0xd7c) has exited with code 0 (0x0).
The thread Win32 Thread (0x2108) has exited with code 0 (0x0).
The thread Win32 Thread (0x17a0) has exited with code -1073741749 (0xc000004b).
The program [472] QtArrSurf.exe: Native has exited with code 0 (0x0).
0xC000004 页: 1 错误代码是指STATUS_THREAD_IS_TERMINAting (有人试图中止已经开始终止的胎面。)
方案来源代码:
#include <QtGui>
#include <opencv2/features2d/features2d.hpp>
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
QPushButton b("button");
b.show();
QFileDialog::getOpenFileNames(&b, "Dialog", "", "Files(*.png)"); // problem trigger
cv::SURF detectorSURF; // just to touch opencv
return a.exec();
}
If comment dialog everything goes smoothly without 0xc000004b and there is only one thread in program. When dialog is executed a number of threads are spawned, which does not close with dialog:
0 > 6192 Main Thread Main Thread main Normal 0
0 8928 Worker Thread Win32 Thread 77a01f36 Normal 0
0 4620 Worker Thread Win32 Thread 77a01f36 Normal 0
0 9800 Worker Thread Win32 Thread 77a01f36 Normal 0
0 7924 Worker Thread Win32 Thread 77a0014d Normal 0
0 3844 Worker Thread Win32 Thread 77a01f36 Normal 0
0 2524 RPC Thread RPC Callback Thread 779ffd81 Normal 0
0 3068 Worker Thread Win32 Thread 77a00552 Normal 0
...
What these threads are about? They have silent stacks, like this:
ntdll.dll!77a01f36()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!77a01f36()
ntdll.dll!77a2471e()
kernel32.dll!7587339a()
ntdll.dll!77a19ed2()
ntdll.dll!77a19ea5()
The place of interest is CvModule static object in opencv dll. OpenCV2.3.1modulescoresrcsystem.cpp:
CvModule cxcore_module( &cxcore_info );
在失败的情况下,我没有接触到他的主子,但(没有方言)确实如此。
情况为0xC000004 B. 实际问题?
Any suggestion where to look for solution?
感谢。