1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

gc.c: more info

* gc.c (gc_mark_children): show more info for broken object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-06-19 06:11:15 +00:00
parent 0d736fb729
commit 541bdd29ba
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Wed Jun 19 15:11:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (gc_mark_children): show more info for broken object.
Wed Jun 19 14:04:41 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/envutil.rb (EnvUtil#rubybin): remove unnecessary

7
gc.c
View file

@ -105,6 +105,8 @@ static ruby_gc_params_t initial_params = {
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
void rb_gcdebug_print_obj_condition(VALUE obj);
#if USE_RGENGC
/* RGENGC_DEBUG:
* 1: basic information
@ -3397,6 +3399,11 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
break;
default:
#ifdef GC_DEBUG
rb_gcdebug_print_obj_condition((VALUE)obj);
#endif
if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("rb_gc_mark(): %p is T_NONE", (void *)obj);
if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("rb_gc_mark(): %p is T_ZOMBIE", (void *)obj);
rb_bug("rb_gc_mark(): unknown data type 0x%x(%p) %s",
BUILTIN_TYPE(obj), (void *)obj,
is_pointer_to_heap(objspace, obj) ? "corrupted object" : "non object");