pcl icon indicating copy to clipboard operation
pcl copied to clipboard

PCLVisualizer::close() crash, and interactor_->SetDone(true) works

Open huanglilong opened this issue 1 year ago • 5 comments

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(); image

crash info: [1] 209646 segmentation fault (core dumped) ./build/test_lidar_extract_plane_main --pcd_dir --debug=true

debug info: interactor_ type: 26vtkXRenderWindowInteractor

huanglilong avatar Dec 15 '22 13:12 huanglilong

VTK vtkXRenderWindowInteractor::TerminateApp() issue: https://gitlab.kitware.com/vtk/vtk/-/issues/18749

huanglilong avatar Dec 16 '22 01:12 huanglilong

fixed in https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9686

huanglilong avatar Dec 18 '22 02:12 huanglilong

@mvieth need your help in https://gitlab.kitware.com/vtk/vtk/-/issues/18749

crash version: VTK latest master, PCL latest master

huanglilong avatar Dec 19 '22 02:12 huanglilong

@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.

mvieth avatar Dec 22 '22 10:12 mvieth

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

huanglilong avatar Dec 22 '22 10:12 huanglilong