-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Possible data races on global mutable state in Base? #49778
Comments
(I used julia> for n in LookingGlass.module_globals_names(Base, constness=:const, mutability=:mutable)
println("const $n")
end
const ACTIVE_PROJECT
const ARGS
const BUILD_TRIPLET
const COMPILETIME_PREFERENCES
const DATAROOTDIR
const DEFAULT_LOAD_PATH
const DEPOT_PATH
const DL_LOAD_PATH
const DOCDIR
const ENABLE_PRECOMPILE_WARNINGS
... |
This is an awesome list! A couple you also missed from my list include:
Looks like most of those just need a simple lock associated with each. The Lines 1618 to 1619 in 5039d8a
There was a brief observation recently that those may be semi-equivalent to |
Excellent! Thanks for the details, and the confirmation. 👍 |
Yeah, cool. I would advocate for just slapping a lock around each of these as a first pass, and then coming back and fixing any other conceptual / correctness issues with the code in question in a later pass. I don't want us to be hunting down memory corruptions in production again like this again if we can avoid it. As observed in #49774, these are obviously quite problematic. The failures can be severe, inexplicable, and just infrequent enough to make them difficult to track down. |
Following up from #49746 / #49774, I thought I'd try to spend a few minutes auditing all the other global mutable data structures we have in Base for thread safety. I didn't check every single one, but these are the ones that stood out to me as possibly racy and needing a lock.
There were others, but I believe they are only ever mutated during startup, when loading the sysimg, so I left them out.
Here's the list of questionable items - I would definitely appreciate a second opinion from other devs. Thanks!
Thanks!
CC: @kpamnany / @vchuravy / @timholy / @vtjnash as people to tag according to
git blame
The text was updated successfully, but these errors were encountered: