Actions
Bug #21354
closed
Symbol#to_proc is not ractor safe
Bug #21354:
Symbol#to_proc is not ractor safe
Description
There is caching in Symbol#to_proc
(rb_sym_to_proc
) that makes the assumption that we're always in the main ractor. With multiple ractors, this caching logic is not ractor-safe in that cached procs created in one ractor can leak into other ractors. In a debug build, this results in a ractor_confirm_belonging
assertion failure.
Ruby code that reproduces the issue:
:inspect.to_proc
Ractor.new do
:inspect.to_proc
end.take
Actions