-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
recursion error not reported #14311
Comments
Without RangeError: Maximum call stack size exceeded
at recursiveFunction (test.js:8:27)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5) |
With redirected stdout and without util.js:597
function formatPrimitive(ctx, value) {
^
RangeError: Maximum call stack size exceeded
at formatPrimitive (util.js:597:25)
at formatValue (util.js:350:19)
at inspect (util.js:196:10)
at exports.format (util.js:68:24)
at Console.log (console.js:106:24)
at recursiveFunction (test.js:9:13)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5)
at recursiveFunction (test.js:10:5) |
Yes, get the same here. |
I can reproduce on Windows, not on Linux. |
I'd chalk this up as a known limitation. Since the stack is almost full, there is hardly anything you can do that won't raise another exception. |
I have to disagree with you there bnoordhuis ; I'd say the behaviour should be consistent across implementations and scenarios and should report the error as it does on Linux or on Windows without the console.log call. I'd mark this as a bug. (otherwise you have apps just stopping mid execution for no apparent reason with no way to find the fault bar an educated guess..) |
I don't think you are hitting an actual stack overflow here, but rather a v8 limit, and it should be possible to report that. It is not like the process itself is out of memory, right? cc @nodejs/v8 |
Let me amend: hardly anything you can do in javascript. See #6899 for a similar bug report. Node.js already tries to do something meaningful on stack overflow but there isn't much wiggle room with a try/catch statement or |
And for some more (and more recent) discussion: nodejs/node-v8#5 |
I'm closing this as known limitation per my previous comments. If anyone has ideas on how to handle it better, please open a PR. |
App just stops without any error information. Eg.
This will run so far then just stop. Try/Catch didn't work either - tried as above with ;
Again nothing - just stops.
Have workaround ;
but original code should report error when fails.
The text was updated successfully, but these errors were encountered: