Open ehong-tl opened 5 years ago
Can you do "bt
" (backtrace) when it crashes in gdb?
@matlabbe
Thsi is the output from bt
after crashed in gdb
.
(gdb) bt
#0 0x00007fffcf7ff47b in vtkSmartPointerBase::~vtkSmartPointerBase() ()
from /usr/lib/x86_64-linux-gnu/libvtkCommonCore-6.2.so.6.2
#1 0x00007fffcf7ff5b7 in vtkSmartPointerBase::operator=(vtkSmartPointerBase const&) () from /usr/lib/x86_64-linux-gnu/libvtkCommonCore-6.2.so.6.2
#2 0x00007fffeceb51ba in pcl::visualization::PCLVisualizerInteractorStyle::Initialize() () from /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.7
#3 0x00007fffeceec9ba in pcl::visualization::PCLVisualizer::PCLVisualizer(int&, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pcl::visualization::PCLVisualizerInteractorStyle*, bool) ()
from /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.7
#4 0x00007fffed4af849 in rtabmap::CloudViewer::CloudViewer(QWidget*, rtabmap::CloudViewerInteractorStyle*) () from /usr/local/lib/librtabmap_gui.so.0.19
#5 0x00007fffed2f6abd in rtabmap::MainWindow::MainWindow(rtabmap::PreferencesDialog*, QWidget*, bool) () from /usr/local/lib/librtabmap_gui.so.0.19
#6 0x0000000000528545 in rtabmap_ros::GuiWrapper::GuiWrapper(int&, char**) ()
#7 0x00000000005226d4 in main ()
Hi, This bug is related to PCL visualizer when initializing the Interactor. Not sure if it is related, but you can try to uncomment the first line and comment the second line here: https://github.com/introlab/rtabmap/blob/b5f5623af4fe23580d5d9077c454b615d81f0977/guilib/src/CloudViewer.cpp#L161-L162
// Replaced by the second line, to avoid a crash in Mac OS X on close, as well as
// the "Invalid drawable" warning when the view is not visible.
//_visualizer->setupInteractor(this->GetInteractor(), this->GetRenderWindow());
this->GetInteractor()->SetInteractorStyle (_visualizer->getInteractorStyle());
then rebuild/install rtabmap library.
cheers, Mathieu
Hi @matlabbe
I tried your method, still doesn't fix the issue,
Thread 1 "rtabmapviz" received signal SIGSEGV, Segmentation fault.
0x00007fffcf7ff477 in vtkSmartPointerBase::~vtkSmartPointerBase() ()
from /usr/lib/x86_64-linux-gnu/libvtkCommonCore-6.2.so.6.2
(gdb) bt
#0 0x00007fffcf7ff477 in vtkSmartPointerBase::~vtkSmartPointerBase() ()
from /usr/lib/x86_64-linux-gnu/libvtkCommonCore-6.2.so.6.2
#1 0x00007fffcf7ff5b7 in vtkSmartPointerBase::operator=(vtkSmartPointerBase const&) () from /usr/lib/x86_64-linux-gnu/libvtkCommonCore-6.2.so.6.2
#2 0x00007fffeceb51ba in pcl::visualization::PCLVisualizerInteractorStyle::Initialize() () from /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.7
#3 0x00007fffeceec9ba in pcl::visualization::PCLVisualizer::PCLVisualizer(int&, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pcl::visualization::PCLVisualizerInteractorStyle*, bool) ()
from /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.7
#4 0x00007fffed4af919 in rtabmap::CloudViewer::CloudViewer(QWidget*, rtabmap::CloudViewerInteractorStyle*) () from /usr/local/lib/librtabmap_gui.so.0.19
#5 0x00007fffed2f6b8d in rtabmap::MainWindow::MainWindow(rtabmap::PreferencesDialog*, QWidget*, bool) () from /usr/local/lib/librtabmap_gui.so.0.19
#6 0x0000000000528545 in rtabmap_ros::GuiWrapper::GuiWrapper(int&, char**) ()
#7 0x00000000005226d4 in main ()
There is something in pcl::visualization::PCLVisualizerInteractorStyle::Initialize()
that goes wrong. In rtabmap side, it seems crashing on PCLVisualizer constructor here:
_visualizer = new pcl::visualization::PCLVisualizer(
argc,
0,
"PCLVisualizer",
style,
false);
Based on the constructor declaration:
PCLVisualizer (
int &argc,
char **argv,
const std::string &name="",
PCLVisualizerInteractorStyle *style=PCLVisualizerInteractorStyle::New(),
const bool create_interactor=true)
I don't know if it is related to last param set to false or the style object. You may try the default constructor.
cheers, Mathieu
Hi @matlabbe
I've tried using the default constructor as you suggested, it made matter worse. Now I got Segmentation Fault
when trying to run standalone rtabmap
too.
Thread 1 "rtabmap" received signal SIGSEGV, Segmentation fault.
0x00007ffff79b2af0 in rtabmap::CloudViewer::CloudViewer(QWidget*, rtabmap::CloudViewerInteractorStyle*) () from /usr/local/lib/librtabmap_gui.so.0.19
(gdb) bt
#0 0x00007ffff79b2af0 in rtabmap::CloudViewer::CloudViewer(QWidget*, rtabmap::CloudViewerInteractorStyle*) () from /usr/local/lib/librtabmap_gui.so.0.19
#1 0x00007ffff77f9b3d in rtabmap::MainWindow::MainWindow(rtabmap::PreferencesDialog*, QWidget*, bool) () from /usr/local/lib/librtabmap_gui.so.0.19
#2 0x0000000000406f18 in main ()
The standalone was working... not sure why rtabmapviz cannot work too (maybe caused by some ROS dependencies linking on different version of the same library). A workaround is to use RVIZ for visualization instead (you can add rtabmap_ros/MapCloud display to see the 3D map).
Hi @matlabbe ,
Ok thanks, I will use RVIZ instead for visualization.
I encounter segmentation fault when trying to run
rosrun rtabmap_ros rtabmapviz
.I try to run with
gdb
and the output is as follows.It does not occur every time, some time
rtabmapviz
can open successfully, but most of the time I get segmentation fault. However, I have no problem running standalonertabmap
.Need help to fix this issue. Thanks.