[ruby-core:102840] [Ruby master Bug#17612] ractor crash with some simple codes
From:
naruse@...
Date:
2021-03-13 08:54:52 UTC
List:
ruby-core #102840
Issue #17612 has been updated by naruse (Yui NARUSE).
Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: REQUIRED to 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: DONE
ruby_3_0 6bf32cbed8f3fd0b73b99737d671f833c594d800 merged revision(s) 63abb5c227e5c20d18d0debf699251da93ca64b5,34d02631e71209b12abb69d0114601027e485bc9,2adbf01ae14c0a4cf190b7c969b91726966a0e0f,3acc81d9e41b18380b9e0168fe2b5e5e0c727256.
----------------------------------------
Bug #17612: ractor crash with some simple codes
https://bugs.ruby-lang.org/issues/17612#change-90898
* Author: tomanderson (Thomas Ender)
* Status: Closed
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: DONE
----------------------------------------
I found these codes will crash because of **Ractor** :
``` ruby
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.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>