vsomeip icon indicating copy to clipboard operation
vsomeip copied to clipboard

Replace 'this' with shared_from_this to prevent shutdown issues

Open kheaactua opened this issue 2 years ago • 4 comments

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

kheaactua avatar Nov 03 '23 16:11 kheaactua

I don't know is this PR is comprehensize enough, I would really appreciate Covesa's opinion on it.

kheaactua avatar Nov 03 '23 16:11 kheaactua

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.

vvcarvalho avatar Nov 10 '23 10:11 vvcarvalho

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.

kheaactua avatar Nov 10 '23 12:11 kheaactua

(I haven't forgot, just haven't been able to get to this yet)

kheaactua avatar Jan 03 '24 16:01 kheaactua