Repository navigation
WIP: test(2270): foreign-observer harness repair for numbered-fd heredoc pins - #2283
Merged
Merged
Conversation
The pins observed spawn-delivered fds through ./readerN.sh ENOEXEC scripts, which rubash runs in-process; the delivered bindings never appear there, so 8 of 10 pins read fd3-closed on a correct tree. Re-observe through the nested rubash binary (the pattern the #2272 pins use). Assertions, redirect shapes, and expectations unchanged. Refs #2270
caomengxuan666
marked this pull request as ready for review
October 30, 2026 21:09
SpookyWaste
pushed a commit
to SpookyWaste/rubash
that referenced
this pull request
Nov 12, 2026
…ubash spawn Refs unixwin#2286 The control pin for the numbered `3<>` face observed spawn fd delivery through `./child.sh`, an ENOEXEC script child that rubash runs in-process, where spawn-delivered bindings do not appear the same way — its green could not by itself prove the spawn delivery face it guards (the same harness defect PR unixwin#2283 repaired for the unixwin#2270 pins). The observing child is now the nested rubash binary re-invoked as a real spawned process (`"<RUBASH>" -c 'echo via3 >&3' 3<>num.txt`), making the exact same observation: write `via3` to fd 3, exit 0. The redirect shape and both expectations are unchanged. Tests only; no product code touched. Local verification: `cargo check --test issue2261_child_script_readwrite_fd0_regressions` clean. The pin target itself was not run locally (compile rationing) — it is pending the collector's scrubbed-fd batch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests-only harness repair for the #2270 regression pins. No product code changes.
Problem
tests/issue2270_external_numbered_fd_heredoc_regressions.rsobserved spawn-delivered fds through./reader3.sh/./reader4.sh/./reader0.sh— ENOEXEC shell scripts that rubash executes via its in-process script-child face, where spawn-delivered fd bindings never appear. On master (c17160e) the target read 2 passed / 8 failed, deterministically: the script child reported3: Bad file descriptorand printedfd3-closedfor every numbered-fd shape — including the plain3<filecontrol. The product face itself was verified correct with foreign ELF observers (python3 reading fd 3 receives the heredoc body and the file body byte-identical to GNU bash 5.3.20).Change
Every pin's observing child is now the nested rubash binary re-invoked as a real spawned process — the pattern the #2272 pins use — whose read loop makes the exact same observations the reader scripts made (per-line echo, fd-open check at EOF, exit code). Redirect shapes, expected bodies, and exit-code expectations are unchanged; the observer mechanism is the only change. This includes the two pins that were passing (
issue2270_no_delimiter_file_created,issue2270_fd0_heredoc_control_still_works): both also observed through a script child, so both were repaired for uniformity. Test names carry the issue number and expectations remain the GNU ones, per the regression rule.Verification (local, collector exception for this target)
cargo test --test issue2270_external_numbered_fd_heredoc_regressions).git difftouches onlytests/issue2270_external_numbered_fd_heredoc_regressions.rs; per-file rustfmt applied; CR count 0.Refs #2270