dd: conv=sync repeats bytes from the previous block when a byte count ends mid-block
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The bug is in fill_blocks in src/uu/dd/src/dd.rs, around lines 553-588, where the read length is compared with the remaining slice length. Run the reproduction from the issue (bs=4 count=5B conv=sync) with the uutils binary and GNU dd and compare the output bytes. Done when the padding after a mid-block end is NUL bytes matching GNU dd, and a dd test covers that case.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 24.4k
- Forks
- 2.2k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 402
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/coreutils
-
split -n leaves bytes from a previous run in chunks that should be emptyPossibly taken @costajohnt claimed this 2 days ago. OpenU - split
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
dircolors: '=' is not escaped and '^'/'\\' do not toggle the backslash state, unlike GNUMay be free again A pull request for this issue was closed without being merged. OpenU - dircolors
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
U - shred
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
chown -v: `+ID` spec echoed verbatim on a broken symlinkPossibly taken @sunsss123soldier claimed this 7 days ago. Opengood first issue oss-scanner U - chown
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
dircolors: --csh doesn't escape `!`May be free again @majidninja claimed this 7 days ago, and no pull request is open. Opengood first issue oss-scanner U - dircolors
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
uutils/coreutils#16496 · 1 comment ·
Maintainers usually reply within 1 day
All issues in uutils/coreutils
Similar issues
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
bug triaged tui ux wontfix
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26642 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day