Bug #1227
closed
[BUG] object allocation during garbage collection phase
Added by orem (Chris Schlaeger) over 15 years ago.
Updated over 13 years ago.
Status:
Third Party's Issue
ruby -v:
ruby 1.9.2dev (2009-02-28 trunk 22678) [x86_64-linux]
[ruby-core:22597]
Description
=begin
I'm trying to profile sections of a large application (taskjuggler) with ruby-prof. As soon as I hit the RubyProf.stop call, I get the attached error message. Since ruby-prof is using C code as well, this may be a ruby-prof issue, but could also be a generic ruby bug. ruby 1.9 and ruby-prof both from svn today. Enclosing the RubyProf.stop call with GC.en-/disabled calls is a workaround, but no long-term solution.
To reproduce:
get ruby 1.9 and ruby-prof from svn. get taskjuggler3 from git (commit eee3a2c6f0d559086f95bc2b02e54bdae337fd95) has the offending code.
git clone http://www.taskjuggler.org/git-repos/taskjuggler3.git
cd taskjuggler3
git checkout eee3a2c6f0d559086f95bc2b02e54bdae337fd9
cd lib; ruby taskjuggler3.rb ../examples/acso.tjp
=end
Files
err (5 KB)
err |
|
orem (Chris Schlaeger), 03/01/2009 02:01 AM
|
|
=begin
Hey Chris,
Just saw this. I haven't had a chance to update ruby-prof to 1.9.1 yet. Have you tried yet? Unfortunately, I'm not sure I'll get to it anytime soon, so any help appreciated.
=end
=begin
Hi,
At Sun, 1 Mar 2009 02:00:04 +0900,
Chris Schlaeger wrote in [ruby-core:22597]:
To reproduce:
get ruby 1.9 and ruby-prof from svn.
Where's ruby-prof svn?
--
Nobu Nakada
=end
=begin
Hi,
At Mon, 9 Mar 2009 19:24:33 +0900,
daz wrote in [ruby-core:22781]:
Maybe this, from:
http://rubyforge.org/scm/?group_id=1814
svn checkout http://ruby-prof.rubyforge.org/svn/
or
svn checkout svn://rubyforge.org/var/svn/ruby-prof
Thank you.
It was a bug of ruby-prof. It tries to allocate an object
during mark phase.
Index: ext/ruby_prof.c
--- ext/ruby_prof.c (revision 362)
+++ ext/ruby_prof.c (working copy)
@@ -311,8 +311,8 @@ static void
prof_call_info_mark(prof_call_info_t *call_info)
{
- rb_gc_mark(prof_method_wrap(call_info->target));
- rb_gc_mark(call_info->target->object);
rb_gc_mark(call_info->children);
if (call_info->parent)
- rb_gc_mark(prof_call_info_wrap(call_info->parent));
- rb_gc_mark(call_info->parent->object);
}
--
Nobu Nakada
=end
- Status changed from Open to Third Party's Issue
=begin
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));
- if (call_info->parent)
- rb_gc_mark(prof_call_info_wrap(call_info->parent));
--
Nobu Nakada
=end
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0