Hi Ravi, would you provide a reduced test case that reproduces this issue? Without that I can only guess. Exception termination takes place by throwing uncatchable exceptions. However, when terminating execution we have to return control to C++ frames on the stack. When that happens the embedder should return out of C++ back to JavaScript until there are no more JavaScript frames on the stack.
Thanks, -- Mads On Sat, Apr 16, 2011 at 12:54 PM, Chinnu <[email protected]> wrote: > Hi, > > I've been trying to come up with a way to terminate the V8 execution > on a script if it runs too long. > > For this, I've used the Locker::StartPreemption() and on receiving a > preemption (in RuntimePreempt() method in execution.cc), am > incrementing a count and invoking > V8::TerminateExecution(current_thread_id) if the count exceeds a > limit. > > However, the use of V8::TerminateExecution(current_thread_id) at that > point is causing a crash probably due to a stack corruption. I was > wondering if this isn't an appropriate place to use this API, and if > this API is supposed to be invoked in a specific way. > > Please let me know if there is a proper way to use the > V8::TerminateExecution() API. > > Thanks, > Ravi > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
