-
-
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
Seed Libc rng from system entropy #43606
Conversation
We're seeing lots of CI failures that look like collisions in the names of temporary variables. Currently we're seeding the libc rng from a low entropy clock, which is somewhat likely to have collisions particular if (as we are), you launch all your processes at exactly the right time. Try to fix that by seeding the libc using system entropy. Of course that still leaves the potential for birthday problems, but hopfully this will tide us over until #43597 gets fixed.
It looks like this has fixed the CI failures! (At least for now.) |
println(stderr, | ||
"Entropy pool not available to seed RNG; using ad-hoc entropy sources.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println(stderr, | |
"Entropy pool not available to seed RNG; using ad-hoc entropy sources.") |
base = 16) % UInt) | ||
catch | ||
end | ||
Base._ad_hoc_entropy_source() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base._ad_hoc_entropy_source() | |
seed = Base._ad_hoc_entropy_source() |
end | ||
end # os-test | ||
|
||
function _ad_hoc_entropy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a unittest for this (just literally call @test_warn "ad-hoc" Base._ad_hoc_entropy_source()
, and make sure it returns a reasonable value?
"Entropy pool not available to seed RNG; using ad-hoc entropy sources.") | ||
seed = reinterpret(UInt64, time()) | ||
seed = hash(seed, getpid() % UInt) | ||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try | |
Sys.iswindows() || try |
There should not be a risk of the birthday paradox anymore, after #38879. The bigger issue is perhaps actually that |
We're seeing lots of CI failures that look like collisions in the names of temporary variables. Currently we're seeding the libc rng from a low entropy clock, which is somewhat likely to have collisions particular if (as we are), you launch all your processes at exactly the right time. Try to fix that by seeding the libc using system entropy. Of course that still leaves the potential for birthday problems, but hopfully this will tide us over until JuliaLang#43597 gets fixed.
This reverts commit 5819775.
Continuation from #43606 - Replaces thread-unsafe function `rand` with `jl_rand`. - Fixes `_ad_hoc_entropy_source` fallback in Random. - Uses uv_random for more direct access to quality-randomness (usually a syscall rather than a file.) - Ensures Array{Bool} are valid when created from RandomDevice.
Continuation from #43606 - Replaces thread-unsafe function `rand` with `jl_rand`. - Fixes `_ad_hoc_entropy_source` fallback in Random. - Uses uv_random for more direct access to quality-randomness (usually a syscall rather than a file.) - Ensures Array{Bool} are valid when created from RandomDevice.
We're seeing lots of CI failures that look like collisions in the names of temporary variables. Currently we're seeding the libc rng from a low entropy clock, which is somewhat likely to have collisions particular if (as we are), you launch all your processes at exactly the right time. Try to fix that by seeding the libc using system entropy. Of course that still leaves the potential for birthday problems, but hopfully this will tide us over until JuliaLang#43597 gets fixed.
Continuation from #43606 - Replaces thread-unsafe function `rand` with `jl_rand`. - Fixes `_ad_hoc_entropy_source` fallback in Random. - Uses uv_random for more direct access to quality-randomness (usually a syscall rather than a file.) - Ensures Array{Bool} are valid when created from RandomDevice.
Continuation from #43606 - Replaces thread-unsafe function `rand` with `jl_rand`. - Fixes `_ad_hoc_entropy_source` fallback in Random. - Uses uv_random for more direct access to quality-randomness (usually a syscall rather than a file.) - Ensures Array{Bool} are valid when created from RandomDevice.
Continuation from #43606 - Replaces thread-unsafe function `rand` with `jl_rand`. - Fixes `_ad_hoc_entropy_source` fallback in Random. - Uses uv_random for more direct access to quality-randomness (usually a syscall rather than a file.) - Ensures Array{Bool} are valid when created from RandomDevice.
Continuation from #43606 - Replaces thread-unsafe function `rand` with `jl_rand`. - Fixes `_ad_hoc_entropy_source` fallback in Random. - Uses uv_random for more direct access to quality-randomness (usually a syscall rather than a file.) - Ensures Array{Bool} are valid when created from RandomDevice. (cherry picked from commit b4bed71)
We're seeing lots of CI failures that look like collisions in the
names of temporary files. Currently we're seeding the libc
rng from a low entropy clock, which is somewhat likely to have
collisions particular if (as we are), you launch all your processes
at exactly the right time. Try to fix that by seeding the libc using
system entropy. Of course that still leaves the potential for birthday
problems, but hopfully this will tide us over until #43597 gets fixed.