dd: seek=0 still seeks, erroring on non-seekable files
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
Hi!
The Linux kernel selftest for ftrace:trace_marker_raw is failing on Ubuntu 26.04 because of a parity issue in dd between rust coreutils and GNU coreutils. A call to dd was added to the Linux test in this commit, and the output file is trace_marker_raw, which notably does not support seeking. With GNU dd, this test passes, and with uutils dd the test hangs until timeout.
I believe this to be because of a few spots where dd unconditionally seeks, and errors from non-seekable files are not handled. Here's a minimal reproducer for a system with dd pointing to the GNU binary:
#!/bin/sh
echo "GNU:"
echo hello | dd of=/sys/kernel/tracing/trace_marker_raw
echo "uutils:"
echo hello | coreutils/target/debug/coreutils dd of=/sys/kernel/tracing/trace_marker_raw
which outputs:
GNU:
0+1 records in
0+1 records out
6 bytes copied, 2.6711e-05 s, 225 kB/s
uutils:
dd: failed to seek in output file: Illegal seek
Contributor 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.
Research direction
Start by reproducing the shell pipeline against /sys/kernel/tracing/trace_marker_raw and compare the uutils dd behavior with GNU dd. Trace the dd implementation's unconditional seek operations and adjust the behavior so non-seekable output succeeds like GNU dd without hanging or reporting Illegal seek.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100