From 1fdc97f1b76b7532d011b20d52f843a2bb0d1a2f Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sun, 20 Dec 2020 22:41:52 -0800 Subject: Mark active_units to avoid SEGV on mjit_recompile and compact_all_jit_code. For some reason, ISeqs on stack are sometimes GC-ed (why?) and therefore it may run mjit_recompile on a GC-ed ISeq, which I expected d07183ec85d to fix but apparently it may refer to random things if already GC-ed. Marking active_units would workaround the situation. http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3292740 Also, while compact_all_jit_code was executed, we saw some SEGVs where CCs seemed to be already GC-ed, meaning their owner ISeq was not marked properly. Even if units are still in active_units, it's not guaranteed that their ISeqs are in use. So in this case we need to mark active_units for a legitimate reason. http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3293277 http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3293090 --- vm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vm.c') diff --git a/vm.c b/vm.c index 0c2ffd9004..ee28a2d4ad 100644 --- a/vm.c +++ b/vm.c @@ -2594,6 +2594,8 @@ rb_vm_mark(void *ptr) rb_gc_mark_values(RUBY_NSIG, vm->trap_list.cmd); rb_id_table_foreach_values(vm->negative_cme_table, vm_mark_negative_cme, NULL); + + mjit_mark(); } RUBY_MARK_LEAVE("vm"); -- cgit v1.2.3