Skip to content

Instantly share code, notes, and snippets.

@DNNX DNNX/out.txt
Last active Dec 21, 2015

Embed
What would you like to do?
ruby crash
➜ ~ ruby -e "def f(*xs); end; f(*(1..130_000))"
-e:1: [BUG] Bus Error
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.2.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
the more detail of.
-- Control frame information -----------------------------------------------
c:0002 p:0022 s:130005 E:0002b8 EVAL -e:1 [FINISH]
c:0001 p:0000 s:0002 E:001c18 TOP [FINISH]
-e:1:in `<main>'
-- C level backtrace information -------------------------------------------
-- Other runtime information -----------------------------------------------
* Loaded script: -e
* Loaded features:
0 enumerator.so
1 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.2.0/enc/encdb.bundle
2 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.2.0/enc/trans/transdb.bundle
3 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.2.0/rbconfig.rb
4 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb
5 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb
6 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb
7 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb
8 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/version.rb
9 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb
10 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/platform.rb
11 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb
12 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/exceptions.rb
13 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
14 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/thread.rb
15 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb
16 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb
17 /Users/viktar/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb
[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
[1] 676 abort ruby -e "def f(*xs); end; f(*(1..130_000))"
➜ ~ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.2.0]
➜ ~ ruby -e 'a=(1..5); puts "def f(#{a.map{|x| "x"+x.to_s}.join(",")})\n #{a.map{|x| "x"+x.to_s}.join("+")}\nend\n\nputs f(#{Array.new(a.size, 1).join(",")})"'
def f(x1,x2,x3,x4,x5)
x1+x2+x3+x4+x5
end
puts f(1,1,1,1,1)
➜ ~ ruby -e 'a=(1..6892); puts "def f(#{a.map{|x| "x"+x.to_s}.join(",")})\n #{a.map{|x| "x"+x.to_s}.join("+")}\nend\n\nputs f(#{Array.new(a.size, 1).join(",")})"' | ruby
6892
➜ ~ ruby -e 'a=(1..6893); puts "def f(#{a.map{|x| "x"+x.to_s}.join(",")})\n #{a.map{|x| "x"+x.to_s}.join("+")}\nend\n\nputs f(#{Array.new(a.size, 1).join(",")})"' | ruby
-:0: stack level too deep (SystemStackError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.