Project

General

Profile

ActionsLike0

Bug #19338

open

Ruby hangs when ouputting warnings inside ractor with VM lock held

Added by luke-gru (Luke Gruber) about 2 years ago. Updated about 2 years ago.

Status:
Assigned
Target version:
-
[ruby-core:111809]

Description

This code causes Ruby to hang:

rs = []
2.times do
  rs << Ractor.new do
    MYCONSTANT = 2
  end
end
rs.each(&:take)

There is a problem when the warning is being outputted with multiple ractors. A thread is calling RB_VM_LOCK() while holding the VM lock in ractor.c (ractor_check_blocking())

If the code is changed to RB_VM_LOCK_ENTER() and RB_VM_LOCK_LEAVE() then it fixes it, but I don't know if there's a better way.

Thanks!

#1

Updated by luke-gru (Luke Gruber) about 2 years ago

  • Subject changed from Ruby hangs when defining new constant in ractor to Ruby hangs when ouputting warnings inside ractor
#3

Updated by luke-gru (Luke Gruber) about 2 years ago

  • Subject changed from Ruby hangs when ouputting warnings inside ractor to Ruby hangs when ouputting warnings inside ractor with VM lock held

Updated by hsbt (Hiroshi SHIBATA) about 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)
ActionsLike0

Also available in: Atom PDF