Skip to content

std.Progress: fix many bugs #23725

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

std.Progress: fix many bugs #23725

wants to merge 1 commit into from

Conversation

mlugg
Copy link
Member

@mlugg mlugg commented Apr 29, 2025

There were several bugs with the synchronization here; most notably an ABA problem which was causing #21663. I fixed that and some other issues, and took the opportunity to get rid of the .seq_cst orderings from this file. I'm at least relatively sure my new orderings are correct.

Thanks to @achan1989 for noticing the ABA problem here and putting up an initial fix. This PR supersedes #23662, but I've marked you as a co-author here!

Resolves: #21663

@mlugg mlugg mentioned this pull request Apr 29, 2025
@mlugg
Copy link
Member Author

mlugg commented Apr 29, 2025

I should mention: achan1989's repro is indeed able to consistently trigger the crash for me on master, and does not on this branch. I also don't see any garbled output or other issues.

@alexrp alexrp added this to the 0.14.1 milestone Apr 29, 2025
@mlugg
Copy link
Member Author

mlugg commented Apr 29, 2025

TSan also much prefers this to master; with a slightly modified version of achan1989's repro, I get a lot of TSan warnings followed by an assertion failure on master, whereas on this branch it just runs indefinitely without a problem.

There were several bugs with the synchronization here; most notably an
ABA problem which was causing ziglang#21663. I fixed that and some other
issues, and took the opportunity to get rid of the `.seq_cst` orderings
from this file. I'm at least relatively sure my new orderings are correct.

Co-authored-by: achan1989 <[email protected]>
Resolves: ziglang#21663
@achan1989
Copy link
Contributor

This is much easier to read and understand now :)

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 this pull request may close these issues.

std.Progress panic: reached unreachable code
4 participants