vsomeip
vsomeip copied to clipboard
Replace 'this' with shared_from_this to prevent shutdown issues
This change appears to reduce but not entirely eliminate crashes on SIGTERM.
The key signature of the crash appears to be:
#34 vsomeip_v3::routing_manager_impl::expire_subscriptions (this=0x1962493058, _force=false) at implementation/routing/src/routing_manager_impl.cpp:3307 #35 0x0000004ec2948f2c in vsomeip_v3::sd::service_discovery_impl::expire_subscriptions (_error=..., this=0x19624985c8) at implementation/service_discovery/src/service_discovery_impl.cpp:2828
I don't know is this PR is comprehensize enough, I would really appreciate Covesa's opinion on it.
I'm not sure about this change, given we are inverting the lifetime of the parent object (service_discovery) and the child object (timers). If the timers are causing some of the crashes, it may be better to handle stopping the timers on shutdown or even put it into the destructor, instead of extending the lifetime of service_discovery data.
I'm not sure about this change, given we are inverting the lifetime of the parent object (service_discovery) and the child object (timers). If the timers are causing some of the crashes, it may be better to handle stopping the timers on shutdown or even put it into the destructor, instead of extending the lifetime of service_discovery data.
I can give that a try. I'm not yet up and running with 3.4.9-r1 on QNX (still migrating to our 7.1 with io-pkt), but I have 3.3.8 running well.
(I haven't forgot, just haven't been able to get to this yet)