diff --git a/gc/default/default.c b/gc/default/default.c index b7d43b0acb..aa06b7cc06 100644 --- a/gc/default/default.c +++ b/gc/default/default.c @@ -4395,7 +4395,15 @@ gc_mark_check_t_none(rb_objspace_t *objspace, VALUE obj) char obj_info_buf[256]; rb_raw_obj_info(obj_info_buf, 256, obj); - rb_bug("try to mark T_NONE object (obj: %s)", obj_info_buf); + char parent_obj_info_buf[256]; + if (objspace->rgengc.parent_object == Qfalse) { + strcpy(parent_obj_info_buf, "(none)"); + } + else { + rb_raw_obj_info(parent_obj_info_buf, 256, objspace->rgengc.parent_object); + } + + rb_bug("try to mark T_NONE object (obj: %s, parent: %s)", obj_info_buf, parent_obj_info_buf); } } diff --git a/gc/gc.h b/gc/gc.h index fe9aaeb965..8ca9987477 100644 --- a/gc/gc.h +++ b/gc/gc.h @@ -58,7 +58,7 @@ RUBY_SYMBOL_EXPORT_BEGIN // files in Ruby. size_t rb_size_mul_or_raise(size_t x, size_t y, VALUE exc); void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data); -void rb_obj_info_dump(VALUE obj); +const char *rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj); const char *rb_obj_info(VALUE obj); size_t rb_obj_memsize_of(VALUE obj); bool ruby_free_at_exit_p(void);