Skip to content

function as pipeline stage with stdout redirect loses the stage output #412

Closed

Description

@caomengxuan666

Summary

A function running as a pipeline stage with its stdout redirected loses the stage output: neither the stage's pwd line nor the piped payload reaches the redirect file.

Reproducer (probe wt37-374 K109)

f() { cd ..; pwd; cat; }; printf x | f > OUT; printf 'after:%s\n' "$(pwd)" >> OUT

GNU OUT: <parent> line, then xafter:<cwd> line (pwd line, the x payload, then the after line). rubash CLI OUT: only after:<cwd> - the whole redirected stage output is missing.

Compare K108 (printf x | { cd ..; pwd; cat; } > OUT): the brace-group stage output survives (modulo path domain) - the loss is specific to the function-stage path.

GNU owner

execute_cmd.c execute_function / pipeline stage fd plumbing.

Artifacts

target/issue-suites/results/wt37-374/run/K109.* K108.*

Activity

  1. added
    bug
    on Oct 2, 2026
  2. added 3 commits that reference this issue on Oct 2, 2026
  3. caomengxuan666 commented on Oct 3, 2026

    @caomengxuan666
    MemberAuthor

    Landed on master through the wt38 pool recovery waves (CI green); see the issueNNN regression suite and lane matrices on the ticket.

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