From cae85c528c7c8ea1dd3ba634db5ccb9e465707f7 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Thu, 5 May 2022 16:30:56 -0400 Subject: [PATCH] Mark RCLASS_INCLUDER Since 4d8f76286beefbb8f7fba2479f6d0a0b4a47304c, we need to dereference the includer field on iclasses, so we need to mark it to make sure it's alive. Sometimes during compaction we crash because the field is dangling, though I have a hard time constructing such a situation. See http://ci.rvm.jp/results/trunk@ruby-iga/3947725 --- gc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gc.c b/gc.c index 22a1839fb3..3710bafce3 100644 --- a/gc.c +++ b/gc.c @@ -6994,6 +6994,10 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj) gc_mark(objspace, RCLASS_SUPER(obj)); } if (!RCLASS_EXT(obj)) break; + + if (RCLASS_INCLUDER(obj)) { + gc_mark(objspace, RCLASS_INCLUDER(obj)); + } mark_m_tbl(objspace, RCLASS_CALLABLE_M_TBL(obj)); cc_table_mark(objspace, obj); break;