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 2 months ago. Updated about 2 months ago.

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

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

Files

ruby-2026-01-02-063109.ips (10.2 KB) ruby-2026-01-02-063109.ips crash report ahogappa (sho hirano), 01/01/2026 09:34 PM

Updated by nobu (Nobuyoshi Nakada) about 2 months ago Actions #2 [ruby-core:124413]

  • Tags set to box
  • Status changed from Open to Assigned
  • Assignee set to tagomoris (Satoshi Tagomori)
  • Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: REQUIRED
Actions

Also available in: PDF Atom