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

ruby-changes:63017

From: Aaron <ko1@a...>
Date: Sat, 19 Sep 2020 09:07:48 +0900 (JST)
Subject: [ruby-changes:63017] 6cb6d5abc3 (master): Add assertions when inline caches are copied to MJIT

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

From 6cb6d5abc36ede9d5158c2cd90734134838e6bfb Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Fri, 18 Sep 2020 17:04:59 -0700
Subject: Add assertions when inline caches are copied to MJIT

This is a temporary commit to try to find a GC issue.  It seems like
mjit is pointing at a moved address in the call cache.  I want to assert
that they aren't TMOVED or garbage objects at the time they get copied

diff --git a/mjit_worker.c b/mjit_worker.c
index a9d0bf3..160b8cf 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1261,6 +1261,17 @@ mjit_capture_cc_entries(const struct rb_iseq_constant_body *compiled_iseq, const https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1261
     // Capture cc to cc_enties
     for (unsigned int i = 0; i < captured_iseq->ci_size; i++) {
         cc_entries[i] = captured_iseq->call_data[i].cc;
+
+        // Adding assertions to debug GC problem.
+        // FIXME: remove these when we find it
+        const struct rb_callcache *cc = cc_entries[i];
+
+        if (cc && vm_cc_markable(cc)) {
+            assert(BUILTIN_TYPE(cc) != T_MOVED);
+            assert(BUILTIN_TYPE(vm_cc_cme(cc)) != T_MOVED);
+            assert(!rb_objspace_garbage_object_p(cc));
+            assert(!rb_objspace_garbage_object_p(vm_cc_cme(cc)));
+        }
     }
 
     return cc_entries_index;
-- 
cgit v0.10.2


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

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