Bug #2438: Segmentation Fault in YAML
http://redmine.ruby-lang.org/issues/show/2438

Author: Russell Penney
Status: Open, Priority: Normal
Category: lib
ruby -v: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

The attached file causes ruby to crash. The file is hacked (badly) together from a few examples I found.

=========== 25000
separated write       100000    25000     0.422   
separated read        100000    25000     0.344   
array write           100000    25000     0.250   
array read            100000    25000     0.188   
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:110: [BUG] Segmentation fault
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

-- control frame ----------
c:0022 p:---- s:0082 b:0082 l:000081 d:000081 CFUNC  :add
c:0021 p:0014 s:0078 b:0078 l:002100 d:000077 BLOCK  C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:110
c:0020 p:---- s:0075 b:0075 l:000074 d:000074 FINISH
c:0019 p:---- s:0073 b:0073 l:000072 d:000072 CFUNC  :each
c:0018 p:0009 s:0070 b:0070 l:002100 d:000069 BLOCK  C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:109
c:0017 p:---- s:0067 b:0067 l:000066 d:000066 FINISH
c:0016 p:---- s:0065 b:0065 l:000064 d:000064 CFUNC  :seq
c:0015 p:0025 s:0060 b:0060 l:002100 d:000059 BLOCK  C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:108
c:0014 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0013 p:---- s:0055 b:0055 l:000054 d:000054 CFUNC  :call
c:0012 p:---- s:0053 b:0053 l:000052 d:000052 CFUNC  :emit
c:0011 p:0143 s:0049 b:0049 l:000048 d:000048 METHOD C:/Development/Ruby19/lib/ruby/1.9.1/yaml.rb:391
c:0010 p:0024 s:0042 b:0042 l:002100 d:002100 METHOD C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:107
c:0009 p:0037 s:0038 b:0038 l:000037 d:000037 METHOD C:/Development/Ruby19/lib/ruby/1.9.1/yaml.rb:117
c:0008 p:0021 s:0032 b:0032 l:00183c d:000031 BLOCK  examples/marshal_benchmark.rb:77
c:0007 p:---- s:0029 b:0029 l:000028 d:000028 FINISH
c:0006 p:---- s:0027 b:0027 l:000026 d:000026 CFUNC  :open
c:0005 p:0021 s:0022 b:0022 l:00183c d:000021 BLOCK  examples/marshal_benchmark.rb:76
c:0004 p:0024 s:0020 b:0020 l:000019 d:000019 METHOD examples/marshal_benchmark.rb:12
c:0003 p:0379 s:0012 b:0012 l:00183c d:00223c EVAL   examples/marshal_benchmark.rb:75
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00183c d:00183c TOP   
---------------------------
-- Ruby level backtrace information-----------------------------------------
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:110:in `add'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:110:in `block (3 levels) in to_yaml'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:109:in `each'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:109:in `block (2 levels) in to_yaml'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:108:in `seq'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:108:in `block in to_yaml'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml.rb:391:in `call'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml.rb:391:in `emit'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml.rb:391:in `quick_emit'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml/rubytypes.rb:107:in `to_yaml'
C:/Development/Ruby19/lib/ruby/1.9.1/yaml.rb:117:in `dump'
examples/marshal_benchmark.rb:77:in `block (2 levels) in <main>'
examples/marshal_benchmark.rb:76:in `open'
examples/marshal_benchmark.rb:76:in `block in <main>'
examples/marshal_benchmark.rb:12:in `benchmark'
examples/marshal_benchmark.rb:75:in `<main>'


----------------------------------------
http://redmine.ruby-lang.org