Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when closing RViz by quitting the application #17

Open
Pietroro opened this issue Jan 27, 2021 · 0 comments
Open

Segmentation fault when closing RViz by quitting the application #17

Pietroro opened this issue Jan 27, 2021 · 0 comments

Comments

@Pietroro
Copy link

Pietroro commented Jan 27, 2021

Hi, first of all let me just say thank you for the work you have done on this, it is a very useful plugin!

We have been using the plugin for a while now and up until recently I never noticed that when exiting RViz the "intended" way by closing the window or quitting the application (instead of just Ctrl-Cing out of the rosrun or roslaunch) the display causes a segmentation fault. This only happens when an image topic actually published some images that were picked up by the textured quad display.

This is my best guess for what is causing it:
Debugging via GDB pointed me to a call in RViz to SceneManager::destroyAllMovableObjects() called when closing the application and causing a segmentation fault. I have tracked it down to the delete operations of the camera display destructor.

  unsubscribe();
  delete manual_objects_;          --> "Pointer to an Ogre::ManualObject (in this case our textured plane)"
  delete decal_frustums_;
  delete textures_;
  delete mesh_nodes_;              --> "Pointer to an Ogre::SceneNode containing the mesh "

  for (size_t i = 0; i < filter_frustums_.size(); ++i)
    delete filter_frustums_[i];

  [...]

The two marked lines are the problematic ones. My best guess is that the Ogre engine (or RViz itself for that matter) has some sort of garbage collection system upon closing the app. Removing the lines and instead destroying the manual objects via SceneManager::destroySceneNode() (After checking that mesh_nodes is not NULL) has been working as a fix for now.

I have also tested the problem in a clean Ubuntu 20.04 install, publishing a simple image using image_publisher and launching your demo.launch file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant