Skip to content

Segmentation fault on closure of rqt with cpp plugin #258

Closed
@MatthijsBurgh

Description

@MatthijsBurgh

Running on noetic

When closing rqt, while a cpp plugin is still active, I get a segmentation fault or the following aborted.

terminate called after throwing an instance of 'boost::wrapexcept<boost::lock_error>'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted (core dumped)

The problem only occurs when the plugin is still active on closure. When you close the plugin manually before closing rqt, the problem doesn't occur.

I tried some more debugging on rqt_image_view. (I also experience the issue with mapviz, but I didn't do any debugging on that plugin.)

I figured out that the destructor is not being called when closing rqt with the plugin active. Or at least not being called before the segmentation fault occurs.

Debugging

As I wasn't able to get gdb working to debug the plugin as rqt runs in python.
I added some print statements to debug what happens. I just drop it here as it might help you to solve the issue.

When closing the cpp plugin(rqt_image_view) manually:

ImageView::callbackImage done
ImageView::saveSettings
ImageView::saveSettings done
PluginBridge::shutdown_plugin
PluginBridge::shutdown_plugin plugin_->removeEventFilter(this)
PluginBridge::shutdown_plugin plugin_->shutdownPlugin()
ImageView::shutdown
ImageView::shutdown done
PluginBridge::shutdown_plugin done
PluginBridge::unload_plugin
PluginProvider::unload_plugin
CompositePluginProvider::unload
CompositePluginProvider::unload
NodeletPluginProvider::unload
Unloading: rqt_image_view/ImageView_1
NodeletPluginProvider::shutdown
NodeletPluginProvider::RosSpinThread::run done
NodeletPluginProvider::shutdown done
NodeletPluginProvider::unload done
CompositePluginProvider::unload return
CompositePluginProvider::unload return
PluginProvider::unload_plugin done
PluginBridge::unload_plugin done
PluginBridge::~PluginBridge
PluginBridge::~PluginBridge done
NodeletPluginProvider::RosSpinThread::~RosSpinThread
NodeletPluginProvider::RosSpinThread::~RosSpinThread done
ImageView::destructor
ImageView::destructor done

When closing rqt with an active cpp plugin(rqt_image_view):

ImageView::callbackImage done
ImageView::saveSettings
ImageView::saveSettings done
PluginBridge::shutdown_plugin
PluginBridge::shutdown_plugin plugin_->removeEventFilter(this)
PluginBridge::shutdown_plugin plugin_->shutdownPlugin()
ImageView::shutdown
ImageView::shutdown done
PluginBridge::shutdown_plugin done
PluginProvider::shutdown
PluginProvider::shutdown done
CompositePluginProvider::shutdown
CompositePluginProvider::shutdown
NodeletPluginProvider::shutdown
NodeletPluginProvider::RosSpinThread::run done
NodeletPluginProvider::shutdown done
CompositePluginProvider::shutdown done
CompositePluginProvider::shutdown done
NodeletPluginProvider::RosSpinThread::~RosSpinThread
NodeletPluginProvider::RosSpinThread::~RosSpinThread done
PluginBridge::~PluginBridge
PluginBridge::~PluginBridge done
RosPluginlibPluginProvider::~RosPluginlibPluginProvider
RosPluginlibPluginProvider::~RosPluginlibPluginProvider done
PluginProvider::~PluginProvider
PluginProvider::~PluginProvider done
Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions