[MacRuby-devel] [MacRuby] #511: GCD crash with indirect method access
MacRuby
ruby-noreply at macosforge.org
Thu Dec 17 13:39:56 PST 2009
#511: GCD crash with indirect method access
---------------------------------------+------------------------------------
Reporter: joshua.ballanco@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords: GCD
---------------------------------------+------------------------------------
Old description:
> The following code will crash when I run it on my Mac Pro (8x2.26 GHz):
>
> {{{
> #!/usr/local/bin/macruby
>
> class Foo
> def doit
> end
> end
>
> class Bar
> def initialize
> @foo = Foo.new
> end
>
> def step
> @foo.doit
> end
> end
>
> @bars = []
> 1000.times { @bars << Bar.new }
>
> steps = Dispatch::Group.new
> @bars.each do |bar|
> Dispatch::Queue.concurrent.async(steps) { bar.step }
> end
> steps.wait
> }}}
>
> Commenting out the "@foo.doit" line prevents the crash.
New description:
The following code will crash when I run it on my Mac Pro (8x2.26 GHz):
{{{
#!/usr/local/bin/macruby
class Foo
def doit
end
end
class Bar
def initialize
@foo = Foo.new
end
def step
100.times{ @foo.doit }
end
end
@bars = []
1000.times { @bars << Bar.new }
steps = Dispatch::Group.new
@bars.each do |bar|
Dispatch::Queue.concurrent.async(steps) { bar.step }
end
steps.wait
}}}
Commenting out the "@foo.doit" line prevents the crash.
--
Comment(by joshua.ballanco@…):
Adding repetitions inside of "step" makes it crash more regularly.
--
Ticket URL: <http://www.macruby.org/trac/ticket/511#comment:4>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list