Repository navigation
fix(executor): keep __RUBASH_FD_* delivery stamps out of the non-respawn strip (Refs #3856) - #3857
Merged
Merged
Conversation
…awn strip (Refs #3856) 0a405d8 (#3736) added __RUBASH_FD_ to fork_respawn_transport_key, so Executor::new_inner deleted every fd-delivery stamp for any birth that is not a validated internal respawn — before init.rs could collect them into inherited_fd_handles. exec/external/comsub/pipeline children are never respawns, so all fd>=3 delivery through the env channel died on Windows (unix masks it via pin+adoption). The keys are per-spawn delivery minted fresh for THIS child and consumed+stripped at entry — not respawn residue — so they do not belong to the #3049 family. Verified: tests/issue3311_exec_child_fd_delivery 4/4 red->green; exec-own/exec-amb/plain-own fd>=3 writes reach children again.
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.
Fixes #3856
Summary
0a405d8a0(#3736, Refs #3049) added__RUBASH_FD_tocompound_exec::fork_respawn_transport_key.Executor::new_inner(init.rs:536-546) strips every matching key for any birth that is not a validated internal respawn — before theenv_vars.retainat init.rs:1292 can collect them intoinherited_fd_handles.exec/external/comsub/pipeline children are never respawns, so all fd>=3 delivery through the env channel died. On Windows this is total (env channel is the only transport;inherited_open_fdsis always empty there, fd_table.rs:748); on unix the pin+adoption path masks it.The
__RUBASH_FD_*keys are per-spawn delivery stamps minted fresh by the direct spawner for THIS child and consumed+stripped at entry — not respawn residue — so they do not belong to the #3049 family (whose leak was*_VARSattribute strings imported byVarTable::from_values).Fix: drop the
__RUBASH_FD_prefix fromfork_respawn_transport_keyand document the carve-out.__RUBASH_FD_AT_STAMPED,__RUBASH_FD_HANDLE_/WHANDLE_/PATH_/WPATH_Nall survive to their unconditional consumers again.Evidence
e3a7b7b3a→ bad0a405d8a0→ still bad3d8c9ff8(master).tests/issue3311_exec_child_fd_delivery: 4/4 red on master (rc=1 f=[]vs expectedrc=0 f=[x]) → 4/4 green here.cargo test --lib fd_: 15/15.target/scratch-i3/rubash-3560-exec.sh: master allrc=1; hereexec-own rc=0 f=[x],exec-amb rc=0 f=[amb],plain-own rc=0 f=[p].Test plan
cargo build --locked --bin rubashcargo test --test issue3311_exec_child_fd_delivery4/4cargo test --lib fd_15/15rustfmt --checkclean on touched filecargo test --lib+ issue3049 bats cell (cfg(unix), needs WSL build — flagged for captain)Unblocks verification of #3560 (command-local
N>&-must revoke the delivered fd).