From 922231ab81e0b5c57302618e9e8becee19e4c7fc Mon Sep 17 00:00:00 2001 From: Alex Williams-Ferreira Date: Thu, 26 Mar 2026 17:45:08 -0700 Subject: [PATCH] Fix Lzbench empty metrics on ARM64 due to stdout buffering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When lzbench runs with -o4 (CSV format) and stdout is redirected to a file, the C library uses full-buffering (4-8KB blocks). If the process is killed before completion (e.g., by VC timeout), the unflushed buffer is lost and results-summary.csv is empty — especially on ARM64 where lzbench runs slower and never reaches the flush threshold. Adding stdbuf -oL forces line-buffered output so each CSV row is flushed to disk immediately, ensuring partial results survive process termination. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../VirtualClient.Actions/Lzbench/lzbenchexecutor.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/VirtualClient/VirtualClient.Actions/Lzbench/lzbenchexecutor.sh b/src/VirtualClient/VirtualClient.Actions/Lzbench/lzbenchexecutor.sh index a2dcd274a6..79473bacf6 100644 --- a/src/VirtualClient/VirtualClient.Actions/Lzbench/lzbenchexecutor.sh +++ b/src/VirtualClient/VirtualClient.Actions/Lzbench/lzbenchexecutor.sh @@ -1,5 +1,8 @@ #!/bin/bash echo $1 -./lzbench $1 > results-summary.csv +# Use stdbuf to force line-buffered stdout so CSV data is flushed incrementally +# to disk rather than held in a full-buffer until process exit. Without this, +# a timeout-based kill loses all buffered output (especially on ARM64). +stdbuf -oL ./lzbench $1 > results-summary.csv