From 018fe98696ccf38bc49ca41ccfff283aefb403fa Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:46:18 +0000 Subject: [PATCH] fix: Add missing ByteUtilities.h include and use coroStackSize constant - Include ByteUtilities.h in Coro.ipp so megabytes() is declared - Use coroStackSize constant in coroutine constructor instead of hardcoded 1536*1024, enabling sanitizer-aware stack sizing - Initialize local variable in PropertyStream destructor to satisfy clang-tidy cppcoreguidelines-init-variables Co-Authored-By: Claude Opus 4.6 --- include/xrpl/core/Coro.ipp | 6 +++--- src/libxrpl/beast/utility/beast_PropertyStream.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/xrpl/core/Coro.ipp b/include/xrpl/core/Coro.ipp index ac321743c9..da172f1c28 100644 --- a/include/xrpl/core/Coro.ipp +++ b/include/xrpl/core/Coro.ipp @@ -1,5 +1,7 @@ #pragma once +#include + #include namespace xrpl { @@ -25,9 +27,7 @@ JobQueue::Coro::Coro(Coro_create_t, JobQueue& jq, JobType type, std::string cons , name_(name) , running_(false) , coro_( - // Stack size of 1MB wasn't sufficient for deep calls. ASAN tests flagged the issue. Hence - // increasing the size to 1.5MB. - boost::context::protected_fixedsize_stack(1536 * 1024), + boost::context::protected_fixedsize_stack(coroStackSize), [this, fn = std::forward(f)]( boost::coroutines2::asymmetric_coroutine::push_type& do_yield) { yield_ = &do_yield; diff --git a/src/libxrpl/beast/utility/beast_PropertyStream.cpp b/src/libxrpl/beast/utility/beast_PropertyStream.cpp index 6f06cb16c7..9ac2e0ef28 100644 --- a/src/libxrpl/beast/utility/beast_PropertyStream.cpp +++ b/src/libxrpl/beast/utility/beast_PropertyStream.cpp @@ -161,7 +161,7 @@ PropertyStream::Source::~Source() // Read parent_ under lock, then release before calling remove() // to maintain consistent lock ordering (parent before child), // matching the order used in find_one_deep(). - Source* parent; + Source* parent = nullptr; { std::lock_guard _(lock_); parent = parent_;