Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt: Crashes for some inputs (?) #6354

Closed
BenWiederhake opened this issue May 5, 2024 · 0 comments · Fixed by #6359
Closed

fmt: Crashes for some inputs (?) #6354

BenWiederhake opened this issue May 5, 2024 · 0 comments · Fixed by #6359
Labels

Comments

@BenWiederhake
Copy link
Collaborator

$ yes a | head -n50 > 50a.txt
$ fmt -w 75 -g 10 50a.txt 
a a a a a a
a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
$ cargo run -q fmt -w 75 -g 10 50a.txt 
thread 'main' panicked at 'attempt to subtract with overflow', src/uu/fmt/src/linebreak.rs:242:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
a[$? = 101]

I have no idea why it crashes here. It seems to crash for any "goal" of 37 or less.

Might be related to #5162, might not.

ahmadabd added a commit to ahmadabd/coreutils that referenced this issue May 5, 2024
ahmadabd added a commit to ahmadabd/coreutils that referenced this issue May 5, 2024
ahmadabd added a commit to ahmadabd/coreutils that referenced this issue May 5, 2024
ahmadabd added a commit to ahmadabd/coreutils that referenced this issue May 5, 2024
ahmadabd added a commit to ahmadabd/coreutils that referenced this issue May 5, 2024
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 a pull request may close this issue.

1 participant