Project

General

Profile

Actions

Bug #22098

open

RUBY_INTERNAL_THREAD_EVENT_RESUMED runs without GVL held

Bug #22098: RUBY_INTERNAL_THREAD_EVENT_RESUMED runs without GVL held

Added by luke-gru (Luke Gruber) 5 days ago. Updated 3 days ago.

Status:
Open
Target version:
-
[ruby-core:125653]

Description

Today, it's possible to get a deadlock when allocating during a hook for this event. I attached a reproduction script using the gvltools gem. One way to fix it would be to not allocate during this hook and change the documentation to be clear that the GVL is not held. Any gems relying on this behavior, like gvltools, would need to be patched.

Another way to approach it would be to change the call site for this hook invocation. I believe it would need to be added to quite a few places. To maintain Ractor safety, it would also need to be invoked without any locks held.

I'm curious about your thoughts @byroot (Jean Boussier).


Files

repro.rb (3.11 KB) repro.rb luke-gru (Luke Gruber), 06/09/2026 09:18 PM
run_loop.sh (2.82 KB) run_loop.sh luke-gru (Luke Gruber), 06/09/2026 09:27 PM
Actions

Also available in: PDF Atom