My favorites | Sign in
v8
Project Home Downloads Wiki Issues Source Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2361: Ability to stop unrolling stack upon TerminateException()
3 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----
Cc:  danno@chromium.org, vegorov@chromium.org


Sign in to add a comment
 
Reported by andrew.m...@gmail.com, Oct 12, 2012
TerminateExecution() can be used to stop execution of a script stuck in an infinite loop. The way that TerminateExecution() is currently implemented means that the application embedding V8 can not call 'script->Run()' and decide to handle the termination and either throw a catchable exception or continue execution if there are still JS stack frames left to unwind.

Use case: In Node, there will always be more stack frames above the desired boundary because all of Node is itself implemented in JS. I desire to modify the 'vm.runIn*Context()' functions to take a timeout parameter and if the timeout expires, that 'vm.runIn*Context()' call should throw an exception, even though there will be other JS frames in the stack. The timeout is implemented using TerminateExecution(), which forces the entire stack to unwind, preventing the Node implementation from handling the termination correctly at the 'vm.runIn*Context()' boundary.

This was discussed here: https://gist.github.com/3879707

Feature Request: I desire the ability for the C++ code embedding the engine to completely handle TerminateExecution() at any 'script->Run()' boundary, even when there are remaining JS frames on the stack. The C++ code calling 'script->Run()' can swallow the termination at that point and continue calling into the engine.
Oct 15, 2012
Project Member #1 stefa...@chromium.org
(No comment was entered for this change.)
Cc: danno@chromium.org
Labels: Type-FeatureRequest
Oct 15, 2012
Project Member #2 stefa...@chromium.org
(No comment was entered for this change.)
Cc: vegorov@chromium.org
Sign in to add a comment

Powered by Google Project Hosting