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

Forcible isolate termination: odd v8 behaviour #17

Open
paddybyers opened this issue Nov 12, 2011 · 0 comments
Open

Forcible isolate termination: odd v8 behaviour #17

paddybyers opened this issue Nov 12, 2011 · 0 comments

Comments

@paddybyers
Copy link
Owner

This commit:

1f7df3b

addresses an issue if a sub-script (run by runInNewContext()) is forcibly terminated (via node::Isolate::Stop()).

The root cause is this:

Isolate::PropagatePendingExceptionToExternalTryCatch()
...
  } else if (thread_local_top_.pending_exception_ ==
             heap()->termination_exception()) {
    try_catch_handler()->can_continue_ = false;
    try_catch_handler()->exception_ = heap()->null_value();
...

So .. when a TerminationException is delivered to an executing sub-script, the innermost TryCatch (which is in EvalMachine()) knows that the exception can't be caught, but the exception value itself is not copied. So, when that TryCatch is rethrown, the next TryCatch up the stack has no idea that it's a TerminationException, and happily just propagates a normal exception with null value.

I don't understand why v8 thinks this is the right thing to do. However, we can deal with it in node.

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

No branches or pull requests

1 participant