Projects

Ticket #387 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

inspect with circular references crashes

Reported by: jazzbox@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc:

Description

$ cat insp.rb 

class Foo
  def initialize bar
    @bar = bar
  end
end
  
class Bar
  def initialize
    @foo = Foo.new(self)
    #@bar = self  # this crashes too
  end
end
  
puts Bar.new.inspect
$ macruby insp.rb 
Segmentation fault
$ ruby insp.rb 
#<Bar:0x1001561d8 @foo=#<Foo:0x100156110 @bar=#<Bar:0x1001561d8 ...>>>

(BTW, this was a very hard one to find for me: Foreign code, multiple nested modules and many, many instance variables. First I thought it has to too witch complexity until I had the idea with the circular reference...)

Change History

Changed 2 years ago by lsansonetti@…

Shorter reduction:

$ ./miniruby -e "class C; def initialize; @foo=self; end; end; p C.new"
Segmentation fault

Changed 2 years ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

Should be fixed in r2814.

Note: See TracTickets for help on using tickets.