From c2b8cd425e80ea75c9f3efd8b5b63f1f235b6b54 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sat, 20 Apr 2019 05:50:19 +0000 Subject: Revert "Revert "Skip ISeq reference for stale_units for debugging"" This reverts commit b79899b56a9ebadf5c493c4df2419ebf63934381. I wanted to test r67638 first. Now let me try this as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index 186702270d..a65f990280 100644 --- a/mjit.c +++ b/mjit.c @@ -177,7 +177,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; } -- cgit v1.2.3