[GH #3] play.ps1 returns success when victory.exe fails to launch the title #3

Open
opened 2026-11-25 02:54:54 +00:00 by yualk · 1 comment
yualk commented 2026-11-25 02:54:54 +00:00 (Migrated from github.com)

Imported from Zettrox/ztrx. Originally posted by yualk on 2026-11-25T01:46:17Z.


scripts/play.ps1 prints the child's nonzero exit code and writes the error to ztrx.log, but the PowerShell process exits with 0. This makes a failed launch count as a successful sample in batch testing or timing automation.

Reproduced on Windows 11 10.0.26200, Windows PowerShell 5.1, revision 90b529f, cargo build --release --locked -p victory (Rust 1.98.1, x64 MSVC). No game files or GPU needed:

$scratch = Join-Path $env:TEMP ([guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $scratch | Out-Null
$missing = Join-Path $scratch 'missing.exe'
& .\target\release\victory.exe run $missing --execute
$LASTEXITCODE # 1
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File .\scripts\play.ps1 `
    -Game $missing -Cache (Join-Path $scratch 'cache') -Data (Join-Path $scratch 'data')
$LASTEXITCODE # 0 (expected 1)

The wrapper prints Exited with 1, and the log records the missing input, so the child failure is already detected. I tested replacing the final Write-Host with the following lines. The same command then exits 1 and still logs the original error:

$code = $LASTEXITCODE
Write-Host "Exited with ${code}; log: $env:TEMP\ztrx.log"
exit $code

This report is only about launcher status propagation, not game stability or graphics.

<!-- greyfinch-sync:Zettrox/ztrx:issue:6595235398 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/3). Originally posted by [yualk](https://github.com/yualk) on 2026-11-25T01:46:17Z. --- `scripts/play.ps1` prints the child's nonzero exit code and writes the error to `ztrx.log`, but the PowerShell process exits with 0. This makes a failed launch count as a successful sample in batch testing or timing automation. Reproduced on Windows 11 10.0.26200, Windows PowerShell 5.1, revision [`90b529f`](https://github.com/Zettrox/ztrx/commit/90b529f878a470fec9bf07b7be316bc769a12232), `cargo build --release --locked -p victory` (Rust 1.98.1, x64 MSVC). No game files or GPU needed: ```powershell $scratch = Join-Path $env:TEMP ([guid]::NewGuid().ToString()) New-Item -ItemType Directory -Path $scratch | Out-Null $missing = Join-Path $scratch 'missing.exe' & .\target\release\victory.exe run $missing --execute $LASTEXITCODE # 1 powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File .\scripts\play.ps1 ` -Game $missing -Cache (Join-Path $scratch 'cache') -Data (Join-Path $scratch 'data') $LASTEXITCODE # 0 (expected 1) ``` The wrapper prints `Exited with 1`, and the log records the missing input, so the child failure is already detected. I tested replacing the final `Write-Host` with the following lines. The same command then exits 1 and still logs the original error: ```powershell $code = $LASTEXITCODE Write-Host "Exited with ${code}; log: $env:TEMP\ztrx.log" exit $code ``` This report is only about launcher status propagation, not game stability or graphics.
Yoshi-233 commented 2026-11-25 02:54:57 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T02:51:05Z.


I reproduced the exit-status loss separately with PowerShell 7.7.0 on Linux at 90b529f. Using the unmodified scripts/play.ps1 with -Exe pointing to a tiny native argument recorder, I set the child to exit 0, 7 and 42. The script printed the correct child status each time, but the calling process observed 0, 0, 0.

I then tested the three-line change proposed above on a temporary copy (save $LASTEXITCODE immediately after the pipeline, log it, then exit $code). The caller observed 0, 7, 42 and the log still received the child's output in all three cases. This isolates status propagation from GPU, title and cache behavior.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7151268568 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/3#issuecomment-7151268568). Originally posted by [Yoshi-233](https://github.com/Yoshi-233) on 2026-11-25T02:51:05Z. --- I reproduced the exit-status loss separately with PowerShell 7.7.0 on Linux at `90b529f`. Using the unmodified `scripts/play.ps1` with `-Exe` pointing to a tiny native argument recorder, I set the child to exit 0, 7 and 42. The script printed the correct child status each time, but the calling process observed **0, 0, 0**. I then tested the three-line change proposed above on a temporary copy (save `$LASTEXITCODE` immediately after the pipeline, log it, then `exit $code`). The caller observed **0, 7, 42** and the log still received the child's output in all three cases. This isolates status propagation from GPU, title and cache behavior.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Zettrox/ztrx#3
No description provided.