summaryrefslogtreecommitdiff
path: root/spec/ruby/shared
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-08-20 10:53:18 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-08-20 15:53:00 -0400
commit2c7ec3d155ba9d3e0589f716c1522f2c26371586 (patch)
tree51e68ce0c0ac261efa55d8a01eae3ded99478e7c /spec/ruby/shared
parent5c96bbf36a73e29561b2b1a0e42c6f3341a4e542 (diff)
Fix race condition in method invalidation for Ractors
We lock the VM to invalidate method entries. However, we do not lock the VM to call methods, so it's possible that during a method call the method entry gets invalidated. We only check that the method entry in the callcache is not invalidated at the beginning of the method call, which makes it possible to have race conditions. This causes crashes like: vm_callinfo.h:421: Assertion Failed: vm_cc_cme:cc->klass != Qundef || !vm_cc_markable(cc) vm_insnhelper.c:2200: Assertion Failed: vm_lookup_cc:!METHOD_ENTRY_INVALIDATED(vm_cc_cme(ccs_cc)) This commit adds a VM barrier to method cache invalidation to ensure that other Ractors are stopped at a safe-point before invalidating the method entry.
Diffstat (limited to 'spec/ruby/shared')
0 files changed, 0 insertions, 0 deletions