Project

General

Profile

Actions

Bug #22378

open

`Ractor::IsolationError` in code not using Ractors

Bug #22378: `Ractor::IsolationError` in code not using Ractors

Added by Earlopain (Earlopain _) 1 day ago. Updated 1 day ago.

Status:
Open
Assignee:
Target version:
-
ruby -v:
ruby 4.1.0dev (2026-09-23T07:42:54Z master 8cdc7b5957) +PRISM [x86_64-linux]
[ruby-core:126842]

Description

# 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. Caused by #22291


Related issues 1 (0 open — 1 closed)

Related to Ruby - Bug #22291: Instance variables should be forbidden on Ractor-shareable objectsClosedActions

Updated by Earlopain (Earlopain _) 1 day ago Actions #1

  • Related to Bug #22291: Instance variables should be forbidden on Ractor-shareable objects added

Updated by Earlopain (Earlopain _) 1 day ago Actions #2

  • Description updated (diff)

Updated by luke-gru (Luke Gruber) 1 day ago Actions #3

  • Assignee set to ractor
Actions

Also available in: PDF Atom