From 95ac829cf361035d8d8ee46eb3540d21f7bac842 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 9 Feb 2026 17:57:37 +0100 Subject: [PATCH] libexec: unlazify launch-builder capnp message reading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit StreamFdMessageReader reads message data *lazily*. if you don't access all segments of the message before you close the underlying stream you may find yourselv reading from something *very* different, and in this case that something is The Void™. this causes reads to fail, writes on the other side to fail to match, and finally our build launch to fail. this does not lead to happy outcomes, so we will copy the full message into a fresh new buffer *before* we try to access any of its contents. fixes #1118 all-analysis-by: deprekated Change-Id: I105540831fde855817194e9e539acf177f54a6f4 --- lix/libexec/launch-builder.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lix/libexec/launch-builder.cc b/lix/libexec/launch-builder.cc index 88fa312d8..077f44bfe 100644 --- a/lix/libexec/launch-builder.cc +++ b/lix/libexec/launch-builder.cc @@ -116,9 +116,10 @@ int main(int argc, char * argv[]) bool sendException = true; try { - capnp::StreamFdMessageReader reader(STDIN_FILENO); + capnp::MallocMessageBuilder buf; + capnp::readMessageCopyFromFd(STDIN_FILENO, buf); - auto request = reader.getRoot(); + auto request = buf.getRoot().asReader(); printDebugLogs = request.getDebug();