Skip to content

Node fatal error: ToggleAsyncHook Cannot toggle Inspector's AsyncHook #27261

Closed
@edopalmieri

Description

@edopalmieri
  • Version:
    Versions I have tested in which the fatal error occurs: 11.14.x, 11.13.x, 11.12.x, 11.11.x, 11.10.x
    Version under which the error does not occur: 10.15.3

  • Platform:
    18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64

  • Subsystem:
    Occurs when using the worker_threads module. The fatal error occurs under the worker thread, but as a consequence the whole node process is taken down.

I have a node application that uses multithreading (worker_threads module) to handle some CPU intensive tasks that are triggered by requests over websockets. The main thread handles the ws traffic and creates worker threads to handle the tasks required by the ws request. The worker thread performs the task and returns a result to the main thread. Whenever running this application with versions 11.x I get the error below. The application works without issues when run ontop of Node version 10.15.3 with the experimental flag set.

I have already mentioned this in a comment to:
#26798

undefined:0



illegal access
FATAL ERROR: 
node::inspector::Agent::ToggleAsyncHook Cannot toggle Inspector's AsyncHook, please report this.
 1: 0x100069ede node::Abort() [/usr/local/bin/node]
2: 0x10006a62e node::errors::TryCatchScope::~TryCatchScope() [/usr/local/bin/node]
2019-04-16T14:20:09.280Z Peer ::ffff:127.0.0.1 disconnected.
 3: 0x10006a4c0 node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 4: 0x10010290f node::inspector::Agent::ToggleAsyncHook(v8::Isolate*, v8::Persistent<v8::Function, node::ResetInDestructorPersistentTraits<v8::Function> > const&) [/usr/local/bin/node]
 5: 0x100178063 v8_inspector::V8Debugger::setAsyncCallStackDepth(v8_inspector::V8DebuggerAgentImpl*, int) [/usr/local/bin/node]
 6: 0x100180747 v8_inspector::V8DebuggerAgentImpl::disable() [/usr/local/bin/node]
 7: 0x100199093 v8_inspector::V8InspectorSessionImpl::~V8InspectorSessionImpl() [/usr/local/bin/node]
 8: 0x10019933e v8_inspector::V8InspectorSessionImpl::~V8InspectorSessionImpl() [/usr/local/bin/node]
 9: 0x100103454 node::inspector::(anonymous namespace)::ChannelImpl::~ChannelImpl() [/usr/local/bin/node]
10: 0x1001034ae node::inspector::(anonymous namespace)::ChannelImpl::~ChannelImpl() [/usr/local/bin/node]
11: 0x100103892 node::inspector::NodeInspectorClient::disconnectFrontend(int) [/usr/local/bin/node]
12: 0x1001036c9 node::inspector::(anonymous namespace)::SameThreadInspectorSession::~SameThreadInspectorSession() [/usr/local/bin/node]
13: 0x1001036f6 node::inspector::(anonymous namespace)::SameThreadInspectorSession::~SameThreadInspectorSession() [/usr/local/bin/node]
14: 0x100110214 node::inspector::(anonymous namespace)::DeletableWrapper<node::inspector::(anonymous namespace)::MainThreadSessionState>::~DeletableWrapper() [/usr/local/bin/node]
15: 0x100110238 node::inspector::(anonymous namespace)::DeletableWrapper<node::inspector::(anonymous namespace)::MainThreadSessionState>::~DeletableWrapper() [/usr/local/bin/node]
16: 0x100111363 std::__1::__hash_table<std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > >, std::__1::__unordered_map_hasher<int, std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > >, std::__1::hash<int>, true>, std::__1::__unordered_map_equal<int, std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > >, std::__1::equal_to<int>, true>, std::__1::allocator<std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > > > >::erase(std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > >, void*>*>) [/usr/local/bin/node]
17: 0x10011128a unsigned long std::__1::__hash_table<std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > >, std::__1::__unordered_map_hasher<int, std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > >, std::__1::hash<int>, true>, std::__1::__unordered_map_equal<int, std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > >, std::__1::equal_to<int>, true>, std::__1::allocator<std::__1::__hash_value_type<int, std::__1::unique_ptr<node::inspector::Deletable, std::__1::default_delete<node::inspector::Deletable> > > > >::__erase_unique<int>(int const&) [/usr/local/bin/node]
18: 0x10010f811 node::inspector::MainThreadInterface::RemoveObject(int) [/usr/local/bin/node]
19: 0x10010f415 node::inspector::MainThreadInterface::DispatchMessages() [/usr/local/bin/node]
20: 0x1000c0e1a node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/usr/local/bin/node]
21: 0x1000c039a node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/usr/local/bin/node]
22: 0x1000c127b node::NodePlatform::FlushForegroundTasks(v8::Isolate*) [/usr/local/bin/node]
23: 0x100102f1d node::inspector::NodeInspectorClient::runMessageLoop() [/usr/local/bin/node]
24: 0x1000da81a std::__1::__function::__func<node::worker::Worker::Run()::$_0, std::__1::allocator<node::worker::Worker::Run()::$_0>, void ()>::operator()() [/usr/local/bin/node]
25: 0x100081149 node::OnScopeLeave::~OnScopeLeave() [/usr/local/bin/node]
26: 0x1000d7f8b node::worker::Worker::Run() [/usr/local/bin/node]
27: 0x1000d9e73 node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_2::__invoke(void*) [/usr/local/bin/node]
28: 0x7fff5e9912eb _pthread_body [/usr/lib/system/libsystem_pthread.dylib]
29: 0x7fff5e994249 _pthread_start [/usr/lib/system/libsystem_pthread.dylib]
30: 0x7fff5e99040d thread_start [/usr/lib/system/libsystem_pthread.dylib]

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

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