Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle undefined from JSON.stringify #321

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

bnoordhuis
Copy link
Collaborator

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

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
@bnoordhuis bnoordhuis merged commit e713b65 into rubyjs:main Sep 21, 2024
13 of 14 checks passed
@bnoordhuis bnoordhuis deleted the json-stringify branch September 21, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Disposing the isolate that is entered by a thread" for some exotic objects
1 participant