From f6cbf499bc98b851034fffb49fcbb59d495f6f7b Mon Sep 17 00:00:00 2001 From: Luke Gruber Date: Tue, 20 May 2025 09:41:57 -0400 Subject: Fix Symbol#to_proc (rb_sym_to_proc) to be ractor safe In non-main ractors, don't use `sym_proc_cache`. It is not thread-safe to add to this array without a lock and also it leaks procs from one ractor to another. Instead, we create a new proc each time. If this results in poor performance we can come up with a solution later. Fixes [Bug #21354] --- common.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common.mk') diff --git a/common.mk b/common.mk index e8c4e8d40e..7719047fd7 100644 --- a/common.mk +++ b/common.mk @@ -13836,6 +13836,8 @@ proc.$(OBJEXT): {$(VPATH)}prism/diagnostic.h proc.$(OBJEXT): {$(VPATH)}prism/version.h proc.$(OBJEXT): {$(VPATH)}prism_compile.h proc.$(OBJEXT): {$(VPATH)}proc.c +proc.$(OBJEXT): {$(VPATH)}ractor.h +proc.$(OBJEXT): {$(VPATH)}ractor_core.h proc.$(OBJEXT): {$(VPATH)}ruby_assert.h proc.$(OBJEXT): {$(VPATH)}ruby_atomic.h proc.$(OBJEXT): {$(VPATH)}rubyparser.h -- cgit v1.2.3