It seems to be a fairly simple patch for 1.8 series, too:
https://bugs.ruby-lang.org/projects/ruby-193/repository/revisions/43776
just a few lines truncating input in util.c.Break your ruby here:
JSON.parse("[1."+"1"*300000+"]")