Skip to content

Instantly share code, notes, and snippets.

@gabrielg
Created December 7, 2011 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielg/d259449ff7bedef92c2e to your computer and use it in GitHub Desktop.
Save gabrielg/d259449ff7bedef92c2e to your computer and use it in GitHub Desktop.
gabriel@last:~$ ruby /tmp/test.rb
blam!: stack level too deep
and the lord wept
gabriel@last:~$ cat /tmp/test.rb
#!/usr/bin/env ruby
var_list = (0...140000).map{ |i| "var_#{i}" }.join(", ")
var_list_2 = (0...130000).map{ |i| "var_#{i}" }.join(", ")
eval <<-EOCRAZINESS
def blam(#{var_list})
puts "and the lord wept"
end
def blam2(#{var_list_2})
puts "and the lord wept"
end
EOCRAZINESS
begin
blam(*(0...140000))
rescue SystemStackError => e
puts "blam!: #{e}"
end
blam2(*(0...130000))
gabriel@last:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment