[前][次][番号順一覧][スレッド一覧]

ruby-changes:58234

From: Takashi <ko1@a...>
Date: Mon, 14 Oct 2019 11:31:48 +0900 (JST)
Subject: [ruby-changes:58234] 6fa3492362 (master): Eliminate the possibility to leave freed ISeq

https://git.ruby-lang.org/ruby.git/commit/?id=6fa3492362

From 6fa3492362dc91cfec7eb4fd55918791da5a34fb Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sun, 13 Oct 2019 19:29:46 -0700
Subject: Eliminate the possibility to leave freed ISeq

in active_units

Hoping to fix:
http://ci.rvm.jp/results/trunk-mjit@silicon-docker/2311375

diff --git a/mjit_worker.c b/mjit_worker.c
index 2650b1d..b23baf6 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1107,11 +1107,8 @@ convert_unit_to_func(struct rb_mjit_unit *unit) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1107
         remove_so_file(so_file, unit);
 
     if ((uintptr_t)func > (uintptr_t)LAST_JIT_ISEQ_FUNC) {
-        CRITICAL_SECTION_START(3, "end of jit");
-        add_to_list(unit, &active_units);
         verbose(1, "JIT success (%.1fms): %s@%s:%ld -> %s",
                 end_time - start_time, iseq_label, iseq_path, iseq_lineno, c_file);
-        CRITICAL_SECTION_FINISH(3, "end of jit");
     }
     return (mjit_func_t)func;
 }
@@ -1233,6 +1230,9 @@ mjit_worker(void) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1230
                 rb_native_cond_wait(&mjit_gc_wakeup, &mjit_engine_mutex);
             }
             if (unit->iseq) { // Check whether GCed or not
+                if ((uintptr_t)func > (uintptr_t)LAST_JIT_ISEQ_FUNC) {
+                    add_to_list(unit, &active_units);
+                }
                 // Usage of jit_code might be not in a critical section.
                 MJIT_ATOMIC_SET(unit->iseq->body->jit_func, func);
             }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]