Issue #11093 has been reported by Daniel Serodio. ---------------------------------------- Bug #11093: Segmentation fault with Ruby 2.1.6 and ffi 1.9.8 https://bugs.ruby-lang.org/issues/11093 * Author: Daniel Serodio * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux-gnu] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- This is my first Ruby bug report, please forgive me it this is not the proper place for this. $ ruby -rffi -e 'puts Hi' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:67: [BUG] Segmentation fault at 0x00000000000008 ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux-gnu] -- Control frame information ----------------------------------------------- c:0016 p:---- s:0077 e:000076 CFUNC :initialize c:0015 p:---- s:0075 e:000074 CFUNC :new c:0014 p:0128 s:0071 e:000067 METHOD /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:67 c:0013 p:0019 s:0063 e:000059 METHOD /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:41 c:0012 p:0395 s:0055 e:000054 CLASS /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:167 c:0011 p:0009 s:0053 e:000052 TOP /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:34 [FINISH] c:0010 p:---- s:0051 e:000050 CFUNC :require c:0009 p:0115 s:0047 e:000046 METHOD /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55 c:0008 p:0015 s:0037 e:000036 TOP /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/ffi.rb:32 [FINISH] c:0007 p:---- s:0035 e:000034 CFUNC :require c:0006 p:0115 s:0031 e:000030 METHOD /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55 c:0005 p:0197 s:0021 e:000020 TOP /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi.rb:21 [FINISH] c:0004 p:---- s:0019 e:000018 CFUNC :require c:0003 p:0073 s:0015 e:000014 RESCUE /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135 c:0002 p:0444 s:0012 e:000011 METHOD /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144 [FINISH] c:0001 p:0000 s:0002 E:000758 TOP [FINISH] -- Ruby level backtrace information ---------------------------------------- /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require' /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require' /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi.rb:21:in `<top (required)>' /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/ffi.rb:32:in `<top (required)>' /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:34:in `<top (required)>' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:167:in `<module:FFI>' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:41:in `typedef' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:67:in `find_type' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:67:in `new' /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/types.rb:67:in `initialize' -- C level backtrace information ------------------------------------------- /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x180f6f) [0x7fcd739fff6f] addr2line.c:412 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x1816c0) [0x7fcd73a006c0] prelude.c:52 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x6540c) [0x7fcd738e440c] load.c:70 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_bug+0xb8) [0x7fcd738e4718] load.c:120 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x113df5) [0x7fcd73992df5] string.c:2842 /lib64/libpthread.so.0(+0xf710) [0x7fcd73671710] AbstractMemory.c:248 /opt/ruby-2.1.6/lib64/libruby.so.2.1(st_lookup+0x1f) [0x7fcd7399b0df] string.c:135 /opt/ruby-2.0.0-247/lib/libruby.so.2.0(+0x158f9f) [0x7fcd6bbdaf9f] vm_method.c:182 /opt/ruby-2.0.0-247/lib/libruby.so.2.0(rb_funcall2+0x12d) [0x7fcd6bbdd71d] vm_eval.c:523 /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi_c.so(+0xab24) [0x7fcd6c0e1b24] MappedType.c:86 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x16e135) [0x7fcd739ed135] vm_eval.c:44 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_funcallv+0x1b5) [0x7fcd739ee265] ./include/ruby/ruby.h:1507 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_class_new_instance+0x30) [0x7fcd73937e30] parse.y:5293 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x16baea) [0x7fcd739eaaea] vm_insnhelper.c:1628 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x180016) [0x7fcd739ff016] addr2line.c:839 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x171cd9) [0x7fcd739f0cd9] vm_backtrace.c:135 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x1759dd) [0x7fcd739f49dd] thread.c:2071 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_iseq_eval+0x129) [0x7fcd739f56b9] thread_pthread.c:1009 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x6b1e5) [0x7fcd738ea1e5] file.c:5702 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_require_safe+0x86c) [0x7fcd738ec1fc] file.c:2752 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x16baea) [0x7fcd739eaaea] vm_insnhelper.c:1628 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x171cd9) [0x7fcd739f0cd9] vm_backtrace.c:135 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x1759dd) [0x7fcd739f49dd] thread.c:2071 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_iseq_eval+0x129) [0x7fcd739f56b9] thread_pthread.c:1009 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x6b1e5) [0x7fcd738ea1e5] file.c:5702 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_require_safe+0x86c) [0x7fcd738ec1fc] file.c:2752 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x16baea) [0x7fcd739eaaea] vm_insnhelper.c:1628 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x171cd9) [0x7fcd739f0cd9] vm_backtrace.c:135 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x1759dd) [0x7fcd739f49dd] thread.c:2071 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_iseq_eval+0x129) [0x7fcd739f56b9] thread_pthread.c:1009 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x6b1e5) [0x7fcd738ea1e5] file.c:5702 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_require_safe+0x86c) [0x7fcd738ec1fc] file.c:2752 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x16baea) [0x7fcd739eaaea] vm_insnhelper.c:1628 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x180016) [0x7fcd739ff016] addr2line.c:839 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x171cd9) [0x7fcd739f0cd9] vm_backtrace.c:135 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x1759dd) [0x7fcd739f49dd] thread.c:2071 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x16def9) [0x7fcd739ecef9] vm_eval.c:560 /opt/ruby-2.1.6/lib64/libruby.so.2.1(rb_funcallv+0x1b5) [0x7fcd739ee265] ./include/ruby/ruby.h:1507 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x11075b) [0x7fcd7398f75b] strftime.c:498 /opt/ruby-2.1.6/lib64/libruby.so.2.1(+0x112d0d) [0x7fcd73991d0d] ./include/ruby/ruby.h:1512 /opt/ruby-2.1.6/lib64/libruby.so.2.1(ruby_process_options+0x6d) [0x7fcd7399279d] string.c:6614 /opt/ruby-2.1.6/lib64/libruby.so.2.1(ruby_options+0xda) [0x7fcd738e8d4a] proc.c:581 ruby() [0x4008c3] /lib64/libc.so.6(__libc_start_main+0xfd) [0x7fcd72a25d1d] ruby() [0x4007b9] -- Other runtime information ----------------------------------------------- * Loaded script: -e * Loaded features: 0 enumerator.so 1 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/encdb.so 2 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/trans/transdb.so 3 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/rbconfig.rb 4 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/compatibility.rb 5 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/defaults.rb 6 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/deprecate.rb 7 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/errors.rb 8 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/version.rb 9 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/requirement.rb 10 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/platform.rb 11 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/basic_specification.rb 12 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/stub_specification.rb 13 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/util/stringio.rb 14 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/specification.rb 15 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/exceptions.rb 16 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb 17 thread.rb 18 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/thread.so 19 /opt/ruby-2.1.6/lib64/ruby/2.1.0/monitor.rb 20 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/core_ext/kernel_require.rb 21 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems.rb 22 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/path_support.rb 23 /opt/ruby-2.1.6/lib64/ruby/2.1.0/rubygems/dependency.rb 24 25 /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi/platform.rb * Process memory map: 00400000-00401000 r-xp 00000000 fd:00 1184785 /opt/ruby-2.1.6/bin/ruby 00600000-00601000 rw-p 00000000 fd:00 1184785 /opt/ruby-2.1.6/bin/ruby 00601000-00b71000 rw-p 00000000 00:00 0 [heap] 7fcd6b86c000-7fcd6b882000 r-xp 00000000 fd:00 390915 /lib64/libgcc_s-4.4.7-20120601.so.1 7fcd6b882000-7fcd6ba81000 ---p 00016000 fd:00 390915 /lib64/libgcc_s-4.4.7-20120601.so.1 7fcd6ba81000-7fcd6ba82000 rw-p 00015000 fd:00 390915 /lib64/libgcc_s-4.4.7-20120601.so.1 7fcd6ba82000-7fcd6bca7000 r-xp 00000000 fd:00 400906 /opt/ruby-2.0.0-247/lib/libruby.so.2.0.0 7fcd6bca7000-7fcd6bea7000 ---p 00225000 fd:00 400906 /opt/ruby-2.0.0-247/lib/libruby.so.2.0.0 7fcd6bea7000-7fcd6beaf000 rw-p 00225000 fd:00 400906 /opt/ruby-2.0.0-247/lib/libruby.so.2.0.0 7fcd6beaf000-7fcd6becf000 rw-p 00000000 00:00 0 7fcd6becf000-7fcd6bed6000 r-xp 00000000 fd:00 785399 /usr/lib64/libffi.so.5.0.6 7fcd6bed6000-7fcd6c0d6000 ---p 00007000 fd:00 785399 /usr/lib64/libffi.so.5.0.6 7fcd6c0d6000-7fcd6c0d7000 rw-p 00007000 fd:00 785399 /usr/lib64/libffi.so.5.0.6 7fcd6c0d7000-7fcd6c0f6000 r-xp 00000000 fd:00 1440118 /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi_c.so 7fcd6c0f6000-7fcd6c2f5000 ---p 0001f000 fd:00 1440118 /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi_c.so 7fcd6c2f5000-7fcd6c2f7000 rw-p 0001e000 fd:00 1440118 /opt/ruby-2.1.6/lib64/ruby/gems/2.1.0/gems/ffi-1.9.8/lib/ffi_c.so 7fcd6c2f7000-7fcd6c2fa000 r-xp 00000000 fd:00 1442965 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/thread.so 7fcd6c2fa000-7fcd6c4f9000 ---p 00003000 fd:00 1442965 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/thread.so 7fcd6c4f9000-7fcd6c4fa000 rw-p 00002000 fd:00 1442965 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/thread.so 7fcd6c4fa000-7fcd6c4fc000 r-xp 00000000 fd:00 1442922 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/trans/transdb.so 7fcd6c4fc000-7fcd6c6fc000 ---p 00002000 fd:00 1442922 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/trans/transdb.so 7fcd6c6fc000-7fcd6c6fd000 rw-p 00002000 fd:00 1442922 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/trans/transdb.so 7fcd6c6fd000-7fcd6c6ff000 r-xp 00000000 fd:00 1442880 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/encdb.so 7fcd6c6ff000-7fcd6c8fe000 ---p 00002000 fd:00 1442880 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/encdb.so 7fcd6c8fe000-7fcd6c8ff000 rw-p 00001000 fd:00 1442880 /opt/ruby-2.1.6/lib64/ruby/2.1.0/x86_64-linux-gnu/enc/encdb.so 7fcd6c8ff000-7fcd72790000 r--p 00000000 fd:00 783853 /usr/lib/locale/locale-archive 7fcd72790000-7fcd72801000 r-xp 00000000 fd:00 390921 /lib64/libfreebl3.so 7fcd72801000-7fcd72a00000 ---p 00071000 fd:00 390921 /lib64/libfreebl3.so 7fcd72a00000-7fcd72a02000 r--p 00070000 fd:00 390921 /lib64/libfreebl3.so 7fcd72a02000-7fcd72a03000 rw-p 00072000 fd:00 390921 /lib64/libfreebl3.so 7fcd72a03000-7fcd72a07000 rw-p 00000000 00:00 0 7fcd72a07000-7fcd72b92000 r-xp 00000000 fd:00 390929 /lib64/libc-2.12.so 7fcd72b92000-7fcd72d91000 ---p 0018b000 fd:00 390929 /lib64/libc-2.12.so 7fcd72d91000-7fcd72d95000 r--p 0018a000 fd:00 390929 /lib64/libc-2.12.so 7fcd72d95000-7fcd72d96000 rw-p 0018e000 fd:00 390929 /lib64/libc-2.12.so 7fcd72d96000-7fcd72d9b000 rw-p 00000000 00:00 0 7fcd72d9b000-7fcd72e1e000 r-xp 00000000 fd:00 390937 /lib64/libm-2.12.so 7fcd72e1e000-7fcd7301d000 ---p 00083000 fd:00 390937 /lib64/libm-2.12.so 7fcd7301d000-7fcd7301e000 r--p 00082000 fd:00 390937 /lib64/libm-2.12.so 7fcd7301e000-7fcd7301f000 rw-p 00083000 fd:00 390937 /lib64/libm-2.12.so 7fcd7301f000-7fcd73026000 r-xp 00000000 fd:00 390933 /lib64/libcrypt-2.12.so 7fcd73026000-7fcd73226000 ---p 00007000 fd:00 390933 /lib64/libcrypt-2.12.so 7fcd73226000-7fcd73227000 r--p 00007000 fd:00 390933 /lib64/libcrypt-2.12.so 7fcd73227000-7fcd73228000 rw-p 00008000 fd:00 390933 /lib64/libcrypt-2.12.so 7fcd73228000-7fcd73256000 rw-p 00000000 00:00 0 7fcd73256000-7fcd73258000 r-xp 00000000 fd:00 390935 /lib64/libdl-2.12.so 7fcd73258000-7fcd73458000 ---p 00002000 fd:00 390935 /lib64/libdl-2.12.so 7fcd73458000-7fcd73459000 r--p 00002000 fd:00 390935 /lib64/libdl-2.12.so 7fcd73459000-7fcd7345a000 rw-p 00003000 fd:00 390935 /lib64/libdl-2.12.so 7fcd7345a000-7fcd73461000 r-xp 00000000 fd:00 390957 /lib64/librt-2.12.so 7fcd73461000-7fcd73660000 ---p 00007000 fd:00 390957 /lib64/librt-2.12.so 7fcd73660000-7fcd73661000 r--p 00006000 fd:00 390957 /lib64/librt-2.12.so 7fcd73661000-7fcd73662000 rw-p 00007000 fd:00 390957 /lib64/librt-2.12.so 7fcd73662000-7fcd73679000 r-xp 00000000 fd:00 390953 /lib64/libpthread-2.12.so 7fcd73679000-7fcd73879000 ---p 00017000 fd:00 390953 /lib64/libpthread-2.12.so 7fcd73879000-7fcd7387a000 r--p 00017000 fd:00 390953 /lib64/libpthread-2.12.so 7fcd7387a000-7fcd7387b000 rw-p 00018000 fd:00 390953 /lib64/libpthread-2.12.so 7fcd7387b000-7fcd7387f000 rw-p 00000000 00:00 0 7fcd7387f000-7fcd73abc000 r-xp 00000000 fd:00 1184825 /opt/ruby-2.1.6/lib64/libruby.so.2.1.0 7fcd73abc000-7fcd73cbc000 ---p 0023d000 fd:00 1184825 /opt/ruby-2.1.6/lib64/libruby.so.2.1.0 7fcd73cbc000-7fcd73cc4000 rw-p 0023d000 fd:00 1184825 /opt/ruby-2.1.6/lib64/libruby.so.2.1.0 7fcd73cc4000-7fcd73ce9000 rw-p 00000000 00:00 0 7fcd73ce9000-7fcd73d09000 r-xp 00000000 fd:00 390922 /lib64/ld-2.12.so 7fcd73df0000-7fcd73df7000 r--s 00000000 fd:00 913433 /usr/lib64/gconv/gconv-modules.cache 7fcd73df7000-7fcd73efd000 rw-p 00000000 00:00 0 7fcd73f02000-7fcd73f03000 rw-p 00000000 00:00 0 7fcd73f03000-7fcd73f04000 ---p 00000000 00:00 0 7fcd73f04000-7fcd73f08000 rw-p 00000000 00:00 0 7fcd73f08000-7fcd73f09000 r--p 0001f000 fd:00 390922 /lib64/ld-2.12.so 7fcd73f09000-7fcd73f0a000 rw-p 00020000 fd:00 390922 /lib64/ld-2.12.so 7fcd73f0a000-7fcd73f0b000 rw-p 00000000 00:00 0 7fffd09ac000-7fffd13ac000 rw-p 00000000 00:00 0 [stack] 7fffd13ff000-7fffd1400000 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 -- https://bugs.ruby-lang.org/