Skip to content

du: "Value too large for defined data type" for directories on 32-bit architectures (0.8.0 regression) #11848

@BAMF0

Description

@BAMF0

(Forwarded from Launchpad Bug #2148301)

Problem

The du utility generates a "Value too large for defined data type" error on 32-bit architectures when given a directory as an argument.

Reproduce

The error can be reproduced on a 64-bit system using the following steps:

  1. Install qemu-system-i386:
# On a Debian derivative
sudo apt update && sudo apt install qemu-system-i386
  1. Clone and cd uutils/coreutils:
git clone git@github.com:uutils/coreutils.git && cd coreutils
  1. Add i686 as a target using rustup:
rustup target add i686-unknown-linux-gnu
  1. Build coreutils for i686 (runs on i386)
cargo build --release --target=i686-unknown-linux-gnu
  1. Run the built du on the coreutils repository directory:
qemu-i386 ./target/i686-unknown-linux-gnu/release/coreutils du

The error output is:

du: cannot read directory '.': Value too large for defined data type
4	.

The bug seems strictly related to directories, as running du on a single large testfile generated using:

dd if=/dev/zero of=testfile bs=1M count=4096

does not give the error:

$ qemu-i386 ./target/i686-unknown-linux-gnu/release/coreutils du ./testfile
4194308	testfile

System

  • OS release: Ubuntu 26.04 (Development branch)
  • uutils coreutils version: 0.8.0 (built from 4e68e674)

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