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

fix Libc.rand and seed problems #44432

Merged
merged 1 commit into from
Apr 7, 2022
Merged

fix Libc.rand and seed problems #44432

merged 1 commit into from
Apr 7, 2022

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Mar 3, 2022

Continuation from #43606
Close #43704

  • 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.

@ViralBShah ViralBShah added the randomness Random number generation and the Random stdlib label Mar 4, 2022
@vtjnash vtjnash force-pushed the jn/libc-rand branch 2 times, most recently from 6161877 to e64a9c7 Compare March 8, 2022 21:55
@vtjnash vtjnash requested a review from aviatesk March 10, 2022 20:31
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.
Copy link
Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through the changes and couldn't find any obvious issues -- still probably I am not familiar enough with these code bases to give an approval.

base/libc.jl Show resolved Hide resolved
@vtjnash vtjnash requested a review from staticfloat March 29, 2022 15:39
Copy link
Member

@staticfloat staticfloat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me, just a few questions around external visibility of the removed symbol

src/init.c Show resolved Hide resolved
src/jl_exported_funcs.inc Show resolved Hide resolved
src/julia_internal.h Show resolved Hide resolved
@vtjnash vtjnash merged commit b4bed71 into master Apr 7, 2022
@vtjnash vtjnash deleted the jn/libc-rand branch April 7, 2022 17:47
@KristofferC KristofferC added the backport 1.8 Change should be backported to release-1.8 label Jul 17, 2022
KristofferC pushed a commit that referenced this pull request Jul 17, 2022
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)
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new randomdevice code needs unittests
5 participants