uutils / uutils/coreutils

dd: various issues related to the i64::MAX boundary

Open
#12,964 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

U - dd
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Running gnu dd with skip=i64::MAX produces different output depending on the infile:
dd if=infile of=outfile bs=1 skip=9223372036854775807
infile is empty:

> infile
dd if=infile of=outfile bs=1 skip=9223372036854775807

gnu output:

dd: error reading 'infile': Invalid argument
0+0 records in
0+0 records out
0 bytes copied, 3.6689e-05 s, 0.0 kB/s

infile is not empty:

echo > infile
dd if=infile of=outfile bs=1 skip=9223372036854775807

gnu output:

dd: infile: cannot skip to specified offset
dd: error reading 'infile': Invalid argument
0+0 records in
0+0 records out

running gnu dd with seek=i64::MAX produces different output if the infile is not empty:
infile contain 1 byte:

echo > infile
dd if=infile of=outfile bs=1 seek=9223372036854775807

gnu output:

dd: error writing 'outfile': Invalid argument
1+0 records in
0+0 records out
0 bytes copied, 3.5892e-05 s, 0.0 kB/s

infile contain 2 bytes && seek = i64::MAX:
same with infile containing 1 byte

infile contain 2 bytes && seek = i64::MAX-1:

echo a > infile
dd if=infile of=outfile bs=1 seek=9223372036854775806

gnu output:

dd: error writing 'outfile': Invalid argument
2+0 records in
1+0 records out
1 byte copied, 4.7712e-05 s, 21.0 kB/s

The uutils dd output following in all above situations:
dd: IO error: Invalid input

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the dd command entry point and trace handling of skip, seek, and the i64::MAX boundary for empty and non-empty input files. Compare the existing behavior with the GNU dd outputs in the report, then run or add focused dd tests covering the listed boundary cases and verify the resulting errors and record counts.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.