Skip to content

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

Closed

Description

@caomengxuan666

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:

  1. 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.
  2. 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.

Activity

  1. added
    bug
    on Sep 28, 2026
  2. caomengxuan666 commented on Sep 29, 2026

    @caomengxuan666
    MemberAuthor

    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.

  3. added 2 commits that reference this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions