[MacRuby-devel] [MacRuby] #321: macgem crashes with "unknown: [BUG] Segmentation fault".

MacRuby ruby-noreply at macosforge.org
Wed Sep 2 03:30:43 PDT 2009


#321: macgem crashes with "unknown: [BUG] Segmentation fault".
---------------------------+------------------------------------------------
 Reporter:  occam@…        |       Owner:  lsansonetti@…        
     Type:  defect         |      Status:  new                  
 Priority:  major          |   Milestone:                       
Component:  MacRuby        |    Keywords:                       
---------------------------+------------------------------------------------
 macgem crashes with "unknown: [BUG] Segmentation fault".

 I tracked it to rubygems/config_file.rb:118):

     operating_system_config = Marshal.load
 Marshal.dump(OPERATING_SYSTEM_DEFAULTS)

 which crashes in the Marshal.load.  Assuming the Marshal.dump is working
 (I can't confirm), the crash leads to macruby/marshal.c:1037ff where
 "RSTRING_LEN(arg->src)" blows up in a conditional:

         if (RSTRING_LEN(arg->src) > arg->offset) {

 The RSTRING_LEN macro tracks to CFStringGetLength crashing on "ptr" at
 macruby/string.c:625ff:

     long
     rb_str_clen(VALUE ptr)
     {
         return CFStringGetLength((CFStringRef)ptr);
     }

 The "VALUE ptr" gets passed in from Marshal.load and blows up in
 CFStringGetLength.  I'm not sure whether the parameter is broken (though
 it seems valid), or whether perhaps Snow Leopard changed CFStringRef so
 that MacRuby's "struct load_arg *" needs to be updated to maintain
 compatibility.

 With luck, this issue is not too hard for a more astute debugger (or
 somone with knowledge of SL's CFStringRef) to solve.  It would be nice to
 have macgem working (not to mention Marshal'ing).

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



More information about the MacRuby-devel mailing list