[MacRuby] #1145: Segfault occurs with enumerateObjectsUsingBlock

MacRuby ruby-noreply at macosforge.org
Tue Feb 1 04:48:57 PST 2011


#1145: Segfault occurs with enumerateObjectsUsingBlock
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Segfault occurs when does not load the Foundation.framework in test script
 and uses the enumerateObjectsUsingBlock.

 Test Script:
 {{{
 #!ruby
 #framework 'Foundation'

 ary = ['zero', 'one', 'two', 'three', 'four']
 res = []
 ary.enumerateObjectsUsingBlock(Proc.new { |obj, idx, stop|
   res << obj
   stop.assign(true) if idx == 2
 })
 p res
 }}}

 BackTrace:
 {{{
 $ DYLD_LIBRARY_PATH=. gdb --args ./macruby ~/tmp/test.rb
 GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Wed Sep 22 02:45:02 UTC
 2010)
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for
 details.
 This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
 shared libraries ..... done

 (gdb) r
 Starting program: /Users/watson/src/macruby-trunk-svn/macruby
 /Users/watson/tmp/test.rb
 Reading symbols for shared libraries .++++........................ done
 Reading symbols for shared libraries . done

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
 0x0000000000000000 in ?? ()
 (gdb) bt
 #0  0x0000000000000000 in ?? ()
 #1  0x00007fff865286d7 in __NSArrayEnumerate ()
 #2  0x00000001033012c6 in ?? ()
 #3  0x000000010013c2ad in rb_vm_dispatch () at dispatcher.cpp:480
 #4  0x00000001033006f6 in ?? ()
 #5  0x0000000103300248 in ?? ()
 #6  0x0000000100155aeb in rb_vm_run (fname=0x2000501e0
 "/Users/watson/tmp/test.rb", node=0x2000989c0, binding=0x0,
 inside_eval=false) at vm.cpp:3930
 #7  0x000000010003945b in ruby_run_node (n=0x2000989c0) at eval.c:211
 #8  0x0000000100000c15 in main (argc=2, argv=0x100e1de40,
 envp=0x7fff5fbfee80) at main.cpp:40
 (gdb)
 }}}

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



More information about the macruby-tickets mailing list