vsomeip icon indicating copy to clipboard operation
vsomeip copied to clipboard

Fix two destruction order issues causing segfaults during shutdown

Open hefroy opened this issue 1 year ago • 1 comments

  1. application_impl::~application_impl calls the plugin_manager when VSOMEIP_ENABLE_MULTIPLE_ROUTING_MANAGERS is not defined. Therefore it should hold a shared_ptr to it instead of calling plugin_manager::get() in the destructor, in order to prevent the global the_plugin_manager__ instance being destroyed before it is.
  2. routing_manager_impl::~routing_manager_impl calls utility functions. Therefore destroy the routing_ instance in application_impl::shutdown to ensure that this happens before the utility global variables are destroyed.

hefroy avatar Oct 21 '24 12:10 hefroy

For reference, this patch is being used over in https://github.com/aws/aws-iot-fleetwise-edge See the patch file here: https://github.com/aws/aws-iot-fleetwise-edge/blob/a6bfb5176eb0a954b436473802de3221b815be7e/tools/patches/vsomeip_allow_static_libs_fix_shutdown_segfaults.patch

hefroy avatar Dec 16 '24 04:12 hefroy