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

Panic in AtomicPosition::allow #405

Closed
arxanas opened this issue Mar 18, 2022 · 3 comments · Fixed by #406
Closed

Panic in AtomicPosition::allow #405

arxanas opened this issue Mar 18, 2022 · 3 comments · Fixed by #406

Comments

@arxanas
Copy link
Contributor

arxanas commented Mar 18, 2022

This is the panic, from this CI run:

The application panicked (crashed).
Message:  attempt to add with overflow
Location: C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\indicatif-0.17.0-rc.9\src\state.rs:420

It corresponds to this line:

capacity = Ord::min(MAX_BURST, capacity + new as u8 - 1);

Note that this is an addition which is overflowing, unlike the subtractions which are addressed in #403 and #404.

@chris-laplante
Copy link
Collaborator

Yep, this is the crash I've seen too. I still can't wrap my head around what is actually causing these though.

@djc
Copy link
Member

djc commented Mar 18, 2022

Well, if capacity + new is larger than 255, that would do it? And that would happen if there's a long wait between increments.

We could just do capacity.saturating_add(new) - 1.

@chris-laplante
Copy link
Collaborator

Well, if capacity + new is larger than 255, that would do it? And that would happen if there's a long wait between increments.

We could just do capacity.saturating_add(new) - 1.

Yes. And yeah, I guess it has to be long waits that's causing it.

Side note, but I hit this a few weeks ago and have been meaning to mention it: rust-lang/rust#86470. It is not an indicatif bug, but rather something that was fixed in Rust. Let's maybe just keep an eye out for issue reports that may involve it.

smklein added a commit to oxidecomputer/omicron that referenced this issue Mar 23, 2022
- Updates SHA256 digests, which were out of sync (... and correctly reporting "digest mismatch", which is good, I suppose)
- Reverts to an older version of indicatif to avoid hitting console-rs/indicatif#405 , which has not been fixed yet
@djc djc closed this as completed in #406 Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants