Project

General

Profile

Actions

Bug #22398

open

`alias_method` over a bmethod fails `rb_vm_check_ints` assertion after a Ractor has been created

Bug #22398: `alias_method` over a bmethod fails `rb_vm_check_ints` assertion after a Ractor has been created

Added by yahonda (Yasuo Honda) 37 minutes ago. Updated 2 minutes ago.

Status:
Open
Target version:
-
ruby -v:
ruby 4.1.0dev (2026-09-30T11:53:44Z master dd7be7ce69) +PRISM [x86_64-linux]
[ruby-core:126896]

Description

This issue is originally found at the Rails nightly CI with a debug build of Ruby. It started failing at https://buildkite.com/rails/rails-nightly/builds/4738#01a0ac05-212c-406d-bec7-190726eecc98 with ruby 4.1.0dev (2026-09-16T14:21:47Z master f2f53ccbe3). The full log of the first failure is attached.

Steps to reproduce

  1. Build ruby with -DRUBY_DEBUG=1 enabled like
#!/bin/bash

cd ${HOME}/src/github.com/ruby/ruby
make clean
make distclean
make realclean
./autogen.sh
./configure --prefix="${HOME}/.local/share/mise/installs/ruby/trunk" cppflags="-DENABLE_PATH_CHECK=0 -DRUBY_DEBUG=1" --disable-install-doc
make -j"$(getconf _NPROCESSORS_ONLN)"
make install
  1. Run this one liner
ruby -ve 'Ractor.new {}.join; o = Object.new; o.define_singleton_method(:a) { 1 }; o.define_singleton_method(:b) { 2 }; o.singleton_class.alias_method :a, :b'

Expected behavior

It should pass. It passes without Ractor.new {}.join.

Actual behavior

It aborts with an assertion failure.

$ ruby -ve 'Ractor.new {}.join; o = Object.new; o.define_singleton_method(:a) { 1 }; o.define_singleton_method(:b) { 2 }; o.singleton_class.alias_method :a, :b'
ruby 4.1.0dev (2026-09-30T11:53:44Z master dd7be7ce69) +PRISM [x86_64-linux]
-e:1: warning: Ractor API is experimental and may change in future versions of Ruby.
vm_core.h:2369: Assertion Failed: rb_vm_check_ints:ec->assert_critical_section_entered == 0
...

Additional information

This assertion was added in https://github.com/ruby/ruby/commit/a00df45480811a8909dca288f24950b5134d46b5


Files

Updated by luke-gru (Luke Gruber) 2 minutes ago Actions #1

  • Assignee set to luke-gru (Luke Gruber)
Actions

Also available in: PDF Atom