From: Robert Klemme Date: 2011-08-01T16:13:28+09:00 Subject: Re: system stack error in ObjectSpace.each_object On Mon, Aug 1, 2011 at 3:56 AM, luke gruber wrote: >> Typically, SystemStackError is due to recursing for too long, perhaps I >> have >> more memory than you, or perhaps the Ruby I'm using (1.9.2-p180) is less >> memory intensive than the one you're using. > > Yeah, I'm running the same Ruby version and I have 4 gb of ram, not sure > why I get this error. Just to be sure, the script in the file > (unmodified) gives me no errors, but when I remove 'unless o.leader' on > line 51, that's when I run into this problem. > > Anyway, thanks for checking. I can reproduce ... /c/Temp/leader.rb:41:in `each' /c/Temp/leader.rb:41:in `block (4 levels) in show_leadership' /c/Temp/leader.rb:41:in `block (3 levels) in show_leadership' /c/Temp/leader.rb:41:in `each' /c/Temp/leader.rb:41:in `block (4 levels) in show_leadership' [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html Aborted (core dumped) 09:05:22 ~$ ruby19 -v ruby 1.9.2p290 (2011-07-09 revision 32553) [i386-cygwin] I assume you created some weird kind of recursion via define_finalizer. I'm not really sure what's going on. Can you explain what your code is supposed to do? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/