vsomeip
vsomeip copied to clipboard
Crash: client run at windows system ,server run at unbuntu system
I got a Crash at sentence "std::lock_guardstd::mutex its_lock(multicast_mutex_) at udp_server_endpoint_impl::join",Vistual Studio 2019 's stack stay at _MyMutex.lock() when crash occur. below is test step:
Step1: Run a application with vsomeip at unbuntu side as server, config file is server.txt server.txt
Step2: Run another application with vsomeip at windows side as client. config file is client.txt
Phenomenon: after a while, the windows console print "Didn't receive a multicast SD message for", then Vistual Studio 2019 crash at funtion udp_server_endpoint_impl::join()
In Version 3.1.20.1 have been fix "Do not lock the multicast mutex twice" , but I update vsomeip to 3.1.20.2, the issue still exist.
I found can avoid the windows crash when can't receive multicast message.
modify service_discovery_impl::on_last_msg_received_timer_expired by below: befer: #ifndef ANDROID reinterpret_cast<udp_server_endpoint_impl*>( endpoint_.get())->join(sd_multicast_); #else dynamic_cast<udp_server_endpoint_impl*>( endpoint_.get())->join(sd_multicast_); #endif
after: #if defined(WIN32) || defined(ANDROID) dynamic_cast<udp_server_endpoint_impl*>( its_service_endpoint.get())->join(sd_multicast); #else reinterpret_cast<udp_server_endpoint_impl*>( its_service_endpoint.get())->join(sd_multicast_); #endif
i got the same issue.
Hello, Same here (execpt that server is on window and client on embedded linux), From the tag 3.1.20.3 The proposed solution seems to work however I think that there is also another place where the issue is.
- service_discovery_impl::start()
- service_discovery_impl::on_last_msg_received_timer_expired()
I finally make different modification, I simply removed the #ifdef and only use dynamic_cast for these two functions which is working.
I'm wondering why there is a reinterpret_cast here ? is it for runtime optimisation reason ?
Here is my patch service_discovery_impl.cpp.patch.md
Hi all, Do you still have this issue with vSomeIP 3.3? We made a lot of changes regarding the multicast since 3.1. Thanks
cc: @goncaloalmeida