Skip to content

fix(executor): open /dev/null and emit target-prefixed diagnostics under fd exhaustion (Refs #3818) - #3885

Merged
caomengxuan666 merged 2 commits into
masterfrom
fix/3818-input-redir-fd-exhaustion
Nov 18, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
fix/3818-input-redir-fd-exhaustion

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Fixes #3818. Ensures /dev/null redirects open before fd-limit checks and emit target-prefixed diagnostics instead of being dropped or misreporting Bad file descriptor.

…r-fd-exhaustion

# Conflicts:
#	src/executor/command_input_scope.rs
#	src/executor/trap_exec.rs
@caomengxuan666
caomengxuan666 merged commit c00ded7 into master Nov 18, 2026
10 of 12 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/3818-input-redir-fd-exhaustion branch November 18, 2026 08:36
caomengxuan666 added a commit that referenced this pull request Nov 18, 2026
…hebang script (Refs #3316)

test(issue3316): replace multicall-fragile /bin/echo carrier with a shebang script (Refs #3316)

The pin copied /bin/echo to a file named `back\slash` and exec'd it. On
hosts where /bin/echo is a multicall coreutils hardlink, the copy is
rejected inside the multicall dispatcher (`coreutils: unknown program
''back\slash''`) — the same failure reproduces under GNU bash 5.3.9 with
the same fixture and under direct exec with no shell involved. Product
behavior matches GNU; the defect is in the nail's fixture, not the exec
face. The carrier is now a `#!/bin/sh` script printing its argument
(`printf '%s\n' "$1"`); the nail's three intent elements are kept
(backslash filename, exec full path, stdout `literal-ok`).

Verification (captain-adjudicated, REPORT ~/workspace/fix-3316-nail/REPORT.md):
- Fail-first on the base tree: `coreutils: unknown program ''back\slash''`
  at tests/issue3316_exec_full_pathname.rs:132, byte-identical to the
  #3885-head census cell. After the fix: single test 3x green, full stem
  7/7; GNU 5.3.20 runs the same new fixture to `literal-ok`, rc=0.
- Head census (a2ee9d0) total 83 (era band 79-88): the issue3316 cell is
  green; new cells vs tip are census jitter only (issue2029 x2 flipped
  between two runs of the same product tree — this PR is test-only;
  issue2333 carrier family; issue3640 x2 already proven jitter by captain
  server isolation, 7/7 on both trees). Goldens exactly the 2 baseline
  names. CLI exactly the 2 pre-existing cells (coproc flake + the #3899
  compat_issue78 pin, pending #3903).
- Guard: no open PR touches this test file. Product code untouched.

本 PR 删除了什么:
- 删除了钉夹具里对 `/bin/echo` 二进制的复制(`fs::copy("/bin/echo", ...)`),
  改为写出带 `#!/bin/sh` 的小脚本并 `chmod +x`。
- 未删除任何产品代码、测试用例或钉意图;三要素(反斜杠文件名、exec 全
  路径、`literal-ok` 输出)原样保留。

UNVERIFIED-BY-CAPTAIN — captain review: PASS. Merge by captain; #3316 to be
hand-closed by the captain after merge (Refs-only body, no auto-close).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] input-redirect failures under fd exhaustion: wrong "N: Bad file descriptor" diagnostic, and "< file" on external commands silently dropped

1 participant