John Hawthorn 2026-05-26 18:08:47 +0000 (Tue, 26 May 2026)
New Revision: aac1d87040
https://github.com/ruby/ruby/commit/aac1d87040
Log:
Use stack callinfo/calldata for super dispatch
Previously vm_search_super_method would allocate a new callinfo and
write it back into the iseq's call data. Because iseqs can be shared
between Ractors (e.g. via Ractor.shareable_proc + define_method), two
Ractors invoking super through the same iseq could race on the ci/cc,
producing wrong dispatch or crashes from torn callcache reads on
weakly-ordered architectures.
Build the adjusted callinfo on the stack instead, mirroring
sendforward/invokesuperforward. The callcache is also loaded and stored
back with acquire/release atomics so it can be safely shared.
[Bug #22084]
Modified files:
insns.def
test/ruby/test_ractor.rb
vm_insnhelper.c
zjit/src/cruby.rs
zjit/src/hir.rs