Bug #17636
Updated by peterzhu2118 (Peter Zhu) almost 4 years ago
[GitHub PR](https://github.com/ruby/ruby/pull/4191)
When `RGENGC_CHECK_MODE` is enabled and we use multiple ractors, there is a race condition in `check_rvalue_consistency_force` that causes an assertion to fail. It happens when a page is created during the call to `is_pointer_to_heap`, which causes the binary search to fail.
# Reproduction
```ruby
NUM_RACTORS = 10
rs = NUM_RACTORS.times.map do |i|
Ractor.new(i) do |i|
arr = []
10_000.times do |j|
arr << "foo.#{i}.#{j}"
end
arr
end
end
arrs = rs.map { |r| r.take }
```
The crash log is attached below in `crash.log`.