intridea/multi_json

Segmentation fault when using Oj as adapter

Opened this issue · 1 comments

Trace:

irb(main):001:0> require 'oj';
=> true
irb(main):002:0> require 'multi_json'
=> true
irb(main):003:1* class A
irb(main):004:1*   def to_json; end
irb(main):005:0> end
=> :to_json
irb(main):006:0> MultiJson.dump(A.new)
/home/natton/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/multi_json-1.15.0/lib/multi_json/adapters/oj.rb:56: [BUG] Segmentation fault at 0x0000000000000008
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]                                                 
                                                                              

System:

  • gem multi-json version 1.15.0
  • gem oj version version 3.13.23

Using Oj.dump can still dump to a json string

Oj.dump(A.new)
=> "{\"^o\":\"A\"}"