[MacRuby] #1050: Segfault occurs with Rake::namespace.
#1050: Segfault occurs with Rake::namespace. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby require 'rake' def defmock(sym, &block) class << @mock; self; end.class_eval do define_method(sym, block) end end @app = Rake.application Rake.application = @mock = Object.new args = [] defmock(:in_namespace) {|a, *| args << a} namespace "xyz" do end }}} BacTrace: {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000005 0x000000010013c350 in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:1153 1153 new_argv[i] = i < argc ? argv[i] : Qnil; (gdb) bt #0 0x000000010013c350 in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:1153 #1 0x000000010013c350 in rb_vm_block_eval2 (b=0x2002b6c60, self=8592780032, sel=0x103d73280, argc=2847616, argv=0x5) at dispatcher.cpp:1214 #2 0x0000000100137013 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:452 #3 0x0000000100137013 in rb_vm_dispatch () at dispatcher.cpp:1214 #4 0x0000000103b00c26 in ?? () #5 0x0000000103b328e0 in ?? () #6 0x00000001001375e6 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:161 #7 0x00000001001375e6 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:466 #8 0x00000001001375e6 in rb_vm_dispatch () at dispatcher.cpp:1214 #9 0x0000000103b00c26 in ?? () #10 0x0000000103b00375 in ?? () #11 0x00000001001519cd in rb_vm_run (fname=0x20004f4a0 "/Users/watson/tmp/test_rake.rb", node=0x2000551a0, binding=0x0, inside_eval=false) at vm.cpp:3928 #12 0x0000000100038479 in ruby_run_node (n=0x2000551a0) at eval.c:211 #13 0x0000000100000c15 in main (argc=3, argv=0x100e1de30, envp=0x7fff5fbfee60) at main.cpp:40 Current language: auto; currently objective-c++ (gdb) }}} By the following commands, could confirm a this problem. {{{ On MacRuby source directory: $ cd test/test-mri/ $ macruby -r require_relative.rb test/rake/test_top_level_functions.rb -v }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1050> MacRuby <http://macruby.org/>
#1050: Segfault occurs with Rake::namespace. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby 1.0 Comment: Quickly looking inside gcd, we are calling a stub generated by #define_method with the wrong calling convention. The stub is supposed to accept 4 arguments (self, sel, argc, argv), arity -1, but we call it passing (self, sel and array), arity -2. Therefore, argc has an incorrect value which leads to this memory error. -- Ticket URL: <http://www.macruby.org/trac/ticket/1050#comment:1> MacRuby <http://macruby.org/>
#1050: Segfault occurs with Rake::namespace. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): Here is a reduction: {{{ $ ./miniruby -e "class Foo; define_method(:foo){|_,*a|p a}; end; Foo.new.foo(42)" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1050#comment:2> MacRuby <http://macruby.org/>
#1050: Segfault occurs with Rake::namespace. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.9 Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * milestone: MacRuby 1.0 => MacRuby 0.9 Comment: Should be fixed in r5037. -- Ticket URL: <http://www.macruby.org/trac/ticket/1050#comment:3> MacRuby <http://macruby.org/>
#1050: Segfault occurs with Rake::namespace. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.9 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by watson1978@…): * status: new => closed * resolution: => fixed Comment: Thank you for your commit. I confirmed to fix this issue. -- Ticket URL: <http://www.macruby.org/trac/ticket/1050#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby