Skip to content

Background spawn with a large function table (~200 KB) hits execve caps / wedges — in-repo pin issue_niubash_362 case_1 is RED on master #2356

Closed

Description

@caomengxuan666

Surfaced by the main session's final-master batch (2026-10-31): the regression suite on current master 711ad72 is 221 passed + the 6 known local stock reds + this one new red, deterministic (3/3 runs).

Shape (in-repo pin issue_niubash_362::case_1_background_command_with_large_function_table, tests/regression.rs:1654): a script defining ~6000 tiny functions (~200 KB serialized table) then echo hello & wait. The pin's own doc comment records the intent: the shape 'clears BOTH caps, so this fails pre-fix on Windows AND on Unix; the background child must still print its output and exit 0.' The pin only reached master this afternoon inside PR #2324's composition (commit 8e3bc86, authored 2026-10-18 on a long-lived branch), which is why the long-standing local baseline (221 + exactly 6) did not include it.

Observed on master (Linux, this machine):

  • In the test harness: big.sh: line 6001: Argument list too long (os error 7), background child output missing.
  • Direct probe (same generated script): rubash does not finish within 60 s (timeout); GNU bash 5.3.20 completes instantly with hello + large-fn-status:0, rc=0.

Mechanism class: the background child's inherited shell state is serialized through a channel bounded by execve argv/env limits (E2BIG); GNU forks in-process and has no such cap. The fix must be by mechanism — the realized-child state channel must not be bounded by argv/env size for ANY state payload (functions and variables alike), not a special case for this script. The #2292-family carrier machinery is the neighborhood; whether its channel is size-bounded the same way is the first design question.

Destination: post-release wave (not in the 1.5.0 gate per the 2026-10-31 scope ruling); a fix cluster is dispatched the same evening this is filed. The pin stays red in local Linux runs until the fix lands — it is the regression test for this issue (name already carries the niu#362 case id; expectations are GNU's).

Activity

  1. added
    bug
    gnu-baseline
    on Oct 31, 2026
  2. caomengxuan666 commented on Oct 31, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by PR #2366 (merged, see PR). Respawned children now receive large shell state through a file channel: env entries over 8 KiB spill individually into a temp file with a length-prefixed codec and only the pointer crosses execve, so the 128 KiB single-string cap that killed ~6000-function sessions with E2BIG is gone at all four respawn sites (background, coproc, procsub both directions). Collector verification (scrubbed-fd runner, post-quota-sweep): issue_niubash_362 1/1 in 39s, neighbors issue2292 18/18 and issue2308 8/8, PR CI fully green.

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

Metadata

Metadata

Labels

buggnu-baseline

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions