You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require"mini_racer"putsMiniRacer::Context.new.eval("var b = [0,97,115,109,1,0,0,0,1,26,5,80,0,95,0,80,0,95,1,127,0,96,0,1,110,96,1,100,2,1,111,96,0,1,100,3,3,4,3,3,2,4,7,26,2,12,99,114,101,97,116,101,83,116,114,117,99,116,0,1,7,114,101,102,70,117,110,99,0,2,9,5,1,3,0,1,0,10,23,3,8,0,32,0,20,2,251,27,11,7,0,65,12,251,0,1,11,4,0,210,0,11,0,44,4,110,97,109,101,1,37,3,0,11,101,120,112,111,114,116,101,100,65,110,121,1,12,99,114,101,97,116,101,83,116,114,117,99,116,2,7,114,101,102,70,117,110,99]var o = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(b))).exportso.refFunc()(o.createStruct)")
$ bundle exec ruby t.rb
/usr/lib/ruby/3.0.0/json/common.rb:216:in `parse': 809: unexpected token at 'undefined' (JSON::ParserError)
from /usr/lib/ruby/3.0.0/json/common.rb:216:in `parse'
from /home/bnoordhuis/src/mini_racer/lib/mini_racer.rb:237:in `eval_unsafe'
from /home/bnoordhuis/src/mini_racer/lib/mini_racer.rb:237:in `block (2 levels) in eval'
from /home/bnoordhuis/src/mini_racer/lib/mini_racer.rb:358:in `timeout'
from /home/bnoordhuis/src/mini_racer/lib/mini_racer.rb:236:in `block in eval'
from /home/bnoordhuis/src/mini_racer/lib/mini_racer.rb:234:in `synchronize'
from /home/bnoordhuis/src/mini_racer/lib/mini_racer.rb:234:in `eval'
from t.rb:2:in `<main>'
#
# Fatal error in v8::Isolate::Dispose()
# Disposing the isolate that is entered by a thread
#
Trace/breakpoint trap (core dumped)
V8's JSON.stringify returns undefined, which Ruby's JSON parser rejects by calling rb_raise() and longjmping out of a lexical scope where we hold the v8::Locker
The text was updated successfully, but these errors were encountered:
mini_racer uses V8's JSON.stringify to serialize results but it
returns undefined instead of a string for certain inputs, like WASM
string refs.
When that undefined value is then passed to Ruby's JSON parser, it
raises an exception (using rb_raise) that longjmps out of a lexical
scope where we hold the v8::Locker, without properly unlocking it
again.
Fixes: rubyjs#320
mini_racer uses V8's JSON.stringify to serialize results but it
returns undefined instead of a string for certain inputs, like WASM
string refs.
When that undefined value is then passed to Ruby's JSON parser, it
raises an exception (using rb_raise) that longjmps out of a lexical
scope where we hold the v8::Locker, without properly unlocking it
again.
Fixes: rubyjs#320
mini_racer uses V8's JSON.stringify to serialize results but it
returns undefined instead of a string for certain inputs, like WASM
string refs.
When that undefined value is then passed to Ruby's JSON parser, it
raises an exception (using rb_raise) that longjmps out of a lexical
scope where we hold the v8::Locker, without properly unlocking it
again.
Fixes: #320
V8's
JSON.stringify
returnsundefined
, which Ruby's JSON parser rejects by callingrb_raise()
and longjmping out of a lexical scope where we hold the v8::LockerThe text was updated successfully, but these errors were encountered: