8000 YJIT: Squash canary before falling back · k0kubun/ruby@f05ad37 · GitHub
[go: up one dir, main page]

Skip to content

Commit f05ad37

Browse files
committed
YJIT: Squash canary before falling back
Recent flaky canary-related CI failures have all happened while trying to fall back. It's unclear what is leaving the canary on the stack and causing gen_send_dynamic() to falsely assume that it should be leaf, and this patch isn't going to help us find the source. One source I found is Array#<< with a frozen array, but it's unclear if that's what's causing the CI failures. I'm somewhat afraid to add a canary check to rb_longjmp() since that might introduce more flaky failures, and maybe ones unrelated to YJIT. See: https://github.com/ruby/ruby/actions/runs/8083502532/job/22086714152 See: https://github.com/ruby/ruby/actions/runs/8066858522/job/22035963315
1 parent 558b58d commit f05ad37

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

yjit/src/codegen.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8006,6 +8006,12 @@ fn gen_send_dynamic<F: Fn(&mut Assembler) -> Opnd>(
80068006
// Save PC and SP to prepare for dynamic dispatch
80078007
jit_prepare_non_leaf_call(jit, asm);
80088008

8009+
// Squash stack canary that might be left over from elsewhere
8010+
assert_eq!(false, asm.get_leaf_ccall());
8011+
if cfg!(debug_assertions) {
8012+
asm.store(asm.ctx.sp_opnd(0), 0.into());
8013+
}
8014+
80098015
// Dispatch a method
80108016
let ret = vm_sendish(asm);
80118017

0 commit comments

Comments
 (0)
0