dd: conv=sync repeats bytes from the previous block when a byte count ends mid-block
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
バグは src/uu/dd/src/dd.rs の fill_blocks にあり、553〜588行目付近で、読み取った長さと残りのスライス長が比較されています。issue の再現手順(bs=4 count=5B conv=sync)を uutils のバイナリと GNU dd の両方で実行し、出力バイトを比較してください。ブロックの途中で終端に達した後のパディングが GNU dd と同じ NUL バイトになり、そのケースを dd のテストがカバーしていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
With bs=4 count=5B conv=sync, uutils dd writes eight bytes, but the last three repeat bytes 2–4 of the first block. GNU dd pads with three NUL bytes.
Reproduction
Run in an empty directory with the uutils multicall binary as coreutils and GNU dd as dd.
printf ABCDEFGH > input
coreutils dd if=input bs=4 count=5B conv=sync status=none | od -An -tx1
# 41 42 43 44 45 42 43 44
dd if=input bs=4 count=5B conv=sync status=none | od -An -tx1
# 41 42 43 44 45 00 00 00
Verified with official uutils 0.12.0 and 0.13.0 x86_64 Linux musl binaries and GNU coreutils 9.7. Using count=5 iflag=count_bytes gives the same result. With a five-byte input and no count operand, both implementations pad correctly.
Source
On main at 7913995, fill_blocks compares the read length with the remaining slice length. The final one-byte read fills that slice, so it skips padding but advances the output length by four. The unused positions still contain BCD.
Related: #13435 corrected input byte-budget accounting. Here the input limit is respected and the output padding is incorrect.
- 主要言語
- Rust
- スター
- 24.4k
- フォーク
- 2.2k
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 402
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/coreutils のほかの issue
-
split -n leaves bytes from a previous run in chunks that should be empty対応中かも @costajohnt が 2 日前に担当しました。 オープンU - split
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
dircolors: '=' is not escaped and '^'/'\\' do not toggle the backslash state, unlike GNU再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンU - dircolors
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
U - shred
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
chown -v: `+ID` spec echoed verbatim on a broken symlink対応中かも @sunsss123soldier が 7 日前に担当しました。 オープンgood first issue oss-scanner U - chown
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
dircolors: --csh doesn't escape `!`再び着手できるかも @majidninja が 7 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンgood first issue oss-scanner U - dircolors
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
uutils/coreutils#16496 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
uutils/coreutils の issue をすべて見る
似ている issue
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
bug triaged tui ux wontfix
難易度 2/5 半日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bevyengine/bevy#26642 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信