-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
async_hooks
Segmentation fault
#33090
Comments
replace |
Thanks for the idea. I buffered the logs and printed them after |
Ah, there's an infinite loop. 🤦♂️ |
maybe there have a bug, or just overflow the memories. whatever, I'll check it later |
It should not segfault. Infinite recursion should only throw a RangeError, not terminate the process. Node.js is probably miscalculating stack size. I cannot reproduce segfault on Windows (I see RangeError thrown and exit code 1) |
Yes. Basically, I expect the output error is |
|
Could we add a feature that will throw an error when the user calls a loop async_hooks? I think it more useful for coding experience instead of CPU full running and stack exceeded. /cc @nodejs/async_hooks |
I can reproduce it on Linux with the latest official version:
Running without |
@jiripospisil great, now we know where the bug is |
|
Exactly, my point is on the emphasis of
Then what's the point of having this option? |
@szmarczak V8 or Node.js don’t allocate the main thread stack – that’s done by the OS. You can control that value through
I don’t think changing the behavior is an option here. Changing the help page would not be an issue – what would be a good, succinct description for
The point is that people who know that their OS provides more stack space than V8 assumes, and want deeper recursion depths, can inform V8 about that. |
Sounds good. What does
|
@szmarczak I'm not sure whether
I think that wording would be misleading because it makes it sound like V8 allocates the stack region. |
Do you know what file is responsible for the contents of help page for the v8 options? |
Let me guess. So editing this in the Node.js repo wouldn't pass? |
@szmarczak Yes, this would have to be changed in V8. I assume that that wouldn’t be an issue, though. |
Linux solus 5.5.11-151.current #1 SMP PREEMPT Tue Mar 24 18:06:46 UTC 2020 x86_64 GNU/Linux
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
On my machine - always. I've installed
node
vianvm
. Triednve
too. The same result.What is the expected behavior?
It should print logs.There's an infinite loop. It should throwMaximum call stack size exceeded
.What do you see instead?
The text was updated successfully, but these errors were encountered: