Skip to content

[linux] Hang: redir.tests stalls forever in redir7.sub backquote-comsub fd juggling; survives timeout SIGTERM (harness rc 137) #225

Closed

Description

@caomengxuan666

Observed on the Linux build (worktree wt4/linuxrun @9bf2df9e + lane fixes, x86_64-unknown-linux-gnu debug), WSL GNU Bash 5.3.0 baseline, true-baseline harness.

Repro

cd target/issue-suites/results/bash-tests-rw
timeout 20 <rubash-linux> ./redir7.sub        # alone: rc=0, but under trap/redir.tests sequence it blocks
timeout 40 <rubash-linux> ./redir.tests       # stalls after "after block"; harness kills -> rc 137

Expected (GNU 5.3.0): redir.tests completes (58 stdout diff lines are all "GNU printed, rubash never reached"); rc 0.
Actual (rubash Linux): output stops right after after block (redir.tests:204), i.e. at ${THIS_SH} ./redir7.sub-era backquote comsub:

eval `
exec 4>&1 >&3 3>&-
{
    stuff 4>&-        # stuff backgrounds ( sleep 5 < /dev/null >/dev/null 2>&1 & )
    echo "c=$c" >&4
}`

The shell blocks forever; ps shows a <defunct> child and rubash still in a blocking read. timeout 5's SIGTERM does NOT kill it (see companion issue about SA_RESTART / boundary-only signal dispatch) - only SIGKILL does.

Hypothesis (to verify in C source before fixing): the write end of the backquote command-substitution pipe leaks into the backgrounded ( sleep 5 ... & ) grandchild, so the pipe never sees EOF and the comsub read blocks. GNU closes/uses close-on-exec for comsub pipe fds (subst.c command_substitute / redir.c dup bookkeeping).

Artifacts (worktree D:/repo/rubash-wt-linuxrun):

  • target/issue-suites/results/true-baseline/redir/{gnu.out,rb.out,rb.err} (rb.out ends at "after block"; rc gnu=0 rub=137)
  • target/wslrun/results/linux-ledger2.log: redir 58 env=0

Lane report: docs/LINUX-RUN-STATUS.md (2026-09-27).

Activity

  1. added
    bug
    gnu-baseline
    on Sep 27, 2026
  2. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已修复并合入 master(commit b2e41b4e,lane wt4/linuxfix;GNU 引用与验证见提交信息:Linux 真机 WSL 双壳验证、24 套件平价 17→19)。感谢报告!

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

    buggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions