aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-20 05:44:47 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-20 05:44:47 +0000
commit4bd4d4e4cfd164f767e88f844cf10b06faee14b9 (patch)
tree06a631e413ec5c94b7d629325bb04c7414581b08 /mjit.c
parent109633b12730484ea23bac5203a8ed6d6d820477 (diff)
downloadruby-4bd4d4e4cfd164f767e88f844cf10b06faee14b9.tar.gz
Skip ISeq reference for stale_units for debugging
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/mjit.c b/mjit.c
index 0cedd55e57..f92b6f3226 100644
--- a/mjit.c
+++ b/mjit.c
@@ -174,7 +174,21 @@ free_list(struct rb_mjit_unit_list *list, bool close_handle_p)
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;
}