Skip to content

Conversation

BenWiederhake
Copy link
Collaborator

@BenWiederhake BenWiederhake commented Apr 12, 2025

$ cargo run du -B0
     Running `target/debug/coreutils du -B0`

thread '<unnamed>' panicked at src/uu/du/src/du.rs:551:26:
attempt to divide by zero
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
du: sending on a closed channel
[$? = 1]

I think that's a new record for fewest characters needed to cause a panic :D

This PR fixes the panic, and adds a test to ensure we don't regress.

This addresses only part of #7738.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)

@sylvestre sylvestre merged commit 689aaf9 into uutils:main Apr 12, 2025
69 checks passed
@BenWiederhake BenWiederhake deleted the dev-du-block-size-0 branch April 12, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants