pcl
pcl copied to clipboard
PCLVisualizer::close() crash, and interactor_->SetDone(true) works
https://github.com/PointCloudLibrary/pcl/blob/f17f6ddb655b1545dd00686753828ebbb0aa3c4a/visualization/src/pcl_visualizer.cpp#L4329
i'm writing same feature with PCLVisualizer with delay close, just like opencv waitKey() function, and i find when call pcl::visualization::PCLVisualizer::close ()
will crash in interactor_->TerminateApp ();
and i also tried interactor_->ExitCallback ();
and crash too. butinteractor_->SetDone(true);
works.
example code:
crash in viewer_ptr_->close();
crash info:
[1] 209646 segmentation fault (core dumped) ./build/test_lidar_extract_plane_main --pcd_dir --debug=true
debug info: interactor_ type: 26vtkXRenderWindowInteractor
VTK vtkXRenderWindowInteractor::TerminateApp()
issue: https://gitlab.kitware.com/vtk/vtk/-/issues/18749
fixed in https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9686
@mvieth need your help in https://gitlab.kitware.com/vtk/vtk/-/issues/18749
crash version: VTK latest master, PCL latest master
@huanglilong I am not sure what you are asking me to do? Seems to me like it is the VTK maintainer's turn to investigate the problem, since it is likely on their side.
BTW I found a VTK example (https://kitware.github.io/vtk-examples/site/Cxx/Visualization/CloseWindow/) which (like PCLVisualizer::close()
) calls vtkRenderWindow::Finalize()
then vtkRenderWindowInteractor::TerminateApp()
. This example seems to have the same problem as you have.
to make sure https://github.com/PointCloudLibrary/pcl/blob/master/visualization/src/vtk/vtkRenderWindowInteractorFix.cpp is using the VTK version, and i has checked(so nothing need to do), with VTK9.2.2 PCL using the origin VTK version. so this is issue from VTK. @mvieth