From 9ff3eb58bc0e63076c77ab4a6acd4500c10a15a0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2026 08:54:35 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20[CRITIC?= =?UTF-8?q?AL]=20Fix=20Process=20pipe=20deadlock=20DoS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com> --- .../Sources/TriggerKitRuntime/AutomationExecutor.swift | 6 +++--- .../OBSWebSocketLiveIntegrationTests.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TriggerKit/Sources/TriggerKitRuntime/AutomationExecutor.swift b/TriggerKit/Sources/TriggerKitRuntime/AutomationExecutor.swift index 59854205..5ee9403d 100644 --- a/TriggerKit/Sources/TriggerKitRuntime/AutomationExecutor.swift +++ b/TriggerKit/Sources/TriggerKitRuntime/AutomationExecutor.swift @@ -354,9 +354,9 @@ public final class AutomationExecutor { } catch { return .failure("\(name) launch failed: \(error.localizedDescription)") } - process.waitUntilExit() - let data = pipe.fileHandleForReading.readDataToEndOfFile() + + process.waitUntilExit() let output = String(data: data, encoding: .utf8)? .trimmingCharacters(in: .whitespacesAndNewlines) ?? "" @@ -731,11 +731,11 @@ private final class ShellCommandRunner: @unchecked Sendable { pgrep.standardError = FileHandle.nullDevice do { try pgrep.run() - pgrep.waitUntilExit() } catch { return [] } let data = pipe.fileHandleForReading.readDataToEndOfFile() + pgrep.waitUntilExit() let output = String(data: data, encoding: .utf8) ?? "" return output .split(whereSeparator: \.isNewline) diff --git a/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift b/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift index 722ba696..bbd7478a 100644 --- a/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift +++ b/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift @@ -167,9 +167,9 @@ private enum OBSMediaMTXManager { which.standardOutput = outPipe which.standardError = Pipe() try? which.run() + let data = outPipe.fileHandleForReading.readDataToEndOfFile() which.waitUntilExit() if which.terminationStatus == 0 { - let data = outPipe.fileHandleForReading.readDataToEndOfFile() if let path = String(data: data, encoding: .utf8)? .trimmingCharacters(in: .whitespacesAndNewlines), !path.isEmpty, From 6611fe34bf1e432aac2afcbea83253783d7e4ad5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2026 09:23:10 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20Fix=20t?= =?UTF-8?q?est=20suite=20crash=20due=20to=20unlaunched=20Process?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com> --- .../OBSWebSocketLiveIntegrationTests.swift | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift b/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift index bbd7478a..46a508d5 100644 --- a/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift +++ b/XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift @@ -166,16 +166,20 @@ private enum OBSMediaMTXManager { let outPipe = Pipe() which.standardOutput = outPipe which.standardError = Pipe() - try? which.run() - let data = outPipe.fileHandleForReading.readDataToEndOfFile() - which.waitUntilExit() - if which.terminationStatus == 0 { - if let path = String(data: data, encoding: .utf8)? - .trimmingCharacters(in: .whitespacesAndNewlines), - !path.isEmpty, - FileManager.default.isExecutableFile(atPath: path) { - return path + do { + try which.run() + let data = outPipe.fileHandleForReading.readDataToEndOfFile() + which.waitUntilExit() + if which.terminationStatus == 0 { + if let path = String(data: data, encoding: .utf8)? + .trimmingCharacters(in: .whitespacesAndNewlines), + !path.isEmpty, + FileManager.default.isExecutableFile(atPath: path) { + return path + } } + } catch { + // Fall through to throw XCTSkip } throw XCTSkip("mediamtx not found. Install with `brew install mediamtx` or set MEDIAMTX_BIN")