uutils / uutils/coreutils

`du` overflows the stack

Open
#10,173 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Here are the steps to reproduce:

$ mkdir -p $(yes a | head -n 1024 | tr '\n' '/')
$ uu-du a
Segmentation fault         (core dumped) uu-du a

Most likely because of this recursive call:

https://github.com/uutils/coreutils/blob/e96b5369f569ee46c29c6d72b7ae24b72909cbba/src/uu/du/src/du.rs#L685-L693

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 by running the reported 1,024-level reproduction, then inspect the recursive call in src/uu/du/src/du.rs at lines 685-693. Trace how nested directories are traversed and verify that uu-du a completes without a segmentation fault while preserving its directory-size output.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.