From: Eric Wong Date: 2011-08-09T13:04:28+09:00 Subject: [ruby-core:38869] Re: [Ruby 1.9 - Bug #5173] [PATCH] json/generator: prevent GC of temporary strings Nobuyoshi Nakada wrote: > =begin > The implementation of json/generator seems quite naive. Yeah :< I don't know why any of the fbuffer code exists since rb_str_* provides that functionality already... > $ ./ruby -rjson -e 'class Bignum;def to_s;end;end; p JSON::Ext::Generator::State.new.generate(1<<64)' > -e:1: [BUG] Bus Error I made it raise TypeError in http://bogomips.org/ruby-json.git/commit/?id=40869aa9fc8ab194813b8 > $ ./ruby -rjson -e 'class << (a = ""); def to_s;self;end; undef to_json; end; p JSON::Ext::Generator::State.new.generate(a)' > -e:0: stack level too deep (SystemStackError) Haven't gotten to this one, yet. Can you fix or report? Maybe I'll have time tomorrow... > Anyway, JSON issues need to be reported to the upstream. I've ported the changes to the standalone json gem and updated https://github.com/flori/json/issues/46 with links to my repos. -- Eric Wong