Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

paste: serial mode exhausts file descriptors by opening every input simultaneously

未关闭 适合新手
#15,903 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@binhvq 已经在做这个了。

开始于 2026年10月27日。

  • #15906 来自 @binhvq —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

从 src/uu/paste/src/paste.rs 开始,重点查看第 101–115 行打开输入的循环以及串行处理分支。使用 issue 中的 Bash 命令重现文件描述符限制导致的失败,然后检查串行模式是否逐个处理输入。重现步骤以预期的输出和状态成功运行,即表示完成;issue 报告称现有的 27 个 paste 集成测试全部通过。

由索引模型根据 Issue 内容生成。

描述

U - paste

With paste -s, uutils opens every input file before processing any of them. This makes serial mode fail with "Too many open files" on batches that GNU paste processes successfully one file at a time.

Reproduced on Linux x86_64 at commit c1f172886c6643f61ffde5a1ce3db0aaf14e182b, in both debug and release builds. Compared with GNU coreutils 9.7 and the project-recommended GNU 9.12 reference package (Ubuntu 9.12-0ubuntu1~ppa1).

Reproducer

Run in Bash from the repository root:

cargo build --no-default-features --features paste

d=$(mktemp -d)
for i in {1..40}; do
  printf 'a\nb\n' > "$d/f$i"
done

(ulimit -n 32; LC_ALL=C target/debug/coreutils paste -s "$d"/f*)
echo "status: $?"

Actual: no stdout, status 1, and:

paste: Too many open files

Expected: 40 lines containing a<TAB>b, status 0. Replacing target/debug/coreutils paste with GNU paste gives that result under the same limit.

The limit change applies only to the subshell. The reproducer leaves its temporary input directory in place.

Validation and cause

The failure also occurs with 1,032 files under a 1,024-descriptor limit, with --serial, custom delimiters, and -z. Small batches succeed. Both GNU versions passed all 12 tested combinations; each uutils build failed the six combinations exceeding the descriptor limit. All 27 existing paste integration tests pass.

The input-opening loop in paste.rs, lines 101-115 retains every file handle before reaching the serial branch. Serial mode should open, process, and close each file individually.

Related reports

Searches of open/closed issues, PRs, and comments for paste plus "too many open", "file descriptors", "RLIMIT_NOFILE", "EMFILE", and "opens all" found no matching report. #15254 and #15642 concern missing-file errors; this reproducer uses only existing, readable files.

Investigation and report prepared with AI assistance.

主要语言
Rust
星标
24.3k
派生
2.1k
平均合并
1 天 21 小时
30 天内合并 PR
357

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

uutils/coreutils 的其他 Issue

查看 uutils/coreutils 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。