Skip to content
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

Signals handling [WIP] #2621

Closed
wants to merge 7 commits into from
Closed

Signals handling [WIP] #2621

wants to merge 7 commits into from

Conversation

mhvsa
Copy link
Contributor

@mhvsa mhvsa commented Jul 8, 2019

I attempted to fix #1725.

For a good starting point, I choose to put ctrl-c signal stream in core/Isolate.rs and then I just tried to print something when a signal is captured, and to print something else otherwise - and that worked. Later I tried to just throw error in isolate when in case of ctrl-c signal and it produces an error

...
hello
...
...
^C

#
# Fatal error in ../../third_party/v8/src/isolate.h, line 516
# Debug check failed: (isolate) != nullptr.
#
#
#
#FailureMessage Object: 0x7f351b3ced00
==== C stack trace ===============================
    ./target/debug/deno(+0x425b393) [0x559c832e3393]
...

so it seems like isolate is gone while method deno_print_stack_trace(Deno * d_) is called. I tested it with very simple script setInterval(()=>console.log("hello"), 1000);

I don't have an idea how to fix that. Anyone has?

@kevinkassimo
Copy link
Contributor

I'm not quite sure if this would be a good approach to deal with general signals... (maybe just SIGINT would be fine, but does not solve for others)
My original thought was to implement something that gets polled along with other ops but does not prevent the Isolate future from complete (my private experiment months ago showed that this is implementable). Signal handlers could be this kind of op, and their tasks could be saved onto some table and got notified on signal and thus resolving a TS side promise. The TS side keeps creating such promises.

@mhvsa mhvsa closed this Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

print JS stack unexpected signal like ctrl+c
3 participants