You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI windows-latest: Rust tests hang (30m timeout) in c_command_read_closed_stdin_reports_bad_fd — read-fd probing under a closed fd0 #294
Two consecutive CI runs (36419058098 ad4b6b8, 36420522407 e3e539c) fail ONLY the windows Rust tests job by hitting the 30-minute job timeout. The last test to complete was `c_command_appends_stdout_to_null_device_without_creating_path`; the hang is the next one in enum order: `c_command_read_closed_stdin_reports_bad_fd` (tests/cli_tests.rs:2456) — it never prints its name, i.e. hangs at spawn/run.
The test: `rubash -c 'read value <&-; printf ...'` via `Command::output()` (stdin auto-null on both sides). Expected: `<>:1` + `bash: line 1: read: 0: read error: Bad file descriptor`.
Local (Git Bash host): passes in 1.2s. CI windows-latest: hangs.
Suspects, in order:
b6cc735's read-side changes: `read_fd_is_available` (read_builtin.rs) probes the fd — under a CLOSED fd0 (entries.get(0) == None) the probe's handle operation may block on the runner's different NUL-device/inheritance shape.
readhang's gate `fd0_bound_away_from_process_stdin` (fd_table.rs:381) returns FALSE for a closed fd0 (None matches the None arm) — the read path then falls back to inheriting the process stdin; the runner's null-stdin handle may not EOF the way a desktop one does.
Note this whole job passed before the retirement-era changes only because earlier failures (ulimit compile) masked it; treat as fresh diagnosis on master e3e539c+.
Verification: the single test passes locally; on CI it completes (or fails visibly) within the per-test timeout after the nextest switch; the full Rust tests job finishes; CI green.
Fixed by wt12/ctrlcfix (rubash 9c676cea): the CI hang was a background-respawn serialization corruption. Any cmd-and-ampersand triggers background_command_source (compound_exec.rs:917) serializing ALL defined functions into the respawn subshell -c script, and bash_command_sequence_text joined them with "; " - so true-and-ampersand became "; while..."-class ILLEGAL syntax (double separator), the subshell died of a syntax error, the async (sleep; kill -TERM) never ran, the TERM trap never fired, and the until loop had no exit - the 30-minute CI timeout and every wedged worktree process. exported_function_env_value had the same corruption. Fixed at all three join points per print_cmd.c:1520-1529 semicolon() suppression after "and" + parse.y:1275/1290 (only newline_list may follow an ampersand). The original powershell+kill form plus the minimal repro are byte-identical to WSL GNU Bash 5.3.0 (TERM/status:42/DONE, rc 0); 4 new regressions. This closes the last known cause of silent CI hangs - with nextest per-test timeouts already in place, the suite now both names and survives any future hang.
Activity
caomengxuan666 commentedon Sep 29, 2026
Fixed by wt12/ctrlcfix (rubash 9c676cea): the CI hang was a background-respawn serialization corruption. Any cmd-and-ampersand triggers background_command_source (compound_exec.rs:917) serializing ALL defined functions into the respawn subshell -c script, and bash_command_sequence_text joined them with "; " - so true-and-ampersand became "; while..."-class ILLEGAL syntax (double separator), the subshell died of a syntax error, the async (sleep; kill -TERM) never ran, the TERM trap never fired, and the until loop had no exit - the 30-minute CI timeout and every wedged worktree process. exported_function_env_value had the same corruption. Fixed at all three join points per print_cmd.c:1520-1529 semicolon() suppression after "and" + parse.y:1275/1290 (only newline_list may follow an ampersand). The original powershell+kill form plus the minimal repro are byte-identical to WSL GNU Bash 5.3.0 (TERM/status:42/DONE, rc 0); 4 new regressions. This closes the last known cause of silent CI hangs - with nextest per-test timeouts already in place, the suite now both names and survives any future hang.
fix(#294,#287): no `;' after `&' in serialized command lists
fix(#294 family): semicolon() suppression at every serializer join
fix(executor): close brace/coproc/fundef renderers after `&` with a n…