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

False positive on OOM error #212

Merged
merged 3 commits into from Jul 6, 2021
Merged

False positive on OOM error #212

merged 3 commits into from Jul 6, 2021

Conversation

seanmakesgames
Copy link
Contributor

It took us a few weeks to nail down this repro because it was so incredibly finicky.

I recently switched from an execution context which ran one eval with all the code into it, into multiple evals on the same context. Because of this, we ran into this crucial and very hard to isolate issue where the GC callback was happening between IsolateData::Init and IsolateData::Set -- when the GC callback was hit, the 'max memory' field was 0 meaning the check of current memory > max memory would always trigger.

In this incredibly hard to reproduce (we were never able to create a mini_racer cross-machine portable repro) case, it would erroneously report an out of memory.

The fix for this is to move the setter and callback right next to the data init call.

We've run this change on the production servers and verified all the live repro cases we had previously and by the time you take a look at this, it will have baked for a while.

Please let me know if you have any questions.

this causes a confusing OOM crash because max mem is 0 at this point, so if the callback is hit, then the isolate will terminate no matter what.
Copy link
Contributor

@nightpool nightpool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, great find! I don't know enough about the C code here to give you a thorough review, but I did notice one small issue:

ext/mini_racer_extension/mini_racer_extension.cc Outdated Show resolved Hide resolved
Co-authored-by: nightpool <nightpool@users.noreply.github.com>
@seanmakesgames
Copy link
Contributor Author

wow, great find! I don't know enough about the C code here to give you a thorough review, but I did notice one small issue:

Thank goodness. That one has annoyed me for a long time. Somehow after all the stuff, I missed it in the edit. :D

@SamSaffron
Copy link
Collaborator

looks like a good catch to me! thanks.

@SamSaffron SamSaffron merged commit 50c3664 into rubyjs:master Jul 6, 2021
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.

None yet

3 participants