Project

General

Profile

Actions

Bug #17636

closed

Race condition in check_rvalue_consistency_force when using ractors

Added by peterzhu2118 (Peter Zhu) almost 4 years ago. Updated over 3 years ago.

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

Description

GitHub PR

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

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.


Files

crash.log (20.1 KB) crash.log peterzhu2118 (Peter Zhu), 02/16/2021 03:25 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0