[MacRuby] #776: Segfault occurs with case-when.
#776: Segfault occurs with case-when. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ $ cat test_case.rb case when *true puts true else puts false end a = 10 case when *a puts true else puts false end }}} Result of Ruby 1.9.1: {{{ $ ruby test_case.rb true true }}} Result of MacRuby Trunk: {{{ $ macruby test_case.rb zsh: segmentation fault macruby test_case.rb }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/776> MacRuby <http://macruby.org/>
#776: Segfault occurs with empty `case' clause and splat argument `when' clause. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by eloy.de.enige@…): These work: {{{ % macruby -e "case; when true; end" % macruby -e "case true; when *true; end" }}} This one fails: {{{ % macruby -e "case; when *true; end" zsh: segmentation fault macruby -e "case; when *true; end" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/776#comment:1> MacRuby <http://macruby.org/>
#776: Segfault occurs with empty `case' clause and splat argument `when' clause. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by martinlagardette@…): And here's the backtrace: {{{ (gdb) r Starting program: /usr/local/bin/macruby test.rb Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010 0x00000001000fbf1a in rb_pointer_new2 () (gdb) bt #0 0x00000001000fbf1a in rb_pointer_new2 () #1 0x00000001008aac43 in LLVMLinkInJIT () #2 0x000000010012226e in rb_vm_get_opaque_data () #3 0x00000001001071b6 in rb_vm_get_opaque_data () #4 0x000000010010fcec in rb_vm_get_opaque_data () #5 0x00000001001183e3 in rb_vm_get_opaque_data () #6 0x0000000100125790 in rb_vm_get_opaque_data () #7 0x000000010011a7dc in rb_vm_get_opaque_data () #8 0x0000000100125dcf in rb_vm_get_opaque_data () #9 0x00000001001170fb in rb_vm_get_opaque_data () #10 0x000000010013c943 in rb_vm_run () #11 0x000000010002f530 in ruby_run_node () #12 0x0000000100000cf8 in main () (gdb) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/776#comment:2> MacRuby <http://macruby.org/>
#776: Segfault occurs with empty `case' clause and splat argument `when' clause. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): your backtrace is incorrect (because you probably generated it from a version of macruby where symbols have been stripped). Here is the correct one: {{{ #0 llvm::PATypeHolder::get (this=0x10) at Type.h:507 #1 0x00000001008a9623 in llvm::CallInst::init () at atomicity.h:51 #2 0x000000010013068e in init<llvm::Value**> [inlined] () at /usr/local/include/llvm/Instructions.h:847 #3 CallInst<llvm::Value**> [inlined] () at Instructions.h:1078 #4 CallInst<llvm::Value**> [inlined] () at /usr/local/include/llvm/Instructions.h:894 #5 0x000000010013068e in llvm::CallInst::Create<llvm::Value**> (Func=0x100f34370, ArgBegin=0x7fff5fbfd2f0, ArgEnd=<value temporarily unavailable, due to optimizations>, NameStr=@0x7fff5fbfd290, InsertAtEnd=0x10145a060) at Instructions.h:1078 #6 0x00000001001155d6 in RoxorCompiler::compile_protected_call (this=0x103860200, imp=0x100f34370, args_begin=0x7fff5fbfd2f0, args_end=0x7fff5fbfd308) at compiler.cpp:342 #7 0x000000010011e10c in RoxorCompiler::compile_when_splat (this=0x103860200, comparedToVal=0x0, splatVal=0x100f4d680) at compiler.cpp:538 #8 0x0000000100126803 in RoxorCompiler::compile_when_arguments (this=0x103860200, args=<value temporarily unavailable, due to optimizations>, comparedToVal=0x0, thenBB=0x10145a240) at compiler.cpp:434 #9 0x0000000100133bb0 in RoxorCompiler::compile_node0 (this=0x103860200, node=0x2000c0d20) at compiler.cpp:4534 #10 0x0000000100128bfc in RoxorCompiler::compile_node () at /Users/lrz/src /macruby-trunk/compiler.cpp:4630 #11 0x0000000100128bfc in RoxorCompiler::compile_scope (this=0x103860200, node=0x2000c0ce0) at compiler.cpp:2742 #12 0x00000001001341ef in RoxorCompiler::compile_node0 (this=0x103860200, node=0x2000c0ce0) at compiler.cpp:3193 #13 0x000000010012551b in RoxorCompiler::compile_node () at /Users/lrz/src /macruby-trunk/compiler.cpp:4630 #14 0x000000010012551b in RoxorCompiler::compile_main_function (this=0x103860200, node=0x2000c0ce0, can_interpret_p=0x7fff5fbff90f) at compiler.cpp:4687 }}} It looks like we don't support empty-case statements. I didn't even know it was valid Ruby :) -- Ticket URL: <http://www.macruby.org/trac/ticket/776#comment:3> MacRuby <http://macruby.org/>
#776: Segfault occurs with empty `case' clause and splat argument `when' clause. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.7 Comment: Should be fixed in r4333. -- Ticket URL: <http://www.macruby.org/trac/ticket/776#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby