From 31d7df915e20b855d5b78f04d9e3ac096d2fa7e3 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Mon, 29 Sep 2025 14:41:11 +0200 Subject: [PATCH 1/2] Supervisor: Make last_signal atomic to squelch data race When the stem process terminates and SIGCHLD is sent to the supervisor, the signal might be handled by the main thread or any other threads that aren't blocking SIGCHLD explicitly. Convert last_signal to a std::atomic such that non-main threads can safely set last_signal without triggering data race as reported by TSAN. This doesn't make it less racy to work last_signal, but it appears we only use it for debug printing anyhow and another option might have been to just remove last_signal altogether. Follow-up for #4849 --- src/supervisor/Supervisor.cc | 2 +- src/supervisor/Supervisor.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/supervisor/Supervisor.cc b/src/supervisor/Supervisor.cc index 48894d1f0e..974367c87c 100644 --- a/src/supervisor/Supervisor.cc +++ b/src/supervisor/Supervisor.cc @@ -415,7 +415,7 @@ static ForkResult fork_with_stdio_redirect(const char* where) { void Supervisor::HandleChildSignal() { if ( last_signal >= 0 ) { - DBG_LOG(DBG_SUPERVISOR, "Supervisor received signal %d", last_signal); + DBG_LOG(DBG_SUPERVISOR, "Supervisor received signal %d", last_signal.load()); last_signal = -1; } diff --git a/src/supervisor/Supervisor.h b/src/supervisor/Supervisor.h index c433c0536a..84c5595138 100644 --- a/src/supervisor/Supervisor.h +++ b/src/supervisor/Supervisor.h @@ -3,6 +3,7 @@ #pragma once #include +#include #include #include #include @@ -323,7 +324,7 @@ private: Config config; pid_t stem_pid; - int last_signal = -1; + std::atomic last_signal = -1; std::unique_ptr stem_pipe; detail::LineBufferedPipe stem_stdout; detail::LineBufferedPipe stem_stderr; From 3c16ee9667debc2aaba6458d2e6c699f8fc7f3f8 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Mon, 29 Sep 2025 08:21:01 -0700 Subject: [PATCH 2/2] Update docs submodule [nomail] --- CHANGES | 4 ++++ VERSION | 2 +- doc | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 071e2ed187..c30086ef64 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +8.1.0-dev.610 | 2025-09-29 08:21:01 -0700 + + * Update docs submodule [nomail] (Tim Wojtulewicz, Corelight) + 8.1.0-dev.609 | 2025-09-29 13:08:15 +0200 * cluster/zeromq: Fix Cluster::subscribe() block if not initialized (Arne Welzel, Corelight) diff --git a/VERSION b/VERSION index 4b178aee4a..041d214e50 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.1.0-dev.609 +8.1.0-dev.610 diff --git a/doc b/doc index 2731def915..8f38ae2fd5 160000 --- a/doc +++ b/doc @@ -1 +1 @@ -Subproject commit 2731def9159247e6da8a3191783c89683363689c +Subproject commit 8f38ae2fd563314393eb1ca58c827d26e9966520