Skip to content

[bug] Background-job write-error diagnostic always attributed to line 1 #1024

Closed

Description

@caomengxuan666

[bug] Background-job write-error diagnostic always attributed to line 1

echo line2-ok
(echo hello >&-) & wait $!; echo "closed-rc=$?"
# GNU bash 5.3 stderr:  script.sh: line 2: echo: write error: Bad file descriptor
# rubash stderr:         script.sh: line 1: echo: write error: ...

rc=1 on both — message only. Adjacent to #699 (write-error routing) and #551 (diagnostic formats) but a distinct symptom: async command line attribution.

Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.

Activity

  1. added
    bug
    gnu-baseline
    area:jobs
    P3-low
    on Oct 22, 2026
  2. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Re-verified still broken on niu 1.4.4 / rubash 1b14a3d vs GNU bash 5.3.20.

    echo line2-ok
    (echo hello >&-) & wait $!; echo "closed-rc=$?"

    bash stderr: t1024.sh: line 2: echo: write error: Bad file descriptor. niu stderr: t1024.sh: line 1: echo: write error: .... rc=1 on both, line number only. Bulk-fix #1181 did not cover this case.

  3. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Verified fixed on current master (1b14a3d+ / debug build from origin/master): GNU-identical output confirmed by differential repro (see triage). Closing.

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

    P3-lowarea:jobsbuggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions