Project

General

Profile

Bug #13485 ยป TestEnumerable#call_cc_SEGV.txt

Code & SEGV output - MSP-Greg (Greg L), 04/19/2017 04:14 PM

 
require_relative '<path to ruby>/lib/ruby/2.5.0/x64-mingw32/continuation.so'

1000.times {
c = nil
o = Object.new
class << o; self; end.class_eval do
define_method(:<=>) do |x|
callcc {|c2| c ||= c2 }
0
end
end
ary = [o,o]
begin
ary.sort_by {|x| x }
c.to_s ; c.call
rescue
end
}

------------------------------------------------------------------------------------------

E:\r_test>ruby --disable-gems test1.rb
E:/GitHub/ruby-tsb/pkg/ruby25_64/ruby25_64/lib/ruby/2.5.0/x64-mingw32/continuation.so: warning: callcc is obsolete; use Fiber instead
test1.rb:14: [BUG] Segmentation fault
ruby 2.5.0dev (2017-04-18 trunk 58397) [x64-mingw32]

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0020 e:000019 CFUNC :sort_by
c:0004 p:0055 s:0016 E:001678 BLOCK test1.rb:14 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC :times
c:0002 p:0017 s:0006 E:002060 EVAL test1.rb:3 [FINISH]
c:0001 p:0000 s:0003 E:0013d0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
test1.rb:3:in `<main>'
test1.rb:3:in `times'
test1.rb:14:in `block in <main>'
test1.rb:14:in `sort_by'

-- C level backtrace information -------------------------------------------
C:\Windows\SYSTEM32\ntdll.dll(ZwWaitForSingleObject+0xa) [0x0000000076d3bd7a]
C:\Windows\system32\KERNELBASE.dll(WaitForSingleObjectEx+0x9c) [0x000007fefcba10ac]
bin\x64-msvcrt-ruby250.dll(rb_print_backtrace+0x36) [0x00000000680426e6]
bin\x64-msvcrt-ruby250.dll(rb_vm_bugreport+0x67) [0x0000000068042757]
bin\x64-msvcrt-ruby250.dll(rb_bug_context+0x69) [0x0000000067f1ed19]
bin\x64-msvcrt-ruby250.dll(rb_check_safe_obj+0x6cc) [0x0000000067fd7fdc]
[0x0000000000402388]
C:\Windows\SYSTEM32\ntdll.dll(_C_specific_handler+0x9c) [0x0000000076d07958]
C:\Windows\SYSTEM32\ntdll.dll(RtlDecodePointer+0xad) [0x0000000076d1812d]
C:\Windows\SYSTEM32\ntdll.dll(RtlUnwindEx+0xbbf) [0x0000000076d0855f]
C:\Windows\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x2e) [0x0000000076d3bcb8]
C:\Windows\SYSTEM32\ntdll.dll(RtlSizeHeap+0x89) [0x0000000076d16789]
C:\Windows\system32\msvcrt.dll(msize+0x1f) [0x000007fefcda8e83]
bin\x64-msvcrt-ruby250.dll(rb_gc_unprotect_logging+0x253) [0x0000000067f37703]
bin\x64-msvcrt-ruby250.dll(rb_ary_cmp+0xc3d) [0x0000000067ec342d]
bin\x64-msvcrt-ruby250.dll(rb_enc_foreach_name+0x56a0) [0x0000000067f16e10]
bin\x64-msvcrt-ruby250.dll(rb_error_arity+0x116) [0x0000000068028696]
bin\x64-msvcrt-ruby250.dll(rb_vm_localjump_error+0x1144) [0x000000006802e454]
bin\x64-msvcrt-ruby250.dll(rb_vm_localjump_error+0x68a4) [0x0000000068033bb4]
bin\x64-msvcrt-ruby250.dll(rb_yield_1+0x338) [0x000000006803d1b8]
bin\x64-msvcrt-ruby250.dll(rb_int_abs+0x3c1) [0x0000000067f69f41]
bin\x64-msvcrt-ruby250.dll(rb_error_arity+0x116) [0x0000000068028696]
bin\x64-msvcrt-ruby250.dll(rb_vm_invoke_proc+0x950) [0x0000000068036010]
bin\x64-msvcrt-ruby250.dll(rb_vm_localjump_error+0x1144) [0x000000006802e454]
bin\x64-msvcrt-ruby250.dll(rb_vm_localjump_error+0x68a4) [0x0000000068033bb4]
bin\x64-msvcrt-ruby250.dll(rb_call_end_proc+0x17e) [0x0000000067f21cfe]
bin\x64-msvcrt-ruby250.dll(ruby_run_node+0x3f) [0x0000000067f2472f]
[0x0000000000402dc7]
[0x00000000004013f8]
[0x000000000040151b]
C:\Windows\system32\kernel32.dll(BaseThreadInitThunk+0xd) [0x0000000076ae59cd]

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

* Loaded script: test1.rb

* Loaded features:

0 enumerator.so
1 thread.rb
2 rational.so
3 complex.so
4 lib/ruby/2.5.0/x64-mingw32/enc/encdb.so
5 lib/ruby/2.5.0/x64-mingw32/enc/trans/transdb.so
6 lib/ruby/2.5.0/x64-mingw32/enc/windows_1252.so
7 lib/ruby/2.5.0/unicode_normalize.rb
8 lib/ruby/2.5.0/x64-mingw32/continuation.so

[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


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

E:\r_test>
    (1-1/1)