Project

General

Profile

Actions

Bug #17742

closed

Random.rand gets wrong after using Ractor and requiring benchmark

Added by andras@frontfoo.com (Andras Horvath) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
[ruby-core:102984]

Description

Dear All,

I use Ruby v3.0.0 on Ubuntu 18.04 x64 compiled from source the recommended way and when I run the following code:

require "benchmark"; r = []; 3.times.map{ r << Ractor.new{ p receive } }; r.map{|x| x.send(rand) }; rand

Then the "rand" method gets messed up. Running simply "rand" give weird values like 0.00000 or 1.0 or 0.3.

The same issue happens when running from pry or the installed irb shell or even when running from command line with the -e option.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #17612: ractor crash with some simple codesClosedko1 (Koichi Sasada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0