paste: serial mode exhausts file descriptors by opening every input simultaneously
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
src/uu/paste/src/paste.rsから始め、特に101–115行目の入力を開くループと、シリアル処理の分岐を確認してください。issueのBashコマンドでファイルディスクリプタ制限による失敗を再現し、その後、シリアルモードが入力を個別に処理することを確認してください。再現手順が期待される出力とステータスで成功し、issueの報告どおり既存のpaste統合テスト27件すべてが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
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時間
- マージ済み PR(30日)
- 357
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/coreutils のほかの issue
-
fmt: stops at an unreadable file operand and says only 'read error' for a directory対応中かも @emirmrkaljevic が 1 日前に担当しました。 オープンU - fmt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
shuf: exhausted random source destroys the input during an in-place shuffle対応中かも @limadog9 が 1 日前に担当しました。 オープンU - shuf
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
unexpand: final newline prevents conversion of leading Unicode blanks対応中かも @Ybucaille が 1 日前に担当しました。 オープンU - unexpand
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
chmod -v: missing 'could not be accessed' line for operands that can't be stat'ed対応中かも @emirmrkaljevic が 1 日前に担当しました。 オープンU - chmod
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
chown, chgrp: 'cannot dereference' instead of 'cannot access' for a missing operand対応中かも @emirmrkaljevic が 2 日前に担当しました。 オープンU - chgrp U - chown
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
uutils/coreutils の issue をすべて見る
似ている issue
-
desktop documentation
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
vfarcic/dot-agent-deck#2008 ·
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
pbakaus/impeccable#1210 ·
メンテナーはふだん 1 日以内に返信
-
area: ci priority: P4 ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
shep-pm/shep#1249 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
L: javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dependabot/dependabot-core#16744 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nautechsystems/nautilus_trader#5486 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信