From c2f3e2e2637d68183458899b786588ee2b73602d Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 3 Jul 2025 00:40:25 +0530 Subject: [PATCH] fix: crash when trace-logging in tests (#5529) This PR fixes a crash in tests when the test `Env is run at trace/debug log level. This issue only affects tests, and only if logging at trace/debug level, so really only relevant during rippled development, and does not affect production servers. --- src/test/unit_test/SuiteJournal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/unit_test/SuiteJournal.h b/src/test/unit_test/SuiteJournal.h index b5c59f3d29..d56c297b0a 100644 --- a/src/test/unit_test/SuiteJournal.h +++ b/src/test/unit_test/SuiteJournal.h @@ -94,6 +94,8 @@ SuiteJournalSink::writeAlways( return "FTL:"; }(); + static std::mutex log_mutex; + std::lock_guard lock(log_mutex); suite_.log << s << partition_ << text << std::endl; }