precompilation: fix show_progress crash when bar.current goes negative#61335
Merged
IanButterworth merged 4 commits intoJuliaLang:masterfrom Mar 16, 2026
Merged
Conversation
There is a race between the print loop task and worker tasks: when a package is already up-to-date, a worker increments n_already_precomp[] before incrementing n_done[], so the print loop can observe a window where n_done[] - n_already_precomp[] is transiently negative. This caused show_progress to compute a negative n_filled and crash with "can't repeat a string -1 times". Guard both bar.current and bar.max with max(0, ...) to avoid this. Fixes JuliaLang#61333 Co-Authored-By: Claude <claude@users.noreply.github.com>
Member
|
It might be worth making the actual printing code more robust as well, like clamping these values: Lines 353 to 355 in a03bd9e |
topolarity
reviewed
Mar 16, 2026
Co-authored-by: Cody Tapscott <84105208+topolarity@users.noreply.github.com>
topolarity
reviewed
Mar 16, 2026
Co-authored-by: Cody Tapscott <84105208+topolarity@users.noreply.github.com>
topolarity
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #61333
There's likely a better fix for locking around incrementing these counters together, but I'd handle that after #60943
So just protect for now.