Project

General

Profile

Actions

Bug #18232

closed

Ractor.make_shareable is broken in code loaded with RubyVM::InstructionSequence.load_from_binary

Added by byroot (Jean Boussier) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.2p107, ruby 3.1.0dev
Backport:
[ruby-core:105504]

Description

This was first reported as a Bootsnap bug: https://github.com/Shopify/bootsnap/issues/376

But I reduced it to:

source = <<~RUBY
  x = :foo
  pr = Proc.new { p x }
  Ractor.make_shareable(pr)
  pr.call
RUBY
RubyVM::InstructionSequence.compile(source).eval # :foo
RubyVM::InstructionSequence.load_from_binary(RubyVM::InstructionSequence.compile(source).to_binary).eval # false

The bug is present on both 3.0.2 and 3.1.0-dev. I have no idea what might cause this.


Files


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #18243: Ractor.make_shareable does not freeze the receiver of a Proc but allows accessing ivars of itClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0