From de835e9e6e29a6e51d9572c70fed265dc02b993c Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 1 Aug 2026 10:38:56 +0200 Subject: [PATCH] fix QProcess pipe deadlock: drain stdout in run9p while waiting --- gui/ollie9pclient.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gui/ollie9pclient.cpp b/gui/ollie9pclient.cpp index a5870b2..90c9585 100644 --- a/gui/ollie9pclient.cpp +++ b/gui/ollie9pclient.cpp @@ -241,6 +241,15 @@ QByteArray Ollie9pClient::run9p(const QStringList &args) QStringList fullArgs = {"-a", serverAddr()}; fullArgs.append(args); proc.start(ninepBin(), fullArgs); - proc.waitForFinished(10000); - return proc.readAllStandardOutput(); + + // Drain output while waiting. The log file can be up to 64KB; if the + // parent doesn't read, the child blocks on a full pipe and never exits, + // causing "QProcess: Destroyed while process is still running". + QByteArray out; + while (proc.state() != QProcess::NotRunning) { + if (proc.waitForReadyRead(100)) + out += proc.readAllStandardOutput(); + } + out += proc.readAllStandardOutput(); + return out; }