From adcf0316d1ecedae2a9157ad941550e0c0fb510b Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Fri, 28 Feb 2020 23:58:33 -0800 Subject: Prevent unloading methods used in root_fiber while calling another Fiber (#2939) Fixing SEGVs like: http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744905 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744420 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2741400 --- mjit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index b5fcffab10..a5461414d3 100644 --- a/mjit.c +++ b/mjit.c @@ -19,6 +19,7 @@ #include "id_table.h" #include "internal.h" #include "internal/class.h" +#include "internal/cont.h" #include "internal/file.h" #include "internal/hash.h" #include "internal/mjit.h" @@ -811,6 +812,9 @@ mjit_init(const struct mjit_options *opts) rb_native_cond_initialize(&mjit_worker_wakeup); rb_native_cond_initialize(&mjit_gc_wakeup); + // Make sure root_fiber's saved_ec is scanned by mark_ec_units + rb_fiber_init_mjit_cont(GET_EC()->fiber_ptr); + // Initialize class_serials cache for compilation valid_class_serials = rb_hash_new(); rb_obj_hide(valid_class_serials); -- cgit v1.2.3