-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
cli: make ^C print a JS stack trace #24937
Comments
Would it make more sense if we only do this when inspector is enabled? Or instead of SIGINT, use another signal. |
If inspector is enabled, we don't need this. You can use the inspector API to pause the script and get the stack trace. |
Makes sense.
I remember there was a similar discussion when we were talking about implementing a special option for |
I'm aware. This is specifically for the case where the inspector is not enabled. I got the idea while working on some python code that occasionally got stuck. Tapping ^C and getting a useful stack trace is just amazingly useful.
Yes, there are more reasons why a watchdog would be useful. |
I was replying to Joyee. I would really like to see a stack trace with ^C. |
Fixed now that #29207 has (finally!) landed. Congrats, @legendecas! |
It would be exceedingly nice for debugging non-responsive scripts if terminating the process with ^C / SIGINT prints a JS stack trace leading up to the currently executing code.
The use case is scripts stuck in (for example) infinite loops. Right now you don't really get an indication when that's happening except CPU usage in top.
It might be hard to pull off because signal handlers but maybe someone has a clever idea. My attempt at being clever:
isolate->RequestInterrupt()
when a signal is received.The text was updated successfully, but these errors were encountered: