[MacRuby-devel] Fixing ext/json

dan sinclair dj2 at everburning.com
Wed Aug 19 20:24:58 PDT 2009


I've simplified the crash to happen outside of the JSON extension.

module Test
   class << self
     attr_accessor :foo
   end
end

Test.foo = "asdf"

unknown: [BUG] destination 0x100fe3fb0 isn't in the auto zone
MacRuby version 0.5 (ruby 1.9.0) [universal-darwin9.0, x86_64]

dan



On Aug 17, 2009, at 10:37 PM, dan sinclair wrote:

> Hello,
>
> I've been taking a poke at ext/json for the last few days attempting  
> to get JSON support working again. I've got it compiling but have  
> run into an issue with memory management and the garbage collector  
> that I've been unable to get past.
>
> I've attached my current diff of changes to get JSON working. With  
> this diff applied requiring json will crash with:
>
>    unknown: [BUG] destination 0x100feb300 isn't in the auto zone
>
> I've tracked it down to ext/json/lib/json/common.rb line 59 (at  
> least, it never gets past that line that I've seen)
>
>    self.state = generator::State
>
> Commenting out this line gets further (require works and I can turn  
> {"a" => 1} into JSON. Missing module_function causes JSON.parse to  
> fail).
>
> My test file is:
>
> puts "Requiring"
> require 'json'
> puts "Required"
> require 'pp'
>
> puts "to_json"
> a = {"a" => 1}.to_json
> puts "parse"
> pp JSON.parse(a)
> puts "done"
>
> Thoughts?
>
> Thanks,
> dan
>
>
> <json.diff>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel



More information about the MacRuby-devel mailing list