Skip to content

dd: seek=0 still seeks, erroring on non-seekable files #14696

Description

@ijwhitfield

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions