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

ruby-changes:55427

From: k0kubun <ko1@a...>
Date: Sat, 20 Apr 2019 14:44:54 +0900 (JST)
Subject: [ruby-changes:55427] k0kubun:r67636 (trunk): Skip ISeq reference for stale_units for debugging

k0kubun	2019-04-20 14:44:47 +0900 (Sat, 20 Apr 2019)

  New Revision: 67636

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67636

  Log:
    Skip ISeq reference for stale_units for debugging

  Modified files:
    trunk/mjit.c
Index: mjit.c
===================================================================
--- mjit.c	(revision 67635)
+++ mjit.c	(revision 67636)
@@ -174,7 +174,21 @@ free_list(struct rb_mjit_unit_list *list https://github.com/ruby/ruby/blob/trunk/mjit.c#L174
     list_for_each_safe(&list->head, unit, next, unode) {
         list_del(&unit->unode);
         if (!close_handle_p) unit->handle = NULL; /* Skip dlclose in free_unit() */
-        free_unit(unit);
+
+        if (list == &stale_units) { // `free_unit(unit)` crashes after GC.compact on `stale_units`
+            /*
+             * TODO: REVERT THIS BRANCH
+             * Debug the crash on stale_units w/ GC.compact and just use `free_unit(unit)`!!
+             */
+            if (unit->handle && dlclose(unit->handle)) {
+                mjit_warning("failed to close handle for u%d: %s", unit->id, dlerror());
+            }
+            clean_object_files(unit);
+            free(unit);
+        }
+        else {
+            free_unit(unit);
+        }
     }
     list->length = 0;
 }

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

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