From: "Earlopain (Earlopain _) via ruby-core" Date: 2026-09-23T11:16:43+00:00 Subject: [ruby-core:126842] [Ruby Bug#22378] `Ractor::IsolationError` in code not using Ractors Issue #22378 has been reported by Earlopain (Earlopain _). ---------------------------------------- Bug #22378: `Ractor::IsolationError` in code not using Ractors https://bugs.ruby-lang.org/issues/22378 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 4.1.0dev (2026-09-23T07:42:54Z master 8cdc7b5957) +PRISM [x86_64-linux] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ```rb # Reduced from the `httpx` gem @var = Class.new.freeze.dup @var.instance_variable_set(:@test, 123) ``` I expect this code to succeed. dup returns an unfrozen copy, so I should be able to set instance variables on it. However, I get the following error even though the code is ractor-free: ``` test.rb:2:in 'Kernel#instance_variable_set': can't modify instance variables of a shareable Class (Ractor::IsolationError) ``` It works on 4.0 but fails on current master. Behaviour changed recently, maybe #22291, but I haven't confirmed it. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/