-
Notifications
You must be signed in to change notification settings - Fork 284
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
Exceeded the maximum call stack inside an async function leads to an uncaught promise, even if await is used properly #778
Comments
The RangeError should bubble up to the try/catch block so yes, I would say this is a (V8) bug. It may have been fixed upstream in V8 already but I can't test that right now and a quick code search didn't turn up anything. |
In the Node.js canary with V8 6.2.172, this code still produces the same unhandled promise rejection. |
Strangely, in the Google Chrome canary with the same V8 6.2.172, it seems to bubble: RangeError: Maximum call stack size exceeded
at x (<anonymous>:1:1)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11)
at x (<anonymous>:2:11) |
Sounds like I should file against Node, referencing this? (thanks @vsemozhetbyt for actually doing the investigation of Chrome behaviour against the right V8) |
I checked with V8 ToT today (nominally 6.2.218) and it works there:
(Yes, no stack trace - you get one if you I figured out what the problem is and it's a known issue: console.log; // Force instantiation.
async function x() {
await x();
}
(async function () {
try {
await x();
} catch (e) {
console.log(e);
}
})() And that prints:
cc @addaleax - since this keeps coming up, how about we simply instantiate log(), error(), etc. eagerly in bootstrap_node.js? |
Yeah, sounds okay. ;) |
Before this commit they were instantiated lazily but that fails when the first call is under stack overflow conditions. Fixes: nodejs/help#778
looks like the underlying issue is resolved, close-able? |
Node.js tries to work around it on a best-effort basis. I'll close this out. |
Running:
Leads to an uncaught promise:
Running the same thing with babel transpiling to bluebird coroutines works fine. I guess there are two questions?
The text was updated successfully, but these errors were encountered: