-
Notifications
You must be signed in to change notification settings - Fork 630
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
Call stack may need increasing #956
Comments
Hermes compiled for desktop has a huge stack compared to all other engines, which you can verify by running this:
So, in order to pin this down, I have a few questions:
|
I built it off the main branch. I increased the limit of The example branch shows (most of) the real-world scenario - so the stack traces are accurate there. But I'll add them below Stack trace
It's normal MathJax code - it's the input that causes the stack to overflow Looking at this a bit more, I think it's the interaction with natively implemented functions causing this. This code demonstrates the problem:- var level = 0;
function foo() {
++level;
[0].map(foo);
}
try {
foo();
} catch (e) {
print("Level", level);
} Gives 128. I get over 15k in JSC. |
@jacobp100 What you're running into has been observed before. You can read Tzvetan's comment here #135 (comment) but the native stack limit is set to 128. |
Yep - that looks like the same issue. I'll close this. Thanks |
Bug Description
I switched my app to Hermes and started seeing some errors in Sentry. My app uses MathJax to do rendering - which is where the errors are originated from
I've pinned it down to the call stack just being too small
I've attached a repo that demonstrates the problem (run
yarn
,yarn build
, then runout.js
node or Hermes)Node runs perfectly fine. Hermes has a stack overflow. I tested increasing the stack size, and that did fix the problem
I'm not really sure what the exact limit should be - the user from this error appeared to be having nesting square roots, presumably for the pretty pattern they produce. They got 11 levels deep before the error occurred with Hermes. I can get to about 70 with JSC
I suppose there will be a few other applications where the stack size depends on user input
code example:
https://github.com/jacobp100/mathjax-hermes
The Expected Behavior
The text was updated successfully, but these errors were encountered: