Hello!
We're trying to upgrade the v8 runtime to 9.7 in NativeScript but ran into this issue when implementing the code for enabling the inspector console.
We receive the message and call
v8::debug::EvaluateGlobal with kDisableBreaksAndThrowOnSideEffect:
After that the thread hangs. Pausing the app shows the following stack trace:
syscall 0x00000073f171d35c
__futex_wait_ex(void volatile*, bool, int, bool, timespec const*) 0x00000073f1721984
pthread_cond_wait 0x00000073f1781b90
v8::internal::OptimizingCompileDispatcher::FlushQueues(v8::internal::BlockingBehavior, bool) 0x00000070cd85c348
v8::internal::OptimizingCompileDispatcher::Flush(v8::internal::BlockingBehavior) 0x00000070cd85c3b4
v8::internal::Debug::DeoptimizeFunction(v8::internal::Handle<v8::internal::SharedFunctionInfo>) 0x00000070cd576324
v8::internal::Runtime_DebugOnFunctionCall(int, unsigned long*, v8::internal::Isolate*) 0x00000070cd8f8b98
Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit 0x00000070cdb6856c
Builtins_CallFunction_ReceiverIsAny 0x00000070cdae25ec
Builtins_JSEntryTrampoline 0x00000070cdaebacc
Builtins_JSEntry 0x00000070cdaeb768
v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) 0x00000070cd60b6d4
v8::internal::Execution::CallScript(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::FixedArray>) 0x00000070cd60b9d4
v8::internal::DebugEvaluate::Global(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::debug::EvaluateGlobalMode, v8::internal::REPLMode) 0x00000070cd56926c
v8::internal::DebugEvaluate::Global(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::debug::EvaluateGlobalMode, v8::internal::REPLMode) 0x00000070cd569080
v8::debug::EvaluateGlobal(v8::Isolate*, v8::Local<v8::String>, v8::debug::EvaluateGlobalMode, bool) 0x00000070cd566580
v8_inspector::V8RuntimeAgentImpl::evaluate(v8_inspector::String16 const&, v8_crdtp::detail::ValueMaybe<v8_inspector::String16>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<int>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<double>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<v8_inspector::String16>, std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::Backend::EvaluateCallback, std::__Cr::default_delete<v8_inspector::protocol::Runtime::Backend::EvaluateCallback> >) v8-runtime-agent-impl.cc:309
v8_inspector::protocol::Runtime::DomainDispatcherImpl::evaluate(v8_crdtp::Dispatchable const&) Runtime.cpp:961
v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69::operator()(v8_crdtp::Dispatchable const&) const Runtime.cpp:635
decltype(std::__Cr::forward<v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69&>(fp)(std::__Cr::forward<v8_crdtp::Dispatchable const&>(fp0))) std::__Cr::__invoke<v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69&, v8_crdtp::Dispatchable const&>(v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69&, v8_crdtp::Dispatchable const&) type_traits:3694
void std::__Cr::__invoke_void_return_wrapper<void, true>::__call<v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69&, v8_crdtp::Dispatchable const&>(v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69&, v8_crdtp::Dispatchable const&) __functional_base:348
std::__Cr::__function::__default_alloc_func<v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69, void (v8_crdtp::Dispatchable const&)>::operator()(v8_crdtp::Dispatchable const&) functional:1611
void std::__Cr::__function::__policy_invoker<void (v8_crdtp::Dispatchable const&)>::__call_impl<std::__Cr::__function::__default_alloc_func<v8_inspector::protocol::Runtime::DomainDispatcherImpl::Dispatch(v8_crdtp::span<unsigned char>)::$_69, void (v8_crdtp::Dispatchable const&)> >(std::__Cr::__function::__policy_storage const*, v8_crdtp::Dispatchable const&) functional:2092
v8_crdtp::UberDispatcher::DispatchResult::Run() 0x00000070cd1e2954
v8_inspector::V8InspectorSessionImpl::dispatchProtocolMessage(v8_inspector::StringView) v8-inspector-session-impl.cc:454
tns::JsV8InspectorClient::doDispatchMessage(v8::Isolate*, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&) JsV8InspectorClient.cpp:131
tns::JsV8InspectorClient::dispatchMessage(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&) JsV8InspectorClient.cpp:89
::Java_com_tns_AndroidJsV8Inspector_dispatchMessage(JNIEnv *, jobject, jstring) com_tns_AndroidJsV8Inspector.cpp:29
art_quick_generic_jni_trampoline 0x00000071422d9a48
art_quick_invoke_stub 0x00000071422d0168
art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*) 0x00000071422f47c8
bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007142417a20
void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*) 0x000000714221660c
ExecuteSwitchImplAsm 0x00000071422dc3dc
art::interpreter::ExecuteSwitch(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) (.llvm.6649268296134209133) 0x0000007142545d58
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6649268296134209133) 0x000000714227e2f0
art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*) 0x00000071423851d4
bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007142417c98
void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*) 0x00000071422166a0
ExecuteSwitchImplAsm 0x00000071422dc3dc
art::interpreter::ExecuteSwitch(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) (.llvm.6649268296134209133) 0x0000007142545d58
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6649268296134209133) 0x000000714227e2f0
art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*) 0x00000071423851d4
bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007142417c98
void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*) 0x0000007142210704
ExecuteSwitchImplAsm 0x00000071422dc3dc
art::interpreter::ExecuteSwitch(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) (.llvm.6649268296134209133) 0x0000007142545d58
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6649268296134209133) 0x000000714227e2f0
art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*) 0x00000071423851d4
bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007142417c98
void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*) 0x000000714221660c
ExecuteSwitchImplAsm 0x00000071422dc3dc
art::interpreter::ExecuteSwitch(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) (.llvm.6649268296134209133) 0x0000007142545d58
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6649268296134209133) 0x000000714227e2f0
art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*) 0x00000071423851d4
bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007142417c98
void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*) 0x0000007142210704
ExecuteSwitchImplAsm 0x00000071422dc3dc
MterpInvokeStatic 0x0000007142775dc0
mterp_op_invoke_static 0x00000071422caa18
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6649268296134209133) 0x000000714227dd78
artQuickToInterpreterBridge 0x000000714227cf20
art_quick_to_interpreter_bridge 0x00000071422d9b7c
<unknown> 0x00000071422d9d90
I believe the code is hanging on this line exactly:
but I can't find out why. Checking the other threads it doesn't seem there are any v8 calls hanging. If we switch to kDisableBreaks or kDefault then the app doesn't hang anymore, but the behavior still isn't correct.
Any insight would be greatly appreciated! Thanks