Project

General

Profile

Actions

Bug #17612

closed

ractor crash with some simple codes

Added by tomanderson (Thomas Ender) almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Target version:
-
[ruby-core:102416]

Description

I found these codes will crash because of Ractor :

    e = (1..1000).to_a
    arr = [e,e,e,e]

    arr.map { |sub_arr|
      Ractor.new(sub_arr) do |sub_arr|
        sub_arr.map {
          Digest::MD5.hexdigest(rand.to_s)
        }
      end
    }.map{|r| r.take}.reduce(:+)

If change e to (1..100), no crashes any more. If we don't use Ractor, it's also good.

Environment: ruby3.0.0p0 + rails6.1.1.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #17742: Random.rand gets wrong after using Ractor and requiring benchmarkClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0