Status: New
Owner: ----
New issue 2414 by [email protected]: Cannot TerminateExecution() on an
active debugged script
http://code.google.com/p/v8/issues/detail?id=2414
Hi,
I am embedding V8 3.14.5, I run the script in one thread,
and I have a second thread that will call V8::TerminateExecution(isolate)
when required.
If I enable the debug-agent, and connect to the running script via the
debugger, then the Terminate can trigger a complete crash.
What I expect: Call TerminateExecution(), the JS will cancel either
immediately, or after the next Step in the debugger.
What happens: Call TerminateExecution() (JS does not finish - it is paused
by the debugger). Click Step and this crash happens:
#
# Fatal error in ../src/api.cc, line 2325
# CHECK(!(isolate)->external_caught_exception()) failed
#
==== Stack trace ============================================
Security context: 0x15353d0586d9 <JS Object>#0#
1: /* anonymous */ [Script:2] (this=0x15353d0587f9 <JS Global
Object>#1#)
==== Details ================================================
[1]: /* anonymous */ [Script:2] (this=0x15353d0587f9 <JS Global Object>#1#)
{
// stack-allocated locals
var .result = 0x15353d004121 <undefined>
--------- s o u r c e c o d e ---------
print(invalues.read_num1());?debugger;?while(true) {?print('past
it');?}?newtable.write_num2( invalues.read_num1() * 2 );
-----------------------------------------
}
==== Key ============================================
#0# 0x15353d0586d9: 0x15353d0586d9 <JS Object>
#1# 0x15353d0587f9: 0x15353d0587f9 <JS Global Object>
=====================
gdb backtrace:
#0 v8::internal::OS::DebugBreak () at ../src/platform-linux.cc:415
#1 0x0000000002943f26 in v8::internal::OS::Abort ()
at ../src/platform-linux.cc:397
#2 0x00000000025b8a5c in V8_Fatal (file=0x380c482 "../src/api.cc",
line=2325, format=0x380ae38 "CHECK(%s) failed") at ../src/checks.cc:58
#3 0x0000000002572388 in v8::Value::ToString (this=0x7fffdc07cdc0)
at ../src/api.cc:2325
#4 0x00000000025d465b in v8::internal::Debugger::NotifyMessageHandler
(this=0x7fffdc03ff80, event=v8::Break, exec_state=...,
event_data=..., auto_continue=false) at ../src/debug.cc:3120
#5 0x00000000025d394a in v8::internal::Debugger::ProcessDebugEvent
(this=0x7fffdc03ff80, event=v8::Break, event_data=...,
auto_continue=false) at ../src/debug.cc:2874
#6 0x00000000025d3298 in v8::internal::Debugger::OnDebugBreak
(this=0x7fffdc03ff80, break_points_hit=..., auto_continue=false)
at ../src/debug.cc:2724
#7 0x00000000025fd7cb in v8::internal::Execution::ProcessDebugMessages
(debug_command_only=false) at ../src/execution.cc:915
#8 0x00000000025fd6c2 in v8::internal::Execution::DebugBreakHelper ()
at ../src/execution.cc:889
#9 0x00000000027c5a6e in v8::internal::Runtime_DebugBreak (args=...,
isolate=0x5020170) at ../src/runtime.cc:9904
I do not see any way to cancel the debugging via the second thread before
Terminating the execution, so the only work-around I can think of is to
simply never terminate a script which has debugging enabled.
thanks,
Paul
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev