Skip to content

[bug] Owner-tagged Text endpoints (heredocs) excluded from spawn delivery on all faces #2292

Closed

Description

@caomengxuan666

Summary

Text endpoints are excluded from spawn delivery whenever they are owner-tagged — heredoc bindings on ANY face fail to reach a spawned child (EBADF), while GNU delivers them. ambient_pins_for_spawn (builtin_redirects.rs) skips entries whose owner is FdOwner::Ambient (the 2026-09-29 owner-tag fix), heredoc entries are owner-tagged, and no other channel delivers them: no walk-opened entry, no {var} path. Here-string Text endpoints (not owner-tagged) deliver byte-exact, which isolates the mechanism. File endpoints deliver fine everywhere.

Scope widened 2026-10-31 by the collector on the fix cluster's probe evidence: the original filing covered the in-process faces; the same mechanism also drops heredocs on the plain exterior-command face (Discovery B below). One mechanism, one issue.

Reproducers (verified 2026-10-31 vs GNU bash 5.3.20 oracle)

A — compound face. py.sh = foreign python3 observer reading fd 3.

{ /tmp/textprobe/py.sh; } 3<<EOF2
hello-heredoc
EOF2

GNU: GRANDCHILD-READ: hello-heredoc · rubash: EBADF.

B — plain exterior command (no compound, real spawn).

cat 3<<EOF <<EOF2
on-three
EOF
on-stdin
EOF2

plus an fd-dump variant (ls -l /proc/self/fd; cat <&3 under sh -c): GNU's child holds fds {0,1,2,3,4} and cat <&3 prints the heredoc body; rubash's child holds only {0,1,2,4} — EBADF at slot 3.

Fix direction (authorized to the cluster, 2026-10-31)

Materialize owner-tagged Text endpoints for spawn the way #2277's {var} channel does — install the materialized endpoint at the child's slot pre-exec — skipping any slot a walk-opened or {var} binding already owns (that skip is what preserves the 2026-09-29 owner-tag rationale: no double delivery). One place in the shared spawn-delivery layer, not per-face patches.

Destination

In flight: fix-2292-text-materialize cluster (PR pending). Pins with the issue number: compound faces (group/function/script) via foreign observers, the plain exterior heredoc cell, a here-string control, and an overlap/no-double-delivery cell.

Activity

  1. added this to the 1.5.0 milestone on Oct 30, 2026
  2. added
    bug
    gnu-baseline
    P2-medium
    area:fd
    on Oct 30, 2026
  3. changed the title [-][bug] Ambient heredoc Text endpoints not materialized for spawned grandchildren (all in-process faces)[/-] [+][bug] Owner-tagged Text endpoints (heredocs) excluded from spawn delivery on all faces[/+] on Oct 30, 2026
  4. caomengxuan666 commented on Oct 31, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by PR #2303 (merged, merge commit 1cdace4).

    Defect (as widened during the fix): owner-tagged Text endpoints — heredocs bound in the shell — were excluded from spawn delivery on ALL faces: ambient_pins_for_spawn skipped FdOwner::Ambient entries (2026-09-29 owner-tag rationale) and heredocs are owner-tagged, so a child reading an ambient heredoc fd got EBADF; here-strings (untagged) and File endpoints delivered fine. Even the plain exterior face dropped them.

    Fix (b411a62 + bbfc45a): (1) ambient layer — a deliver_ambient_text_endpoints pass inside apply_external_fd_delivery using the established carrier mechanism, skipping slots claimed by the command's own list / heredoc_redirects / {var} (preserves the 2026-09-29 rationale); (2) gate layer — reject_invalid_redirects records heredoc/here-string bindings in its opened overlay at list position; (3) replay layer — own_input_binding_before gains a HereDoc/HereString arm materializing via materialize_async_stdin_body. 18 regression pins in tests/issue2292_ambient_text_spawn_delivery_regressions.rs.

    Verification (collector batch on the composed head, scrubbed fd environment): issue2292 pins 18/18, issue2235 control 11/11, full regression 221 passed + exactly the 6 known local stock reds (master-identical roster), lib 985/985. PR CI all green (11 jobs) on the composed head.

    Adjudication note: one pin initially failed — decomposition against the GNU oracle showed its sibling-heredoc shape is defeated by the pre-existing body-correlation defect filed as #2305, not by this issue's mechanism (the same shape with a File sibling passes on both shells; a pure in-process variant fails without any spawn). The pin now tests this issue's property with a File sibling and documents the heredoc variant as #2305's; #2305 remains open in the fd wave.

    Residual (filed separately): concurrent pipeline spawners still do not deliver ambient Text endpoints (no carrier lifetime across concurrent spawns) — tracked in #2308 (deferred, post-1.5.0 fd wave).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2-mediumarea:fdbuggnu-baseline

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions