allocation_tracer
allocation_tracer copied to clipboard
SEGV
The following code causes SEGV.
require 'allocation_tracer'
require 'pp'
ObjectSpace::AllocationTracer.setup(%i{path line class})
result = ObjectSpace::AllocationTracer.trace do
50_000.times{|i|
c = Class.new
c.new
}
end
pp result
test.rb:6: [BUG] Segmentation fault at 0x00000000000030
ruby 2.3.0dev (2015-03-19 trunk 50022) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0004 p:---- s:0010 e:000009 CFUNC :hash
c:0003 p:---- s:0008 e:000007 CFUNC :trace
c:0002 p:0045 s:0005 E:001d28 EVAL test.rb:6 [FINISH]
c:0001 p:0000 s:0002 E:000e90 TOP [FINISH]
-- Ruby level backtrace information ----------------------------------------
test.rb:6:in `<main>'
test.rb:6:in `trace'
test.rb:6:in `hash'
-- Machine register context ------------------------------------------------
RIP: 0x00007f85577a1f24 RBP: 0x0000000000000000 RSP: 0x00007fff05055078
RAX: 0x0000000002392788 RBX: 0x0000000002336498 RCX: 0x0000000000000000
RDX: 0x00007fff050550a0 RDI: 0x0000000002336470 RSI: 0x0000000000000e11
R8: 0x0000000000000001 R9: 0x0000000002339da0 R10: 0x00007f8557bb50b8
R11: 0x0000000000000000 R12: 0x2c392a4b6cc90d0d R13: 0x0000000000000e11
R14: 0x0000000002415970 R15: 0x0000000002339da0 EFL: 0x0000000000010246
-- C level backtrace information -------------------------------------------
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_vm_bugreport+0x51f) [0x7f85577b9acf] ../../trunk/vm_dump.c:693
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_bug_context+0xcb) [0x7f855764a2bb] ../../trunk/error.c:425
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(sigsegv+0x3e) [0x7f855772e73e] ../../trunk/signal.c:887
/lib/x86_64-linux-gnu/libc.so.6 [0x7f855723dd40]
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_method_entry+0x34) [0x7f85577a1f24] ../../trunk/vm_method.c:674
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_call0+0x104) [0x7f85577b0c34] ../../trunk/vm_eval.c:550
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_catch_protect+0xaf) [0x7f85577a352f] ../../trunk/vm_eval.c:1997
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(exec_recursive+0x5b2) [0x7f85577c47e2] ../../trunk/thread.c:4857
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_hash+0x15) [0x7f85576777e5] ../../trunk/hash.c:112
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_ary_hash+0x59) [0x7f85575fc919] ../../trunk/array.c:3877
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(vm_call0_body.constprop.90+0x28f) [0x7f85577b00df] ../../trunk/vm_eval.c:127
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_call0+0x1aa) [0x7f85577b0cda] ../../trunk/vm_eval.c:58
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_catch_protect+0xaf) [0x7f85577a352f] ../../trunk/vm_eval.c:1997
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(exec_recursive+0x5b2) [0x7f85577c47e2] ../../trunk/thread.c:4857
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_hash+0x15) [0x7f85576777e5] ../../trunk/hash.c:112
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_any_hash+0x6c) [0x7f855767792c] ../../trunk/hash.c:156
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(st_update+0x32) [0x7f8557738a52] ../../trunk/st.c:843
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_hash_aset+0xce) [0x7f8557676eee] ../../trunk/hash.c:462
/home/ko1/src/rb/allocation_tracer/lib/allocation_tracer/allocation_tracer.so(aggregate_result_i+0x35d) [0x7f8555dcc9cd] ../../../../ext/allocation_tracer/allocation_tracer.c:610
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(st_foreach+0xb5) [0x7f8557739545] ../../trunk/st.c:1050
/home/ko1/src/rb/allocation_tracer/lib/allocation_tracer/allocation_tracer.so(aggregate_result+0x386) [0x7f8555dcd3f6] ../../../../ext/allocation_tracer/allocation_tracer.c:673
/home/ko1/src/rb/allocation_tracer/lib/allocation_tracer/allocation_tracer.so(allocation_tracer_trace_i+0x74) [0x7f8555dce584] ../../../../ext/allocation_tracer/allocation_tracer.c:729
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_ensure+0xb8) [0x7f8557652908] ../../trunk/eval.c:912
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(vm_call_cfunc+0x11e) [0x7f85577a14fe] ../../trunk/vm_insnhelper.c:1418
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(vm_call_method+0x11e) [0x7f85577b7f5e] ../../trunk/vm_insnhelper.c:1728
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(vm_exec_core+0x1e88) [0x7f85577a89b8] ../../trunk/insns.def:1045
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(vm_exec+0x84) [0x7f85577accb4] ../../trunk/vm.c:1430
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(rb_iseq_eval_main+0x1fb) [0x7f85577afdfb] ../../trunk/vm.c:1705
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(ruby_exec_internal+0xc4) [0x7f855764fa44] ../../trunk/eval.c:257
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(ruby_exec_node+0x1d) [0x7f8557651bad] ../../trunk/eval.c:322
/home/ko1/ruby/install/trunk/lib/libruby.so.2.3(ruby_run_node+0x1c) [0x7f85576543bc] ../../trunk/eval.c:314
/mnt/sdb1/ruby/install/trunk/bin/ruby(main+0x4b) [0x40088b] ../../trunk/main.c:36