From: Wilson Bilkovich Date: 2006-12-02T01:06:18+09:00 Subject: Re: Segmentation fault, proc, eval, long string [Reproduced] On 12/1/06, Pit Capitain wrote: > Wilson Bilkovich schrieb: > > On 12/1/06, Pit Capitain wrote: > >> Bob, you can use parsetree to dump the AST of the generated proc. I'm > >> sure you'll see the deep nesting of the nodes. > > > > I just tried this, and here's what it gave me (for a smaller N, so the > > whole process doesn't crash. Should show the same structure no matter > > what N is, though) > > > > (...) > > Wilson, this is not the dump of the generated proc. You have to pass the > contents of @@proc to ParseTree. > Haha. Oops. You're right: wilson@metaclass:~$ ruby boom.rb the_string length: 186747 [[:module, :SomeModule, [:scope, [:cvdecl, :@@pr, [:iter, [:call, [:const, :Proc], :new], nil, [:block, [:dasgn_curr, :thing, [:dasgn_curr, :v0, [:dasgn_curr, :v1, [:dasgn_curr, :v2, [:dasgn_curr, :v3, [:dasgn_curr, :v4, [:dasgn_curr, :v5, /usr/lib/ruby/1.8/prettyprint.rb:344:in `deq': stack level too deep (SystemStackError) from /usr/lib/ruby/1.8/prettyprint.rb:343:in `deq' from /usr/lib/ruby/1.8/prettyprint.rb:171:in `break_outmost_groups' from /usr/lib/ruby/1.8/prettyprint.rb:197:in `text' from /usr/lib/ruby/1.8/pp.rb:245:in `pretty_print' from /usr/lib/ruby/1.8/pp.rb:126:in `pp' from /usr/lib/ruby/1.8/prettyprint.rb:224:in `group' from /usr/lib/ruby/1.8/prettyprint.rb:247:in `nest' from /usr/lib/ruby/1.8/prettyprint.rb:223:in `group' ... 294 levels... from /usr/lib/ruby/1.8/pp.rb:69:in `pp' from /usr/lib/ruby/1.8/pp.rb:52:in `pp' from /usr/lib/ruby/1.8/pp.rb:51:in `pp' from boom.rb:45