[RVIZ] Interactive marker client threading issues [closed]

asked 2013-10-23 06:25:04 -0500

mklingen gravatar image

So, I have an interactive marker server, and RVIZ as an interactive marker client (in Fuerte). I also have several threaded nodes running which are calling ros::SpinOnce() in different threads. It seems that the interactive marker client in RVIZ is just using the global callback queue to handle its updates, rather than keeping its own callback queue.

This would be okay, except for the fact that interactive markers make liberal use of the openGL context to create and destroy openGL texture data (particularly for labels). So, this results in segfaults all the time when OpenGL context is being used, and multiple threads are calling ros::SpinOnce. Since I don't own the library calling SpinOnce, what are my options to prevent such segfaults?

This is the offending stack trace, btw, when a marker is getting deleted by the marker server:

#0  0x00007fffd1166949 in glDeleteBuffersARB () from /usr/lib/nvidia-304/libGL.so.1
#1  0x00007fff6d3ca388 in Ogre::GLHardwareVertexBuffer::~GLHardwareVertexBuffer (this=0x7fff6deaad78, __in_chrg=<optimized out>)
    at /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/RenderSystems/GL/src/OgreGLHardwareVertexBuffer.cpp:60
#2  0x00007fff6d3ca3b9 in Ogre::GLHardwareVertexBuffer::~GLHardwareVertexBuffer (this=0x7fff6deaad78, __in_chrg=<optimized out>)
    at /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/RenderSystems/GL/src/OgreGLHardwareVertexBuffer.cpp:61
#3  0x00007fffd346678f in Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::destroy (this=0x7fff6ddb6f20)
    at /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/include/OgreSharedPtr.h:232
#4  0x00007fffd34fecc0 in release (this=0x7fff6ddb6f20)
    at /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/include/OgreSharedPtr.h:218
#5  ~SharedPtr (this=0x7fff6ddb6f20, __in_chrg=<optimized out>)
    at /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/include/OgreSharedPtr.h:155
#6  ~HardwareVertexBufferSharedPtr (this=0x7fff6ddb6f20, __in_chrg=<optimized out>)
    at /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/include/OgreHardwareVertexBuffer.h:74
#7  ~pair (this=0x7fff6ddb6f18, __in_chrg=<optimized out>) at /usr/include/c++/4.6/bits/stl_pair.h:87
#8  destroy (p=0x7fff6ddb6f18, this=<optimized out>)
    at /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/include/OgreMemorySTLAllocator.h:169
#9  _M_destroy_node (__p=0x7fff6ddb6ef8, this=<optimized out>) at /usr/include/c++/4.6/bits/stl_tree.h:394
#10 std::_Rb_tree<unsigned short, std::pair<unsigned short const, Ogre::HardwareVertexBufferSharedPtr>, std::_Select1st<std::pair<unsigned short const, Ogre::HardwareVertexBufferSharedPtr> >, std::less<unsigned short>, Ogre::STLAllocator<std::pair<unsigned short const, Ogre::HardwareVertexBufferSharedPtr>, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > >::_M_erase (
    this=0x7fff6ddb6de0, __x=0x7fff6ddb6ef8) at /usr/include/c++/4.6/bits/stl_tree.h:1076
#11 0x00007fffd34fece8 in std::_Rb_tree<unsigned short, std::pair<unsigned short const, Ogre::HardwareVertexBufferSharedPtr>, std::_Select1st<std::pair<unsigned short const, Ogre::HardwareVertexBufferSharedPtr> >, std::less<unsigned short>, Ogre::STLAllocator<std::pair<unsigned short const, Ogre::HardwareVertexBufferSharedPtr>, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > >::_M_erase (this=0x7fff6ddb6de0, __x=0x7fff6ddb6e68) at /usr/include/c++/4.6 ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by jacobperron
close date 2020-12-18 13:38:30.397034