From a61b12d3261971edf6297719ddf2807eb5dfe6a2 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Fri, 30 Oct 2026 11:29:23 +0800 Subject: [PATCH] fix(shell): avoid a null failure step in the owner ready message refs #99 A pure handshake timeout leaves failure_step null, so ready_failure now falls back to the current state like worker_failure does instead of concatenating a null pointer. --- experiments/shell/clipboard_scenario_state.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/experiments/shell/clipboard_scenario_state.hpp b/experiments/shell/clipboard_scenario_state.hpp index a3868e1a..75d1c10b 100644 --- a/experiments/shell/clipboard_scenario_state.hpp +++ b/experiments/shell/clipboard_scenario_state.hpp @@ -64,8 +64,11 @@ class ClipboardScenarioOwner { throw std::runtime_error("clipboard owner native step failed"); } std::string ready_failure(DWORD wait_status) const { + // A pure handshake timeout records no failure step, so fall back to the + // current state instead of appending a null pointer to std::string. + const auto failed=failure_step_.load(); return std::string("clipboard owner failed its bounded ready handshake: mode=")+ - (delayed_?"delayed":"occupied")+" failure_step="+failure_step_.load()+ + (delayed_?"delayed":"occupied")+" failure_step="+(failed?failed:step_.load())+ " state_step="+step_.load()+ " win32_error="+std::to_string(native_error_.load())+ " worker_error="+std::to_string(error_.load())+