From d9e33783179c5e88a38629451206860d01344a1d Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 9 Oct 2023 11:18:04 -0500 Subject: [PATCH 1/4] GitHub Actions: try using apt-get update --- .github/workflows/build_and_test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 71d56573442..7fe3872134b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -4384,6 +4384,8 @@ jobs: run: | tar xvJf openssl3_u20.tar.xz rm -f openssl3_u20.tar.xz + - name: Update apt indexes + run: sudo apt-get -y update - name: install xerces and valgrind run: sudo apt-get -y install libxerces-c-dev valgrind - name: checkout MPC From 5f21f4bce2530887008fc315929c970043d8d720 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 9 Oct 2023 11:11:38 -0500 Subject: [PATCH 2/4] ReactorTask: fixed tsan warning --- dds/DCPS/ReactorTask.cpp | 26 +++++++++++--------------- dds/DCPS/ReactorTask.h | 1 + dds/DCPS/ReactorTask.inl | 7 +++++++ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/dds/DCPS/ReactorTask.cpp b/dds/DCPS/ReactorTask.cpp index dc197908184..bebfa7d0232 100644 --- a/dds/DCPS/ReactorTask.cpp +++ b/dds/DCPS/ReactorTask.cpp @@ -162,7 +162,7 @@ int ReactorTask::svc() // Tell the reactor to handle events. if (thread_status_manager_->update_thread_status()) { - while (state_ == STATE_RUNNING) { + while (state() == STATE_RUNNING) { ACE_Time_Value t = thread_status_manager_->thread_status_interval().value(); ThreadStatusManager::Sleeper sleeper(*thread_status_manager_); reactor_->run_reactor_event_loop(t, 0); @@ -223,22 +223,18 @@ void ReactorTask::stop() reactor->end_reactor_event_loop(); } - { - GuardType guard(lock_); + // In the future, we will likely want to replace this assert with a new "SHUTTING_DOWN" state + // which can be used to delay any potential new calls to open_reactor_task() + OPENDDS_ASSERT(state() == STATE_SHUT_DOWN); - // In the future, we will likely want to replace this assert with a new "SHUTTING_DOWN" state - // which can be used to delay any potential new calls to open_reactor_task() - OPENDDS_ASSERT(state_ == STATE_SHUT_DOWN); + // Let's wait for the reactor task's thread to complete before we + // leave this stop method. + if (thread_status_manager_) { + ThreadStatusManager::Sleeper sleeper(*thread_status_manager_); + wait(); - // Let's wait for the reactor task's thread to complete before we - // leave this stop method. - if (thread_status_manager_) { - ThreadStatusManager::Sleeper sleeper(*thread_status_manager_); - wait(); - - // Reset the thread manager in case it goes away before the next open. - thr_mgr(0); - } + // Reset the thread manager in case it goes away before the next open. + thr_mgr(0); } } diff --git a/dds/DCPS/ReactorTask.h b/dds/DCPS/ReactorTask.h index 7f1ee0e7ee6..4303908242b 100644 --- a/dds/DCPS/ReactorTask.h +++ b/dds/DCPS/ReactorTask.h @@ -83,6 +83,7 @@ public virtual RcObject { ACE_SYNCH_RECURSIVE_MUTEX, MonotonicClock> TimerQueueType; enum State { STATE_UNINITIALIZED, STATE_OPENING, STATE_RUNNING, STATE_SHUT_DOWN }; + State state() const; class Interceptor : public DCPS::ReactorInterceptor { public: diff --git a/dds/DCPS/ReactorTask.inl b/dds/DCPS/ReactorTask.inl index 96927dabbb8..b0701221305 100644 --- a/dds/DCPS/ReactorTask.inl +++ b/dds/DCPS/ReactorTask.inl @@ -69,6 +69,13 @@ ReactorInterceptor_rch ReactorTask::interceptor() const return interceptor_; } +ACE_INLINE +ReactorTask::State ReactorTask::state() const +{ + ACE_Guard guard(lock_); + return state_; +} + } // namespace DCPS } // namespace OpenDDS From d2269058ec6045a8d6170d4895f41dba0c34ce9a Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Tue, 10 Oct 2023 14:01:33 -0500 Subject: [PATCH 3/4] ReactorTask::stop - call wait() unconditionally --- dds/DCPS/ReactorTask.cpp | 10 ++++------ dds/DCPS/ThreadStatusManager.h | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/dds/DCPS/ReactorTask.cpp b/dds/DCPS/ReactorTask.cpp index bebfa7d0232..b9697d0029e 100644 --- a/dds/DCPS/ReactorTask.cpp +++ b/dds/DCPS/ReactorTask.cpp @@ -229,13 +229,11 @@ void ReactorTask::stop() // Let's wait for the reactor task's thread to complete before we // leave this stop method. - if (thread_status_manager_) { - ThreadStatusManager::Sleeper sleeper(*thread_status_manager_); - wait(); + ThreadStatusManager::Sleeper sleeper(thread_status_manager_); + wait(); - // Reset the thread manager in case it goes away before the next open. - thr_mgr(0); - } + // Reset the thread manager in case it goes away before the next open. + thr_mgr(0); } void ReactorTask::reactor(ACE_Reactor* reactor) diff --git a/dds/DCPS/ThreadStatusManager.h b/dds/DCPS/ThreadStatusManager.h index 165a60834f6..73fec10dab5 100644 --- a/dds/DCPS/ThreadStatusManager.h +++ b/dds/DCPS/ThreadStatusManager.h @@ -132,19 +132,29 @@ class OpenDDS_Dcps_Export ThreadStatusManager { class Sleeper { public: - Sleeper(ThreadStatusManager& thread_status_manager) + explicit Sleeper(ThreadStatusManager* thread_status_manager) : thread_status_manager_(thread_status_manager) { - thread_status_manager_.idle(); + if (thread_status_manager_) { + thread_status_manager_->idle(); + } + } + + explicit Sleeper(ThreadStatusManager& thread_status_manager) + : thread_status_manager_(&thread_status_manager) + { + thread_status_manager_->idle(); } ~Sleeper() { - thread_status_manager_.active(); + if (thread_status_manager_) { + thread_status_manager_->active(); + } } private: - ThreadStatusManager& thread_status_manager_; + ThreadStatusManager* const thread_status_manager_; }; /// Copy active and idle threads to running and finished threads to From 251274b7b8a4e08f5cab25ba87809e0c94584cfb Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Thu, 12 Oct 2023 17:58:49 -0500 Subject: [PATCH 4/4] Fix Links in CMake Package Documentation The CMake 3.28 release candidate was put up recently and apparently the latest documentation is updated to point to release candidates. This updates URLs to the `install` command documentation, which seems to have had layout changed somewhat. --- docs/devguide/building/cmake.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devguide/building/cmake.rst b/docs/devguide/building/cmake.rst index ae6a9caf44e..85397d56ca0 100644 --- a/docs/devguide/building/cmake.rst +++ b/docs/devguide/building/cmake.rst @@ -186,7 +186,7 @@ install(IMPORTED_RUNTIME_ARTIFACTS) .. versionadded:: 3.20 -If using CMake 3.21 or later, it’s possible to install :ref:`executables ` and :ref:`shared libraries ` from OpenDDS, ACE, and TAO in CMake along side the application using `install(IMPORTED_RUNTIME_ARTIFACTS) `__. +If using CMake 3.21 or later, it’s possible to install :ref:`executables ` and :ref:`shared libraries ` from OpenDDS, ACE, and TAO in CMake along side the application using `install(IMPORTED_RUNTIME_ARTIFACTS) `__. This will just install shared libraries and executables, not static libraries, headers, or anything else required for building applications. If OpenDDS and ACE/TAO is built with ``clang``, the shared libraries might be missing an ``SONAME`` entry. @@ -212,7 +212,7 @@ It is possible to install files from the :ref:`OPENDDS_*_INTERFACE_FILES target See the :ghfile:`install Test ` for an example of this. It uses `install(FILES) `__, but there isn't any restriction on what installation method can be used. For example, the `PUBLIC_HEADER `__ target property could be set on target to the desired files from the interface lists. -Then they installed using `install(TARGETS ... PUBLIC_HEADER ...) `__. +Then they could be installed using `install(TARGETS ... PUBLIC_HEADER ...) `__. Manually Creating config.cmake ==============================