Project

General

Profile

Actions

Bug #21817

open

Ruby::Box crashes with refinement + bind_call + Symbol#to_proc combination

Bug #21817: Ruby::Box crashes with refinement + bind_call + Symbol#to_proc combination

Added by ahogappa (sho hirano) about 13 hours ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [arm64-darwin25]
[ruby-core:124412]

Description

Description

When running with RUBY_BOX=1, a combination of refinement on Binding class, bind_call, and Symbol#to_proc causes a crash with the error: [BUG] BUG: Local ep without cme/box, flags: 66660087

Reproduction Script

 # Run with: RUBY_BOX=1 ruby repro.rb

 using Module.new {
   refine ::Binding do
     def eval_methods
       ::Kernel.instance_method(:methods).bind_call(receiver)
     end
   end
 }

 p binding.eval_methods.map(&:to_s)

Expected Behavior

The script should return an array of method names as strings.

Actual Behavior

Ruby crashes with [BUG] BUG: Local ep without cme/box, flags: 66660087

Workaround

Using block form instead of Symbol#to_proc does not crash:

binding.eval_methods.map { it.to_s }  # This works

No data to display

Actions

Also available in: PDF Atom