Segfault on quitting viz3d using the 'q' key
The same problem occurred on both of my Ubuntu and Windows machines, i.e., when I run the viz3d tutorial example and hit the 'q' key to quit, exceptions are thrown. But if I press 'e' instead, no error happens.
So for Windows, I have Windows-8_x64 + qt-5.3 + vtk-6.1.0 + opencv-2.4.10. When I run the example, the error is like:
Unhandled exception at 0x00007FFBBCD8A776 (opencv_viz2410d.dll) in testViz.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
And the Visual Studio debugger takes me to the function in vizimpl.cpp:
void cv::viz::Viz3d::VizImpl::ExitCallback::Execute(vtkObject*,
unsigned long event_id,
void*)
{
if (event_id == vtkCommand::ExitEvent)
{
viz->interactor_->TerminateApp();
viz->interactor_ = 0;
}
}
For Ubuntu, I have Ubuntu-12.04_x64 + qt-5.0.2 + vtk-6.1.0 + opencv-2.4.9, and the error is "Segmentation fault (core dumped)".
The stack of the QtCreator debugger GDB offered more insight:
0 cv::viz::Viz3d::VizImpl::ExitCallback::Execute(vtkObject, unsigned long, void) /usr/local/lib/libopencv_viz.so.2.4 0x7ffff7bb6048
1 vtkSubjectHelper::InvokeEvent vtkObject.cxx 620 0x7ffff5f20286
2 vtkObject::InvokeEvent vtkObject.cxx 789 0x7ffff5f20795
3 vtkRenderWindowInteractor::ExitCallback vtkRenderWindowInteractor.cxx 296 0x7ffff1fb5870
4 vtkInteractorStyle::OnChar vtkInteractorStyle.cxx 702 0x7ffff2006b4a
5 cv::viz::vtkVizInteractorStyle::OnChar() /usr/local/lib/libopencv_viz.so.2.4 0x7ffff7bc2193
6 vtkInteractorStyle::ProcessEvents vtkInteractorStyle.cxx 1145 0x7ffff20087dc
7 vtkCallbackCommand::Execute vtkCallbackCommand.cxx 42 0x7ffff5dbe02d
8 vtkSubjectHelper::InvokeEvent vtkObject.cxx 620 0x7ffff5f20286
9 vtkObject::InvokeEvent vtkObject.cxx 789 0x7ffff5f20795
10 vtkXRenderWindowInteractorCallback vtkXRenderWindowInteractor.cxx 857 0x7ffff15a4097
11 XtDispatchEventToWidget /usr/lib/x86_64-linux-gnu/libXt.so.6 0x7fffe805d256
12 ?? /usr/lib/x86_64-linux-gnu/libXt.so.6 0x7fffe805d9e6
13 XtDispatchEvent /usr/lib/x86_64-linux-gnu/libXt.so.6 0x7fffe805daa4
14 vtkXRenderWindowInteractor::Start vtkXRenderWindowInteractor.cxx 300 0x7ffff15a2259
15 cv::viz::Viz3d::VizImpl::spinOnce(int, bool) /usr/local/lib/libopencv_viz.so.2.4 0x7ffff7bb66af
16 main testViz.cpp 109 0x403eb3
So does someone have any idea, or get the same error? Could this be some bug in the viz module?
I am wondering where those keys are defined. Looking at the sample there is no input grabbing right? Or are they hardcoded in the viz module?
@StevenPuttemans, these keys are defined in "4 vtkInteractorStyle::OnChar vtkInteractorStyle.cxx" which is inside "VTK-6.1.0/Rendering/core/". It seems like something went wrong between VTK and viz3d.
Aha probably indeed somewhere a misfunctioning wrapper ... you are up to digging deeper and looking for the origin of the bug?
Yeah sounds good. I'll first try with the latest build and see if it's still there. If so, I will raise a ticket and keep digging..
Thank you in advance!