From: Noel Rappin Date: 2001-02-03T23:05:23+09:00 Subject: [ruby-talk:10305] Re: Possible bug in RubyUnit? Or just my bug? Thanks for replying... with a little further investigation, I think I've got this figured out. In fact, the system is not hanging -- it was just taking so long to do the inspect that it seemed like it was hanging. What would eventually happen is that inspect would return an out of memory error. What I think is going on is that, although there aren't very many objects in my system, they are intertwined together. I think that tracing through the object relationships caused inspect to blow the stack (the eventual error message says "failed to allocate memory(realloc)" and then says that there are 73 levels in the stack trace). So I'm guessing the thing to do is overwrite inspect on one or more of the classes in question. Does that sound about right? Noel > -----Original Message----- > From: Masaki Suketa [mailto:CQN02273@nifty.ne.jp] > Sent: Friday, February 02, 2001 7:09 PM > To: ruby-talk ML > Subject: [ruby-talk:10293] Re: Possible bug in RubyUnit? Or just my bug? > > > Hello Noel, > > In message "[ruby-talk:10101] Possible bug in RubyUnit? Or just my bug?" > on 01/01/30, "Noel Rappin" writes: > > But my question is whether there is some bug in my class that > would cause > > the hang from to_str? (At the time the class had no to_s > method of its own > > defined). Does this change seem valid? > > The to_str(obj) method calls obj.inspect (Object#inspect) if obj is > not String object. > What occurred if you run this script? > > obj = Your_Class.new > puts obj.inspect > > Regards, > Masaki Suketa >