Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Commit f5d9ec2

Browse files
vsomeip 2.10.19
1 parent 8b950eb commit f5d9ec2

File tree

4 files changed

+53
-34
lines changed

4 files changed

+53
-34
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changes
22
=======
33

4+
v2.10.19
5+
- Catch exceptions on shutdown (especially from boost::log)
6+
- Fixed handling of malformed packets in TCP client endpoint in conjunction
7+
with magic cookies
8+
49
v2.10.18
510
- Fix restarting of TCP connection on connection reset by the server
611
and mark services reachable through it as unavailable until

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project (vsomeip)
88

99
set (VSOMEIP_MAJOR_VERSION 2)
1010
set (VSOMEIP_MINOR_VERSION 10)
11-
set (VSOMEIP_PATCH_VERSION 18)
11+
set (VSOMEIP_PATCH_VERSION 19)
1212
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
1313
set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentatin/doxygen.in
1414
set (CMAKE_VERBOSE_MAKEFILE off)

implementation/endpoints/src/tcp_client_endpoint_impl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ void tcp_client_endpoint_impl::receive_cbk(
507507
_recv_buffer_size -= its_offset;
508508
its_iteration_gap += its_offset;
509509
has_full_message = true; // trigger next loop
510+
} else {
511+
_recv_buffer_size = 0;
512+
its_missing_capacity = 0;
510513
}
511514
} else {
512515
VSOMEIP_ERROR << "tce::c<" << this

implementation/runtime/src/application_impl.cpp

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,46 +1875,57 @@ void application_impl::shutdown() {
18751875
is_dispatching_ = false;
18761876
dispatcher_condition_.notify_all();
18771877
}
1878-
{
1879-
std::lock_guard<std::mutex> its_lock(dispatcher_mutex_);
1880-
for (auto its_dispatcher : dispatchers_) {
1881-
if (its_dispatcher.second->get_id() != stop_caller_id_) {
1882-
if (its_dispatcher.second->joinable()) {
1883-
its_dispatcher.second->join();
1878+
1879+
try {
1880+
1881+
{
1882+
std::lock_guard<std::mutex> its_lock(dispatcher_mutex_);
1883+
for (auto its_dispatcher : dispatchers_) {
1884+
if (its_dispatcher.second->get_id() != stop_caller_id_) {
1885+
if (its_dispatcher.second->joinable()) {
1886+
its_dispatcher.second->join();
1887+
}
1888+
} else {
1889+
// If the caller of stop() is one of our dispatchers
1890+
// it can happen the shutdown mechanism will block
1891+
// as that thread probably can't be joined. The reason
1892+
// is the caller of stop() probably wants to join the
1893+
// thread once call start (which got to the IO-Thread)
1894+
// and which is expected to return after stop() has been
1895+
// called.
1896+
// Therefore detach this thread instead of joining because
1897+
// after it will return to "main_dispatch" it will be
1898+
// properly shutdown anyways because "is_dispatching_"
1899+
// was set to "false" here.
1900+
its_dispatcher.second->detach();
18841901
}
1885-
} else {
1886-
// If the caller of stop() is one of our dispatchers
1887-
// it can happen the shutdown mechanism will block
1888-
// as that thread probably can't be joined. The reason
1889-
// is the caller of stop() probably wants to join the
1890-
// thread once call start (which got to the IO-Thread)
1891-
// and which is expected to return after stop() has been
1892-
// called.
1893-
// Therefore detach this thread instead of joining because
1894-
// after it will return to "main_dispatch" it will be
1895-
// properly shutdown anyways because "is_dispatching_"
1896-
// was set to "false" here.
1897-
its_dispatcher.second->detach();
18981902
}
1903+
availability_handlers_.clear();
1904+
running_dispatchers_.clear();
1905+
elapsed_dispatchers_.clear();
1906+
dispatchers_.clear();
18991907
}
1900-
availability_handlers_.clear();
1901-
running_dispatchers_.clear();
1902-
elapsed_dispatchers_.clear();
1903-
dispatchers_.clear();
1904-
}
19051908

1906-
if (routing_)
1907-
routing_->stop();
1909+
if (routing_)
1910+
routing_->stop();
19081911

1909-
work_.reset();
1910-
io_.stop();
1912+
work_.reset();
1913+
io_.stop();
19111914

1912-
{
1913-
std::lock_guard<std::mutex> its_lock_start_stop(start_stop_mutex_);
1914-
for (auto t : io_threads_) {
1915-
t->join();
1915+
{
1916+
std::lock_guard<std::mutex> its_lock_start_stop(start_stop_mutex_);
1917+
for (auto t : io_threads_) {
1918+
t->join();
1919+
}
1920+
io_threads_.clear();
19161921
}
1917-
io_threads_.clear();
1922+
#ifndef _WIN32
1923+
} catch (const boost::log::v2_mt_posix::system_error &e) {
1924+
std::cerr << "catched boost::log system_error in stop thread" << std::endl <<
1925+
boost::current_exception_diagnostic_information();
1926+
#endif
1927+
} catch (const std::exception &e) {
1928+
VSOMEIP_ERROR << "application_impl::shutdown() catched exception: " << e.what();
19181929
}
19191930
}
19201931

0 commit comments

Comments
 (0)