
Issue #20767 has been updated by alanwu (Alan Wu). Status changed from Open to Closed commit:a838f980f599d95ccf344157f7074e997af31f48 should have fixed this issue. ---------------------------------------- Bug #20767: VM_ASSERT fails on clear_method_entry_by_id_in_class() under a specific situation https://bugs.ruby-lang.org/issues/20767#change-110215 * Author: tagomoris (Satoshi Tagomori) * Status: Closed * ruby -v: ruby 3.4.0dev (2024-09-27T17:45:22Z vm_assertion_cme_o.. 027ef60500) +PRISM [arm64-darwin23] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- VM_ASSERT in `clear_method_entry_by_id_in_class()` (vm_method.c) fails when: * Kernel#require is refined * Kernel#require is replaced by `alias_method` and `define_method` * User code calls `require` * The aliased method entry is undefined Under this situation, `VM_ASSERT(cme->owner == T_CLASS)` fails in `clear_method_entry_by_id_in_class`. This CI failure shows it: https://github.com/ruby/ruby/actions/runs/11081754435/job/30793895707?pr=117... In this case, the cme had: * def->type: CFUNC * defined_class: Kernel * owner: Kernel I couldn't find the root cause of why Kernel is set on cme->owner, and why the owner is checked here. How should we fix this problem? * Just delete the VM_ASSERT() (because the cme is just to be invalidated) * Fix the root cause of the invalid&unexpected cme->owner -- https://bugs.ruby-lang.org/