[MacRuby-devel] [MacRuby] #228: Crash in my NSOutlineView data source

MacRuby ruby-noreply at macosforge.org
Mon Mar 9 02:40:15 PDT 2009


#228: Crash in my NSOutlineView data source
--------------------------------+-------------------------------------------
 Reporter:  cyberfox@…          |       Owner:  lsansonetti@…        
     Type:  defect              |      Status:  new                  
 Priority:  major               |   Milestone:  MacRuby 1.0          
Component:  MacRuby             |    Keywords:  crash                
--------------------------------+-------------------------------------------
 Greetings,

 I am at a loss; I've thrown away two days trying to figure out what it
 might be in my code, and countless variations on the theme of 'what data
 will this allow?'  I've tried a deep hash, recursive arrays, and now a
 custom Pair structure, and it always blows up at a certain point
 _eventually_, and not in a nice Ruby way.  :)

 I've figured out so much, but I'm fully stymied on getting NSOutlineView
 working with in my app.  Specifically, it appears that some data is being
 corrupted in memory, and when it's being referenced, it's crashing to gdb.

 My application is at http://github.com/cyberfox/fallout3 and is my first
 attempt at a MacRuby app.  I don't really know Cocoa either, although I
 was able to figure out a lot.

 If you run it, and paste the following data:
 {{{
 #1234
 #4321
 #1245
 #2143
 #5432
 #3412
 }}}
 into the TextView, then click 'Analyze', then try to open up some of the
 entries in the OutlineView on the right.  You'll see the crash after one
 or two levels.  I tried 0.3, I tried trunk, and then 0.4 was released, and
 I jumped on that.  Nothing works.

 It's entirely possible I'm doing something wrong; I figured out how to
 write a NSOutlineView data source by the seat of my pants, and it's
 obviously possible I'm getting it wrong.  But I can't imagine that I'm
 getting it wrong in a way that's letting me stomp on memory from Ruby...

 Please help me understand this; I really believe it shouldn't be crashing
 to GDB, even if I've really screwed up my algorithm.

 When debugging an earlier version (it used array pairs and .first and
 .last), I found it died at ruby.h:1149 which was a reference to *(Class
 *)obj == (Class)rb_cFixnum and it was blowing up because obj was
 0xffffffff, obviously bad.

 I believe that something is getting stomped on; and my program is showing
 it consistently.  It is likely my fault, but it shouldn't be _possible_...

 Please try it and let me know what is going on...

 --  Morgan Schweers

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



More information about the MacRuby-devel mailing list