[MacRuby] #1084: Abort occurs when was passed Object of Method to define_method.
#1084: Abort occurs when was passed Object of Method to define_method. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby ## ok # c = Class.new # c.class_eval { define_method(:baz, proc { return :baz}) } # ng c = Class.new c.class_eval { def foo; :foo; end } o = c.new c2 = Class.new(c) c2.class_eval { define_method(:baz, o.method(:foo)) } }}} BackTrace: {{{ Program received signal SIGABRT, Aborted. 0x00007fff8849ecae in __pthread_kill () (gdb) bt #0 0x00007fff8849ecae in __pthread_kill () #1 0x00007fff8849e5d2 in pthread_kill () #2 0x00000001008ec7f6 in abort () at atomicity.h:51 #3 0x000000010004c342 in rb_mod_define_method (mod=8590275456, sel=0x6, argc=0, argv=0x200062260) at proc.c:986 #4 0x0000000100149f35 in rb_vm_dispatch (_vm=0x100d25050, cache=0x100ccb140, top=8590275456, self=8590275456, klass=0x200053740, sel=0x102e4e270, block=0x0, opt=2 '\002', argc=2, argv=0x7fff5fbfdb08) at dispatcher.cpp:448 #5 0x0000000102d5a836 in ?? () #6 0x0000000102d5ae38 in ?? () #7 0x000000010014af2d in rb_vm_yield_under (klass=<value temporarily unavailable, due to optimizations>, self=8590275456, argc=<value temporarily unavailable, due to optimizations>, argv=0x200053740) at dispatcher.cpp:98 #8 0x000000010010295f in specific_eval (argc=<value temporarily unavailable, due to optimizations>, argv=0x0, klass=8590275456, self=8590275456) at vm_eval.c:374 #9 0x0000000100149f35 in rb_vm_dispatch (_vm=0x100d25050, cache=0x100cde540, top=8590066080, self=8590275456, klass=0x200053740, sel=0x100dd9cf0, block=0x200062ce0, opt=0 '\0', argc=0, argv=0x0) at dispatcher.cpp:448 #10 0x0000000102d5a836 in ?? () #11 0x0000000102d5a2d1 in ?? () #12 0x0000000100161c53 in rb_vm_run (fname=<value temporarily unavailable, due to optimizations>, node=0x2000563c0, binding=<value temporarily unavailable, due to optimizations>, inside_eval=false) at vm.cpp:3942 #13 0x0000000100040930 in ruby_run_node (n=0x2000563c0) at eval.c:211 #14 0x0000000100000d28 in main (argc=3, argv=0x100d1de30, envp=<value temporarily unavailable, due to optimizations>) at main.cpp:40 (gdb) q }}} It seems to be necessary to implement TODO of proc.c:rb_mod_define_method. -- Ticket URL: <http://www.macruby.org/trac/ticket/1084> MacRuby <http://macruby.org/>
#1084: Abort occurs when was passed Object of Method to define_method. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.9 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.9 Comment: I added a trivial implementation in r5202. It seems to work. However, it's likely a bit different than CRuby (I see that CRuby does some extra checking). I guess we should enable the ruby specs for that method and follow the implementation on separate tickets. -- Ticket URL: <http://www.macruby.org/trac/ticket/1084#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby