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

Librviz crashes when initialized after previous instance has been destroyed #816

Open
mdedonato opened this issue Sep 18, 2014 · 5 comments

Comments

@mdedonato
Copy link

When using lib rviz and following the hydro tutorial, I get the following error:

[ WARN] [1411074212.640251017]: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture SelectionTexture2 face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at /build/buildd/ogre-1.7.4/RenderSystems/GL/src/OgreGLTexture.cpp (line 406)
std::exception was caught

This error only occurs when trying to create an instance after another instance has been created and destroyed.

You can take a look at my test code here:

https://github.com/mdedonato/librviz_test

It is a modified version of the tutorial code that recreates the issue.

To recreate the issue, first compile and run the program. Then click the on button. This should bring up an rviz instance. Then click the off button. The instance is now destroyed. Now when you click the on button again the error appears.

I believe that something is being destroyed incorrectly in the librviz code.

@wjwwood
Copy link
Member

wjwwood commented Sep 19, 2014

Maybe related to: ros-visualization/rqt#96

@mdedonato
Copy link
Author

Note that the crash only happens after running the Visualizationmanager initialize function

@mdedonato
Copy link
Author

Has there been any progress on this? The issue does not seem to be related to the rqt bug.

@wjwwood
Copy link
Member

wjwwood commented Oct 6, 2014

@mdedonato No, I haven't had any time to work on this and I don't know exactly when I will have time. If you find anything else out please let us know.

@wjwwood wjwwood added the bug label Jan 28, 2015
@wjwwood wjwwood added this to the untargeted milestone Jan 28, 2015
@wjwwood wjwwood removed this from the untargeted milestone May 10, 2018
@Eberty
Copy link

Eberty commented Dec 17, 2018

I spent a few days studying this bug. It happens that when deleting the last instance of VisualizationManager (In your case you have only one) the program loses the reference to the SceneManager and therefore crashes when calling the method VisualizationManager::initialize(); (NOTE: if you have several widgets, you can delete several widgets and recreate them without crashes, as long as one of them still exists).

Note that this is something not handled by Rviz program (since it has a main 3d window that can never be destroyed/closed).

A workarround is would put the code:

    static rviz::VisualizationManager* manager = new rviz::VisualizationManager(new rviz::RenderPanel());
    manager->initialize();
    manager->startUpdate();

in your main (you do not need to create a widget for this VisualizationManager). This workaround make sure that an Librviz Visualization Manager is always disponible (not destroyed).

Now you can use the on/off button to destroy yor widget.

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

No branches or pull requests

3 participants