Segfault when streaming parser receives integer #102

Open
jackc opened this Issue May 4, 2012 · 0 comments

Comments

Projects
None yet
1 participant

jackc commented May 4, 2012

yajl-segfault.rb

require 'yajl'
parser = Yajl::Parser.new
parser.on_parse_complete = Proc.new { |obj| p obj }
parser << 42
jack@cortana:~/work/experiments/websocket$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
jack@cortana:~/work/experiments/websocket$ ruby yajl-segfault.rb
yajl-segfault.rb:4: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :<<
c:0003 p:0066 s:0007 b:0007 l:0004b8 d:0004b0 EVAL   yajl-segfault.rb:4
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0004b8 d:0004b8 TOP

-- Ruby level backtrace information ----------------------------------------
yajl-segfault.rb:4:in `<main>'
yajl-segfault.rb:4:in `<<'

-- C level backtrace information -------------------------------------------
ruby() [0x5218a7]
ruby() [0x5698bb]
ruby(rb_bug+0xb4) [0x56abd4]
ruby() [0x4b4672]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f3e0977dcb0]
/usr/local/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl/yajl.so(+0x6965) [0x7f3e0819b965] yajl_ext.c:507
ruby() [0x51de79]
ruby() [0x512d7f]
ruby() [0x5182c3]
ruby(rb_iseq_eval_main+0xc0) [0x51f440]
ruby() [0x415f7a]
ruby(ruby_run_node+0x36) [0x418466]
ruby() [0x4158b9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f3e08a9376d]
ruby() [0x4158e9]

-- Other runtime information -----------------------------------------------

* Loaded script: yajl-segfault.rb

* Loaded features:

    0 enumerator.so
    1 /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so
    2 /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so
    3 /usr/local/lib/ruby/1.9.1/rubygems/defaults.rb
    4 /usr/local/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb
    5 /usr/local/lib/ruby/1.9.1/rubygems/deprecate.rb
    6 /usr/local/lib/ruby/1.9.1/rubygems/exceptions.rb
    7 /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb
    8 /usr/local/lib/ruby/1.9.1/rubygems.rb
    9 /usr/local/lib/ruby/1.9.1/rubygems/version.rb
   10 /usr/local/lib/ruby/1.9.1/rubygems/requirement.rb
   11 /usr/local/lib/ruby/1.9.1/rubygems/platform.rb
   12 /usr/local/lib/ruby/1.9.1/rubygems/specification.rb
   13 /usr/local/lib/ruby/1.9.1/rubygems/path_support.rb
   14 /usr/local/lib/ruby/1.9.1/rubygems/dependency.rb
   15 /usr/local/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl/yajl.so
   16 /usr/local/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl.rb

* Process memory map:

00400000-0061c000 r-xp 00000000 fc:00 2359963                            /usr/local/bin/ruby
0081b000-0081c000 r--p 0021b000 fc:00 2359963                            /usr/local/bin/ruby
0081c000-0081e000 rw-p 0021c000 fc:00 2359963                            /usr/local/bin/ruby
0081e000-0083b000 rw-p 00000000 00:00 0
01caf000-0211d000 rw-p 00000000 00:00 0                                  [heap]
7f3e07f7f000-7f3e07f94000 r-xp 00000000 fc:00 1569836                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f3e07f94000-7f3e08193000 ---p 00015000 fc:00 1569836                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f3e08193000-7f3e08194000 r--p 00014000 fc:00 1569836                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f3e08194000-7f3e08195000 rw-p 00015000 fc:00 1569836                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f3e08195000-7f3e081a0000 r-xp 00000000 fc:00 140357                     /usr/local/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl/yajl.so
7f3e081a0000-7f3e083a0000 ---p 0000b000 fc:00 140357                     /usr/local/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl/yajl.so
7f3e083a0000-7f3e083a1000 r--p 0000b000 fc:00 140357                     /usr/local/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl/yajl.so
7f3e083a1000-7f3e083a2000 rw-p 0000c000 fc:00 140357                     /usr/local/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl/yajl.so
7f3e083a2000-7f3e083a4000 r-xp 00000000 fc:00 2360029                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so
7f3e083a4000-7f3e085a4000 ---p 00002000 fc:00 2360029                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so
7f3e085a4000-7f3e085a5000 r--p 00002000 fc:00 2360029                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so
7f3e085a5000-7f3e085a6000 rw-p 00003000 fc:00 2360029                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so
7f3e085a6000-7f3e085a8000 r-xp 00000000 fc:00 2360044                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so
7f3e085a8000-7f3e087a7000 ---p 00002000 fc:00 2360044                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so
7f3e087a7000-7f3e087a8000 r--p 00001000 fc:00 2360044                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so
7f3e087a8000-7f3e087a9000 rw-p 00002000 fc:00 2360044                    /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so
7f3e087a9000-7f3e08a72000 r--p 00000000 fc:00 2229634                    /usr/lib/locale/locale-archive
7f3e08a72000-7f3e08c25000 r-xp 00000000 fc:00 1569810                    /lib/x86_64-linux-gnu/libc-2.15.so
7f3e08c25000-7f3e08e24000 ---p 001b3000 fc:00 1569810                    /lib/x86_64-linux-gnu/libc-2.15.so
7f3e08e24000-7f3e08e28000 r--p 001b2000 fc:00 1569810                    /lib/x86_64-linux-gnu/libc-2.15.so
7f3e08e28000-7f3e08e2a000 rw-p 001b6000 fc:00 1569810                    /lib/x86_64-linux-gnu/libc-2.15.so
7f3e08e2a000-7f3e08e2f000 rw-p 00000000 00:00 0
7f3e08e2f000-7f3e08f28000 r-xp 00000000 fc:00 1569809                    /lib/x86_64-linux-gnu/libm-2.15.so
7f3e08f28000-7f3e09127000 ---p 000f9000 fc:00 1569809                    /lib/x86_64-linux-gnu/libm-2.15.so
7f3e09127000-7f3e09128000 r--p 000f8000 fc:00 1569809                    /lib/x86_64-linux-gnu/libm-2.15.so
7f3e09128000-7f3e09129000 rw-p 000f9000 fc:00 1569809                    /lib/x86_64-linux-gnu/libm-2.15.so
7f3e09129000-7f3e09132000 r-xp 00000000 fc:00 1569825                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f3e09132000-7f3e09332000 ---p 00009000 fc:00 1569825                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f3e09332000-7f3e09333000 r--p 00009000 fc:00 1569825                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f3e09333000-7f3e09334000 rw-p 0000a000 fc:00 1569825                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f3e09334000-7f3e09362000 rw-p 00000000 00:00 0
7f3e09362000-7f3e09364000 r-xp 00000000 fc:00 1569830                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f3e09364000-7f3e09564000 ---p 00002000 fc:00 1569830                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f3e09564000-7f3e09565000 r--p 00002000 fc:00 1569830                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f3e09565000-7f3e09566000 rw-p 00003000 fc:00 1569830                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f3e09566000-7f3e0956d000 r-xp 00000000 fc:00 1569820                    /lib/x86_64-linux-gnu/librt-2.15.so
7f3e0956d000-7f3e0976c000 ---p 00007000 fc:00 1569820                    /lib/x86_64-linux-gnu/librt-2.15.so
7f3e0976c000-7f3e0976d000 r--p 00006000 fc:00 1569820                    /lib/x86_64-linux-gnu/librt-2.15.so
7f3e0976d000-7f3e0976e000 rw-p 00007000 fc:00 1569820                    /lib/x86_64-linux-gnu/librt-2.15.so
7f3e0976e000-7f3e09786000 r-xp 00000000 fc:00 1569834                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f3e09786000-7f3e09985000 ---p 00018000 fc:00 1569834                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f3e09985000-7f3e09986000 r--p 00017000 fc:00 1569834                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f3e09986000-7f3e09987000 rw-p 00018000 fc:00 1569834                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f3e09987000-7f3e0998b000 rw-p 00000000 00:00 0
7f3e0998b000-7f3e099ad000 r-xp 00000000 fc:00 1569814                    /lib/x86_64-linux-gnu/ld-2.15.so
7f3e09a9d000-7f3e09ba3000 rw-p 00000000 00:00 0
7f3e09ba6000-7f3e09ba7000 rw-p 00000000 00:00 0
7f3e09ba7000-7f3e09ba8000 ---p 00000000 00:00 0
7f3e09ba8000-7f3e09bad000 rw-p 00000000 00:00 0
7f3e09bad000-7f3e09bae000 r--p 00022000 fc:00 1569814                    /lib/x86_64-linux-gnu/ld-2.15.so
7f3e09bae000-7f3e09bb0000 rw-p 00023000 fc:00 1569814                    /lib/x86_64-linux-gnu/ld-2.15.so
7fffea4a6000-7fffea4c7000 rw-p 00000000 00:00 0                          [stack]
7fffea5ef000-7fffea5f0000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]


[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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment