-
Notifications
You must be signed in to change notification settings - Fork 93
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
WIP: Prevent segfaults related to infinite marshal recursion #198
Conversation
After v8 ver upgrade, max data slots seem to have reduced. Need to refactor our usage and allocate some memory to track our runtime state per isolate. |
Also, @SamSaffron the locale test you added is failing on my machine on the main branch. Is this expected? |
@seanmakesgames error is kind of expected until you update libv8-node, try installing latest and updating lockfile etc. |
I need some time to think about this, can you think of a way of introducing minimal levels of safety here without making this configurable? Maybe we just limit at 1000 depth unconditionally using a const or something like that and the patch can be simpler? |
Got it. Thanks. I figured the dependency file would have forced the upgrade when I ran |
I can definitely put that together. For my uses I need 100. :) |
I deleted my lock file and rebundled and am still having the error. What version of libv8-node am I looking for here? |
This was fixed by #200 |
@SamSaffron I just tried to implement this with a fixed depth -- but I can't without #201 because we are at data slot max already: 4/4. I need flags like MEM_SOFTLIMIT_VALUE and MEM_SOFTLIMIT_REACHED to be able to track the stack depth and report it back safely across thread contexts and such. I'll push my WIP - |
I put the non-configurable stack max into #202 -- needs 201 to work. Happy to update them however. |
implemented by #202 |
Creates a marshal stackdepth option, allowing protection against exceptional object structures. See testcases for examples.
Been a while since I've made changes in here, would love some critical eyes on the code.