vsomeip icon indicating copy to clipboard operation
vsomeip copied to clipboard

Crash: client run at windows system ,server run at unbuntu system

Open caidy2018 opened this issue 4 years ago • 4 comments

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

client.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()

caidy2018 avatar Dec 10 '20 15:12 caidy2018

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.

caidy2018 avatar Dec 11 '20 13:12 caidy2018

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

caidy2018 avatar Dec 15 '20 14:12 caidy2018

i got the same issue.

miaozzZ avatar Jan 20 '21 12:01 miaozzZ

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

ghost avatar Jul 07 '21 10:07 ghost

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

fcmonteiro avatar Apr 14 '23 14:04 fcmonteiro