[MacRuby] #1058: Segfault occurs when Array#== handles recursive array.

MacRuby ruby-noreply at macosforge.org
Sat Dec 18 05:04:47 PST 2010


#1058: Segfault occurs when Array#== handles recursive array.
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Test Script:
 {{{
 #!ruby
 # ruby_bug "ruby-core #1448", "1.9.1"
 # it "handles well recursive arrays"
 module ArraySpecs
   def self.empty_recursive_array
     a = []
     a << a
     a
   end
 end

 a = ArraySpecs.empty_recursive_array
 a2 = ArraySpecs.empty_recursive_array
 p a == a2
 }}}

 BackTrace:
 {{{
 $ DYLD_LIBRARY_PATH=. gdb --args ./macruby -I./lib ~/tmp/tt.rb

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5f3fffb8
 0x0000000100136c0f in rb_vm_dispatch () at dispatcher.cpp:582
 582             int argc, const VALUE *argv)
 (gdb) bt 20
 #0  0x0000000100136c0f in rb_vm_dispatch () at dispatcher.cpp:582
 #1  0x000000010005dd61 in rb_vm_call0 (vm=0x100e250f0, top=0,
 self=8590155168, klass=0x20006d2a0, sel=0x100e29450, block=0x0, opt=2
 '\002', argc=1, argv=0x7fff5f400ac0) at vm.h:603
 #2  0x000000010005dbf2 in rb_vm_call (self=8590155168, sel=0x100e29450,
 argc=1, argv=0x7fff5f400ac0) at vm.h:610
 #3  0x000000010005ddcb in rb_equal (obj1=8590155168, obj2=8590155360) at
 object.c:67
 #4  0x00000001000159c8 in rb_equal_fast (x=8590155168, y=8590155360) at
 array.c:139
 #5  0x000000010001a0b4 in rb_ary_equal (ary1=8590155168, ary2=8590155360)
 at array.c:2463
 #6  0x000000010001a193 in rary_equal (ary1=8590155168, sel=0x100e29450,
 ary2=8590155360) at array.c:2484
 #7  0x00000001001381fa in __rb_vm_rcall [inlined] () at /Users/watson/src
 /macruby-trunk-svn/dispatcher.cpp:161
 #8  0x00000001001381fa in ruby_dispatch [inlined] () at /Users/watson/src
 /macruby-trunk-svn/dispatcher.cpp:466
 #9  0x00000001001381fa in rb_vm_dispatch () at dispatcher.cpp:849
 #10 0x000000010005dd61 in rb_vm_call0 (vm=0x100e250f0, top=0,
 self=8590155168, klass=0x20006d2a0, sel=0x100e29450, block=0x0, opt=2
 '\002', argc=1, argv=0x7fff5f4017d0) at vm.h:603
 #11 0x000000010005dbf2 in rb_vm_call (self=8590155168, sel=0x100e29450,
 argc=1, argv=0x7fff5f4017d0) at vm.h:610
 #12 0x000000010005ddcb in rb_equal (obj1=8590155168, obj2=8590155360) at
 object.c:67
 #13 0x00000001000159c8 in rb_equal_fast (x=8590155168, y=8590155360) at
 array.c:139
 #14 0x000000010001a0b4 in rb_ary_equal (ary1=8590155168, ary2=8590155360)
 at array.c:2463
 #15 0x000000010001a193 in rary_equal (ary1=8590155168, sel=0x100e29450,
 ary2=8590155360) at array.c:2484
 #16 0x00000001001381fa in __rb_vm_rcall [inlined] () at /Users/watson/src
 /macruby-trunk-svn/dispatcher.cpp:161
 #17 0x00000001001381fa in ruby_dispatch [inlined] () at /Users/watson/src
 /macruby-trunk-svn/dispatcher.cpp:466
 #18 0x00000001001381fa in rb_vm_dispatch () at dispatcher.cpp:849
 #19 0x000000010005dd61 in rb_vm_call0 (vm=0x100e250f0, top=0,
 self=8590155168, klass=0x20006d2a0, sel=0x100e29450, block=0x0, opt=2
 '\002', argc=1, argv=0x7fff5f4024e0) at vm.h:603
 (More stack frames follow...)
 Current language:  auto; currently objective-c++
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1058>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list