* [ruby-core:22597] [Bug #1227] [BUG] object allocation during garbage collection phase
@ 2009-02-28 17:00 Chris Schlaeger
2009-03-09 7:00 ` [ruby-core:22778] " Charlie Savage
2009-03-09 9:47 ` [ruby-core:22780] " Nobuyoshi Nakada
0 siblings, 2 replies; 8+ messages in thread
From: Chris Schlaeger @ 2009-02-28 17:00 UTC (permalink / raw
To: ruby-core
Bug #1227: [BUG] object allocation during garbage collection phase
http://redmine.ruby-lang.org/issues/show/1227
Author: Chris Schlaeger
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.2dev (2009-02-28 trunk 22678) [x86_64-linux]
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
----------------------------------------
http://redmine.ruby-lang.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:22778] [Bug #1227] [BUG] object allocation during garbage collection phase
2009-02-28 17:00 [ruby-core:22597] [Bug #1227] [BUG] object allocation during garbage collection phase Chris Schlaeger
@ 2009-03-09 7:00 ` Charlie Savage
2009-03-09 9:31 ` [ruby-core:22779] " Chris Schlaeger
2009-03-09 9:47 ` [ruby-core:22780] " Nobuyoshi Nakada
1 sibling, 1 reply; 8+ messages in thread
From: Charlie Savage @ 2009-03-09 7:00 UTC (permalink / raw
To: ruby-core
Issue #1227 has been updated by Charlie Savage.
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.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1227
----------------------------------------
http://redmine.ruby-lang.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:22779] Re: [Bug #1227] [BUG] object allocation during garbage collection phase
2009-03-09 7:00 ` [ruby-core:22778] " Charlie Savage
@ 2009-03-09 9:31 ` Chris Schlaeger
0 siblings, 0 replies; 8+ messages in thread
From: Chris Schlaeger @ 2009-03-09 9:31 UTC (permalink / raw
To: ruby-core
Yes, I was using Ruby 1.9.1 (or rather a post 1.9.1 SVN snapshot).
Chris
On Mon, Mar 9, 2009 at 8:00 AM, Charlie Savage <redmine@ruby-lang.org> wrote:
> Issue #1227 has been updated by Charlie Savage.
>
>
> 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.
> ----------------------------------------
> http://redmine.ruby-lang.org/issues/show/1227
>
> ----------------------------------------
> http://redmine.ruby-lang.org
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:22780] Re: [Bug #1227] [BUG] object allocation during garbage collection phase
2009-02-28 17:00 [ruby-core:22597] [Bug #1227] [BUG] object allocation during garbage collection phase Chris Schlaeger
2009-03-09 7:00 ` [ruby-core:22778] " Charlie Savage
@ 2009-03-09 9:47 ` Nobuyoshi Nakada
2009-03-09 10:24 ` [ruby-core:22781] " daz
1 sibling, 1 reply; 8+ messages in thread
From: Nobuyoshi Nakada @ 2009-03-09 9:47 UTC (permalink / raw
To: ruby-core
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:22781] Re: [Bug #1227] [BUG] object allocation during garbage collection phase
2009-03-09 9:47 ` [ruby-core:22780] " Nobuyoshi Nakada
@ 2009-03-09 10:24 ` daz
2009-03-18 2:14 ` [ruby-core:22925] " Nobuyoshi Nakada
0 siblings, 1 reply; 8+ messages in thread
From: daz @ 2009-03-09 10:24 UTC (permalink / raw
To: ruby-core
Nobuyoshi Nakada wrote:
> 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?
>
>
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
daz
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:22925] Re: [Bug #1227] [BUG] object allocation during garbage collection phase
2009-03-09 10:24 ` [ruby-core:22781] " daz
@ 2009-03-18 2:14 ` Nobuyoshi Nakada
2009-03-18 3:03 ` [ruby-core:22926] " Nobuyoshi Nakada
0 siblings, 1 reply; 8+ messages in thread
From: Nobuyoshi Nakada @ 2009-03-18 2:14 UTC (permalink / raw
To: ruby-core
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.
\f
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);
}
\f
--
Nobu Nakada
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:22926] Re: [Bug #1227] [BUG] object allocation during garbage collection phase
2009-03-18 2:14 ` [ruby-core:22925] " Nobuyoshi Nakada
@ 2009-03-18 3:03 ` Nobuyoshi Nakada
2009-11-20 18:30 ` [ruby-core:26839] " Roger Pack
0 siblings, 1 reply; 8+ messages in thread
From: Nobuyoshi Nakada @ 2009-03-18 3:03 UTC (permalink / raw
To: ruby-core
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.
\f
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);
+ }
+ }
}
\f
--
Nobu Nakada
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:26839] [Bug #1227] [BUG] object allocation during garbage collection phase
2009-03-18 3:03 ` [ruby-core:22926] " Nobuyoshi Nakada
@ 2009-11-20 18:30 ` Roger Pack
0 siblings, 0 replies; 8+ messages in thread
From: Roger Pack @ 2009-11-20 18:30 UTC (permalink / raw
To: ruby-core
Issue #1227 has been updated by Roger Pack.
could you try this version and see if it fixes the problem?
http://github.com/rdp/ruby-prof
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1227
----------------------------------------
http://redmine.ruby-lang.org
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-11-20 18:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-28 17:00 [ruby-core:22597] [Bug #1227] [BUG] object allocation during garbage collection phase Chris Schlaeger
2009-03-09 7:00 ` [ruby-core:22778] " Charlie Savage
2009-03-09 9:31 ` [ruby-core:22779] " Chris Schlaeger
2009-03-09 9:47 ` [ruby-core:22780] " Nobuyoshi Nakada
2009-03-09 10:24 ` [ruby-core:22781] " daz
2009-03-18 2:14 ` [ruby-core:22925] " Nobuyoshi Nakada
2009-03-18 3:03 ` [ruby-core:22926] " Nobuyoshi Nakada
2009-11-20 18:30 ` [ruby-core:26839] " Roger Pack
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).