Skip to content

Fatal Error when attaching debugger when certain node modules are loaded #17496

@BasKiers

Description

@BasKiers
  • Version: v8.9.2
  • Platform: Darwin MacBook-Pro.local 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64
  • Subsystem:

In a (quite large) project I had trouble attaching the debugger when starting the inspector from code (by using the inspector module). Right after connecting I receive a fatal error from nodejs. Now I've isolated the crash as much as I could to the i18next module so it can be reproduced. However this is not the only source of this crash since commenting this out will also produce this crash when the inspector is started in a later stage of the code (after other modules are required).

The crash is the following:

FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope
 1: node::Abort() [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 4: v8::internal::HandleScope::Extend(v8::internal::Isolate*) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 5: v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 6: node::inspector::Agent::EnableAsyncHook() [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 7: v8_inspector::V8Debugger::setAsyncCallStackDepth(v8_inspector::V8DebuggerAgentImpl*, int) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 8: v8_inspector::V8DebuggerAgentImpl::setAsyncCallStackDepth(int) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
 9: v8_inspector::protocol::Debugger::DispatcherImpl::setAsyncCallStackDepth(int, std::__1::unique_ptr<v8_inspector::protocol::DictionaryValue, std::__1::default_delete<v8_inspector::protocol::DictionaryValue> >, v8_inspector::protocol::ErrorSupport*) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
10: v8_inspector::protocol::Debugger::DispatcherImpl::dispatch(int, v8_inspector::String16 const&, std::__1::unique_ptr<v8_inspector::protocol::DictionaryValue, std::__1::default_delete<v8_inspector::protocol::DictionaryValue> >) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
11: v8_inspector::protocol::UberDispatcher::dispatch(std::__1::unique_ptr<v8_inspector::protocol::Value, std::__1::default_delete<v8_inspector::protocol::Value> >) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
12: v8_inspector::V8InspectorSessionImpl::dispatchProtocolMessage(v8_inspector::StringView const&) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
13: node::inspector::InspectorIo::DispatchMessages() [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
14: uv__async_io [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
15: uv__io_poll [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
16: uv_run [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
17: node::Start(v8::Isolate*, node::IsolateData*, int, char const* const*, int, char const* const*) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
18: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
19: node::Start(int, char**) [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
20: start [/Users/[user]/.nvm/versions/node/v8.9.2/bin/node]
21: 0x2

I've created a repository to enable reproducing the crash here: https://github.com/athombv/node-inspector-createhandle-crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions