Issue #9717 has been updated by Akira Tanaka.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r45542.

----------
* gc.c (mark_current_machine_context): Call SET_STACK_END.
  This reverts a hunk of r40703 by ko1.
  This fixes [ruby-dev:48098] [Bug #9717].

----------------------------------------
Bug #9717: [BUG] setup_arg: unknown node: NODE_DVAR
https://bugs.ruby-lang.org/issues/9717#change-46127

* Author: Akira Tanaka
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-04-09 trunk 45540) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
    以下のようにすると、[BUG] setup_arg: unknown node: NODE_DVAR というメッセージが出て異常終了します。
    
    % ./miniruby -e 'GC.stress = true; eval("foo += bar")'
    -e:1: [BUG] setup_arg: unknown node: NODE_DVAR
    
    ruby 2.2.0dev (2014-04-09 trunk 45540) [x86_64-linux]
    
    -- Control frame information -----------------------------------------------
    c:0003 p:---- s:0008 e:000007 CFUNC  :eval
    c:0002 p:0021 s:0004 E:0006e8 EVAL   -e:1 [FINISH]
    c:0001 p:0000 s:0002 E:000ed8 TOP    [FINISH]
    
    -- Ruby level backtrace information ----------------------------------------
    -e:1:in `<main>'
    -e:1:in `eval'
    
    -- C level backtrace information -------------------------------------------
    -e:1: [BUG] Segmentation fault at 0x00000000000041
    ruby 2.2.0dev (2014-04-09 trunk 45540) [x86_64-linux]
    
    -- Control frame information -----------------------------------------------
    c:0003 p:---- s:0008 e:000007 CFUNC  :eval
    c:0002 p:0021 s:0004 E:0006e8 EVAL   -e:1 [FINISH]
    c:0001 p:0000 s:0002 E:000ed8 TOP    [FINISH]
    
    -- Ruby level backtrace information ----------------------------------------
    -e:1:in `<main>'
    -e:1:in `eval'
    
    -- C level backtrace information -------------------------------------------
    /home/akr/tst1/ruby/miniruby(rb_print_backtrace+0x19) [0x7f8fa358cd0a] vm_dump.c:685
    /home/akr/tst1/ruby/miniruby(rb_vm_bugreport+0x93) [0x7f8fa358cdb3] vm_dump.c:824
    /home/akr/tst1/ruby/miniruby(report_bug+0x18d) [0x7f8fa341e4c2] error.c:312
    /home/akr/tst1/ruby/miniruby(rb_bug+0xdf) [0x7f8fa341e63c] error.c:339
    /home/akr/tst1/ruby/miniruby(sigsegv+0x86) [0x7f8fa34ff9ad] signal.c:731
    /lib/x86_64-linux-gnu/libpthread.so.0 [0x7f8fa2f88880]
    /home/akr/tst1/ruby/miniruby(rb_dump_backtrace_with_lines+0x164) [0x7f8fa35a3eeb] addr2line.c:672
    /home/akr/tst1/ruby/miniruby(rb_print_backtrace+0x2d) [0x7f8fa358cd1e] vm_dump.c:687
    /home/akr/tst1/ruby/miniruby(rb_vm_bugreport+0x93) [0x7f8fa358cdb3] vm_dump.c:824
    /home/akr/tst1/ruby/miniruby(report_bug+0x18d) [0x7f8fa341e4c2] error.c:312
    /home/akr/tst1/ruby/miniruby(rb_bug+0xdf) [0x7f8fa341e63c] error.c:339
    /home/akr/tst1/ruby/miniruby(setup_args+0x3c1) [0x7f8fa3559a2f] compile.c:3149
    /home/akr/tst1/ruby/miniruby(iseq_compile_each+0x66fc) [0x7f8fa35602f2]compile.c:4444
    /home/akr/tst1/ruby/miniruby(iseq_compile_each+0x3ffe) [0x7f8fa355dbf4]compile.c:3918
    /home/akr/tst1/ruby/miniruby(rb_iseq_compile_node+0x4bb) [0x7f8fa3553182] compile.c:507
    /home/akr/tst1/ruby/miniruby(rb_iseq_new_with_bopt_and_opt+0x9c) [0x7f8fa3569c98] iseq.c:449
    /home/akr/tst1/ruby/miniruby(rb_iseq_new_with_opt+0x58) [0x7f8fa3569d02] iseq.c:460
    /home/akr/tst1/ruby/miniruby(rb_iseq_compile_with_option+0x27a) [0x7f8fa356a809] iseq.c:618
    /home/akr/tst1/ruby/miniruby(eval_string_with_cref+0x3f7) [0x7f8fa3583c60] vm_eval.c:1263
    /home/akr/tst1/ruby/miniruby(eval_string+0x42) [0x7f8fa35843b8] vm_eval.c:1329
    /home/akr/tst1/ruby/miniruby(rb_f_eval+0xc8) [0x7f8fa3584482] vm_eval.c:1368
    /home/akr/tst1/ruby/miniruby(call_cfunc_m1+0x2f) [0x7f8fa3572edd] vm_insnhelper.c:1330
    /home/akr/tst1/ruby/miniruby(vm_call_cfunc_with_frame+0x216) [0x7f8fa3573a8c] vm_insnhelper.c:1502
    /home/akr/tst1/ruby/miniruby(vm_call_cfunc+0x2b) [0x7f8fa3573b99] vm_insnhelper.c:1592
    /home/akr/tst1/ruby/miniruby(vm_call_method+0x113) [0x7f8fa35746ae] vm_insnhelper.c:1786
    /home/akr/tst1/ruby/miniruby(vm_call_general+0x2b) [0x7f8fa3574f1f] vm_insnhelper.c:1941
    /home/akr/tst1/ruby/miniruby(vm_exec_core+0x27cd) [0x7f8fa35787da] insns.def:1028
    /home/akr/tst1/ruby/miniruby(vm_exec+0xe7) [0x7f8fa35887bb] vm.c:1328
    /home/akr/tst1/ruby/miniruby(rb_iseq_eval_main+0x34) [0x7f8fa3589730] vm.c:1586
    /home/akr/tst1/ruby/miniruby(ruby_exec_internal+0x134) [0x7f8fa34244f2]eval.c:251
    /home/akr/tst1/ruby/miniruby(ruby_exec_node+0x24) [0x7f8fa342461b] eval.c:316
    /home/akr/tst1/ruby/miniruby(ruby_run_node+0x3e) [0x7f8fa34245ee] eval.c:308
    /home/akr/tst1/ruby/miniruby(main+0x71) [0x7f8fa33d9586] main.c:36
    *** Error in `./miniruby': double free or corruption (out): 0x00007f8fa55e00c0 ***
    zsh: segmentation fault  ./miniruby -e 'GC.stress = true; eval("foo += bar")'
    % 
    
    




-- 
https://bugs.ruby-lang.org/