Skip to content

test: Retry the Windows dead-pipe write until stdin is gone (Fixes #192) - #772

Merged
zackees merged 1 commit into
masterfrom
fix/192-dead-pipe-flake
Oct 14, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/192-dead-pipe-flake

Conversation

@zackees

@zackees zackees commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Refs #192

Root cause

The concurrent-spawn/inheritance hypothesis is refuted: every spawner in windows_process (pipe_parity.rs) already holds serial(), the only unserialized test (nulls_match_oracle, first half) never spawns, and other test files are separate binaries run sequentially. Neither the oracle nor the shim leaves inheritable handles open past create.

Remaining cause: the test syncs on stderr EOF, which only proves the child closed its stderr. Windows closes a dying process's handles one at a time, so the stdin read end can outlive that EOF briefly; a write in that gap lands in the pipe buffer and returns 64. This is test synchronization, not a Rust-port or C bug (both sides are equally exposed).

Fix

write_until_broken retries the write (1 ms apart, 10 s cap) until it reports 0. A permanently leaked read end would still fail after 10 s.

Evidence

  • GREEN: ./lint, soldr cargo test -p obs-util (host), cross lane, and local-gate (lint, rust-test, cross, tier2-linux) pass; stamped.
  • RED: not reproducible locally (no Windows/Wine here, flake is a microsecond race), so there is no deterministic RED commit. Only CI on windows-2025-vs2026 can show it; the failing runs are 38638167750 and 38283726776.

Stderr EOF does not prove the child's stdin read end is closed yet; a
dying process's handles close one at a time. All spawns in the Windows
module already hold serial(), so inherited copies are ruled out.

Local-Gate: v1 tree=f59e78bffbe78714185acf51ae3949d9d0eb780c secs=419 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1792014783,"gate":"rust/all/fmt","host":"linux-x86_64","key":"2decd020cb0ae32bfd16b36c31d309c32de56506cd44180bcab0c1b56d20d53c","lane":"lint","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":55,"stamp":"551a5d3237ed603e6eb9791c2baa5af2","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"2decd020cb0ae32bfd16b36c31d309c32de56506cd44180bcab0c1b56d20d53c","lane":"lint","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":55,"stamp":"413e6f569278e8a347eb2cc8852c8ec1","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"b3db543d028f72d4275e05133959191d7bf199b1e68c1031e2960dd74fe5edba","lane":"rust-test","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":100,"stamp":"6d9f5ad480649734710e53df1daf602f","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"83d5be25f1e88889cd1f5100d4b1a389170fa26e109a4ea378fb15918ea4d57b","lane":"cross","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":44,"stamp":"68f0dc49e5b95ccdc8490b3a1f395b71","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"83d5be25f1e88889cd1f5100d4b1a389170fa26e109a4ea378fb15918ea4d57b","lane":"cross","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":44,"stamp":"a091fa0f1610c7113ba4401593a85597","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"83d5be25f1e88889cd1f5100d4b1a389170fa26e109a4ea378fb15918ea4d57b","lane":"cross","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":44,"stamp":"f1c0bfcbb2ba1b027dd8407ac42bddda","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"83d5be25f1e88889cd1f5100d4b1a389170fa26e109a4ea378fb15918ea4d57b","lane":"cross","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":44,"stamp":"ec46b28d31cb43f9b15867a8762f038e","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"83d5be25f1e88889cd1f5100d4b1a389170fa26e109a4ea378fb15918ea4d57b","lane":"cross","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":44,"stamp":"2ff32da27ff213621e1b4c8ceb6fd80a","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"83d5be25f1e88889cd1f5100d4b1a389170fa26e109a4ea378fb15918ea4d57b","lane":"cross","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":44,"stamp":"842fa8f35ab9d43a9896dc3b1149c526","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
Ci-Attestation: {"at":1792014783,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"bccb543af5e4c101af7b239df70298b7faa498afdb1ef9dc4114aee4eb4dd2ab","lane":"tier2-linux","parents":["533f135366ae8903844ab8a93be48e3805870af5"],"secs":220,"stamp":"1faaff966a319f4a3c16cbd82d133e8c","tree":"f59e78bffbe78714185acf51ae3949d9d0eb780c","v":1,"via":"run"}
@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 14, 2026
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Evidence from the failing run (38638167750): the panic was at pipe_parity.rs:874, which is assert_eq!(s_wrote, o_wrote), so the C oracle and the Rust shim disagreed (one returned 64, the other 0). That fits the handle-teardown race (one side's write landed while the child's stdin read end was still open), not a port bug. This is a timing race on Windows only, so there's no deterministic RED here; repeated windows-2025-vs2026 runs are the check. #192 stays open until it's been quiet for a while.

@zackees
zackees enabled auto-merge October 14, 2026 21:54
@zackees
zackees added this pull request to the merge queue Oct 14, 2026
Merged via the queue into master with commit ccfba5b Oct 14, 2026
25 checks passed
@zackees
zackees deleted the fix/192-dead-pipe-flake branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant