[ruby-core:125705] [Ruby Bug#22105] Cannot initialize a WeakRef in a Ractor
Issue #22105 has been reported by miles-georgi (Miles Georgi). ---------------------------------------- Bug #22105: Cannot initialize a WeakRef in a Ractor https://bugs.ruby-lang.org/issues/22105 * Author: miles-georgi (Miles Georgi) * Status: Open * ruby -v: ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [x86_64-linux] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Hey hey! If I try to create a WeakRef in a Ractor, like in this script: ``` ruby require "weakref" Ractor.new { WeakRef.new("asdf") }.join ``` Then I get this error: ``` 4.1-dev/lib/ruby/4.1.0+3/weakref.rb:40:in 'WeakRef#initialize': can not read non-shareable class variable @@__map from non-main Ractors (WeakRef) (Ractor::IsolationError) ``` This happens in both a local build of 4.1-dev and 4.0.5 and likely other versions. -- https://bugs.ruby-lang.org/
participants (1)
-
miles-georgi (Miles Georgi)