Hi,

At Wed, 18 Mar 2009 11:14:05 +0900,
Nobuyoshi Nakada wrote in [ruby-core:22925]:
> It was a bug of ruby-prof.  It tries to allocate an object
> during mark phase.

This patch might not be enough.  You would need to mark objects
refered by call_info->target and call_info->parent even if they
are not created.


Index: ext/ruby_prof.c =================================================================== --- ext/ruby_prof.c (revision 362) +++ ext/ruby_prof.c (working copy) @@ -308,11 +308,26 @@ prof_call_info_create(prof_method_t* met } +static void prof_method_mark(prof_method_t *method); + static void prof_call_info_mark(prof_call_info_t *call_info) { - rb_gc_mark(prof_method_wrap(call_info->target)); + { + VALUE target = call_info->target->object; + if (NIL_P(target)) + prof_method_mark(call_info->target); + else + rb_gc_mark(target); + } rb_gc_mark(call_info->children); - if (call_info->parent) - rb_gc_mark(prof_call_info_wrap(call_info->parent)); + if (call_info->parent) { + VALUE parent = call_info->parent->object; + if (NIL_P(parent)) { + prof_call_info_mark(call_info->parent); + } + else { + rb_gc_mark(parent); + } + } }
-- Nobu Nakada