Repository navigation
Debugger crashes with assertion failure while using Chrome DevTools and remote debug #17259
Description
Activity
- addedasync_hooksIssues and PRs related to the async hooks subsystem.Issues and PRs related to the async hooks subsystem.inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.
on Nov 22, 2017 Do you have a reproduction for this?
I added a reproduction instruction, but I am only able to reproduce this on one of three computers and only while using Webstorm 2017.2.5. Webstorm 2017.1.4 seems to work fine.
It crashes by using Step-Out instead of Resume.
@SamuelSchepp do you have async stack traces enabled for the debugging?
Could you try running your application without inspector/WebStorm but add the
--force-async-hooks-checksoption tonode.
In
8.9.1we haveasync_hookschecks disabled by default. By usingasync_hooksthey are enabled.async stack tracesin inspector uses theasync_hooksfeature.I'm pretty sure I'm hitting this using node9.2.0 (prebuilt) on Ubuntu 16.04.3 w/ Chrome DevTools running on macOS:
(nodeenv-prebuilt-9.2.0)npm@ubuntu160403:~$ node --inspect-brk --inspect-port=7999 /var/cache/npm/node_modules/npm-proxy-cache/bin/npm-proxy-cache -e -h proxy -p 8000 Debugger listening on ws://127.0.0.1:7999/41b5c599-90ab-4930-9ede-10f4979e38ec For help see https://nodejs.org/en/docs/inspector Debugger attached. [2017-11-23 17:19:02.003] [INFO] proxy - Listening on proxy:8000 [31014] /var/cache/npm/nodeenv-prebuilt-9.2.0/bin/node[31014]: ../src/node.cc:1449:void node::InternalCallbackScope::Close(): Assertion `(env_->trigger_async_id()) == (0)' failed. 1: node::Abort() [node] 2: node::Assert(char const* const (*) [4]) [node] 3: node::InternalCallbackScope::~InternalCallbackScope() [node] 4: node::NodePlatform::FlushForegroundTasksInternal() [node] 5: node::inspector::NodeInspectorClient::runMessageLoopOnPause(int) [node] 6: v8_inspector::V8Debugger::BreakProgramRequested(v8::Local<v8::Context>, v8::Local<v8::Object>, v8::Local<v8::Value>, std::vector<int, std::allocator<int> > const&) [node] 7: v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) [node] 8: v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode) [node] 9: v8::internal::StackGuard::HandleInterrupts() [node] 10: v8::internal::Runtime_StackGuard(int, v8::internal::Object**, v8::internal::Isolate*) [node] 11: 0x320b44d842fd Aborted (core dumped)
Initially I was able to debug, it started after I had set breakpoints, changed the nodejs code (to instrument buggy code in
/var/cache/npm/node_modules/npm-proxy-cache/lib/cache.js) and then it reattached...
Sadly, it isn't crashing right now...The same happens for me with Node.js 10.1.0 on Ubuntu 18.10:
node[16462]: ../src/node.cc:983:void node::InternalCallbackScope::Close(): Assertion `(env_->execution_async_id()) == (0)' failed. 1: node::Abort() [node] 2: 0x876c55 [node] 3: node::InternalCallbackScope::Close() [node] 4: node::InternalCallbackScope::~InternalCallbackScope() [node] 5: node::PerIsolatePlatformData::FlushForegroundTasksInternal() [node] 6: node::NodePlatform::FlushForegroundTasks(v8::Isolate*) [node] 7: node::inspector::NodeInspectorClient::runMessageLoopOnPause(int) [node] 8: v8_inspector::V8Debugger::BreakProgramRequested(v8::Local<v8::Context>, v8::Local<v8::Object>, std::vector<int, std::allocator<int> > const&) [node] 9: v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) [node] 10: v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode) [node] 11: v8::internal::Runtime_HandleDebuggerStatement(int, v8::internal::Object**, v8::internal::Isolate*) [node] 12: 0x26b33618427dThe issue happens when I add
debuggerstatement in some async callbacks. This is probably related to native nodulenode-webrtcthat I have installed. It doesn't happen in other cases though. Makes it very hard to debug, need to add a bunch ofconsole.loginstead.Reacted by Chris Aslanoglou and Petr TripolskyReacted by Petr TripolskySame thing happens for me.
When adding a breakpoint, specifically in theconnectevent handler of thesimple-peerlibrary (using thenode-webrtclib), the debugger crashes:/Users/chris/.nvm/versions/node/v8.15.0/bin/node[47518]: ../src/node.cc:1411:void node::InternalCallbackScope::Close(): Assertion `(env_->execution_async_id()) == (0)' failed. 1: node::Abort() [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 2: node::(anonymous namespace)::DomainEnter(node::Environment*, v8::Local<v8::Object>) [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 3: node::InternalCallbackScope::Close() [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 4: node::InternalCallbackScope::~InternalCallbackScope() [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 5: node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 6: node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 7: node::inspector::NodeInspectorClient::runMessageLoopOnPause(int) [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 8: v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int> > const&, bool, bool) [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 9: v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 10: v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode) [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 11: v8::internal::Runtime_HandleDebuggerStatement(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/chris/.nvm/versions/node/v8.15.0/bin/node] 12: 0x2f72c52842fd [1] 47516 abort npm run test- Platform: Ubuntu 16.04 and MacOS 10.14.2
- Node: 8.15.0
Here you can find an MCVE https://gist.github.com/chris-asl/24f2829f460e11012a12eb13bf3fb688 as a git repo (there's also a link to a core dump from Ubuntu).
Follow the steps bellow to reproduce:
- Download/clone
npm installnpm run test- open
chrome://inspectand click on the related entry - Node crashes at the terminal.
I'm getting the same issue using node v10.14.1 and node v11.8.0 on macos 10.14.2.
$ npx node --inspect-brk -r ts-node/register lib/main.ts Debugger listening on ws://127.0.0.1:9229/e305ce0d-1c0b-47bb-9485-02e1533180e9 For help, see: https://nodejs.org/en/docs/inspector Debugger attached. node[17580]: ../src/callback_scope.cc:110:void node::InternalCallbackScope::Close(): Assertion `(env_->execution_async_id()) == (0)' failed. 1: 0x10003ae75 node::Abort() [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 2: 0x100039ed3 node::AddEnvironmentCleanupHook(v8::Isolate*, void (*)(void*), void*) [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 3: 0x100010fe9 node::InternalCallbackScope::Close() [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 4: 0x100010aa2 node::InternalCallbackScope::~InternalCallbackScope() [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 5: 0x1000b1a10 node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 6: 0x1000b13aa node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 7: 0x1000b1daf node::NodePlatform::FlushForegroundTasks(v8::Isolate*) [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 8: 0x1000faf59 node::inspector::NodeInspectorClient::runMessageLoop() [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 9: 0x10016c8f3 v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int> > const&, bool, bool) [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 10: 0x1004ba2c8 v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 11: 0x1004c0398 v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode) [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 12: 0x1007ae49c v8::internal::Runtime_HandleDebuggerStatement(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/josephg/.nvm/versions/node/v10.14.1/bin/node] 13: 0xcb52715be3dNode v10.15.1 on Debain 9.5
/usr/bin/node[11855]: ../src/callback_scope.cc:110:void node::InternalCallbackScope::Close(): Assertion `(env_->execution_async_id()) == (0)' failed. 1: 0x8db900 node::Abort() [/usr/bin/node] 2: 0x8db9d5 [/usr/bin/node] 3: 0x8abb79 [/usr/bin/node] 4: 0x9634dd node::PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<v8::Task, std::default_delete<v8::Task> >) [/usr/bin/node] 5: 0x964892 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/usr/bin/node] 6: 0x9651b8 node::NodePlatform::FlushForegroundTasks(v8::Isolate*) [/usr/bin/node] 7: 0x9cad95 node::inspector::NodeInspectorClient::runMessageLoopOnPause(int) [/usr/bin/node] 8: 0xa87860 v8_inspector::V8Debugger::BreakProgramRequested(v8::Local<v8::Context>, v8::Local<v8::Object>, std::vector<int, std::allocator<int> > const&) [/usr/bin/node] 9: 0xe1d7b2 v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) [/usr/bin/node] 10: 0xe1dbf5 v8::internal::Debug::Break(v8::internal::JavaScriptFrame*, v8::internal::Handle<v8::internal::JSFunction>) [/usr/bin/node] 11: 0x1121343 v8::internal::Runtime_DebugBreakOnBytecode(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node] 12: 0x9c59ca5c67dHappening for me as well.
Node: v8.14.0 on MacOS/usr/local/bin/node[17221]: ../src/node.cc:1409:void node::InternalCallbackScope::Close(): Assertion (env_->execution_async_id()) == (0)' failed. 1: node::Abort() [/usr/local/bin/node] 2: node::(anonymous namespace)::DomainEnter(node::Environment*, v8::Local<v8::Object>) [/usr/local/bin/node] 3: node::InternalCallbackScope::Close() [/usr/local/bin/node] 4: node::InternalCallbackScope::~InternalCallbackScope() [/usr/local/bin/node] 5: node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/usr/local/bin/node] 6: node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/usr/local/bin/node] 7: node::inspector::NodeInspectorClient::runMessageLoopOnPause(int) [/usr/local/bin/node] 8: v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int> > const&, bool, bool) [/usr/local/bin/node] 9: v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) [/usr/local/bin/node] 10: v8::internal::Debug::Break(v8::internal::JavaScriptFrame*) [/usr/local/bin/node] 11: v8::internal::Runtime_DebugBreakOnBytecode(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node] 12: 0x13f344b042fd 13: 0x13f344c0a28c 14: 0x13f344bbedb6 15: 0x13f344bbedb6Node: v12.18.3 on Debian 10.5
[SERVER]: /home/jakutis/.nvm/versions/node/v12.18.3/bin/node[28406]: ../src/api/callback.cc:123:void node::InternalCallbackScope::Close(): Assertion `(env_->execution_async_id()) == (0)' failed. [SERVER]: 1: 0xa093f0 node::Abort() [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 2: 0xa0946e [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 3: 0x97b2fb node::InternalCallbackScope::~InternalCallbackScope() [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 4: 0xa7723d node::PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<v8::Task, std::default_delete<v8::Task> >) [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 5: 0xa77cb5 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 6: 0xa79878 node::NodePlatform::FlushForegroundTasks(v8::Isolate*) [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 7: 0xb03780 node::inspector::NodeInspectorClient::runMessageLoopOnPause(int) [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 8: 0x11f51d5 v8_inspector::V8Debugger::BreakProgramRequested(v8::Local<v8::Context>, std::vector<int, std::allocator<int> > const&) [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 9: 0xca35f2 v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 10: 0xca370e v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode) [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 11: 0x1037eda v8::internal::Runtime_HandleDebuggerStatement(int, unsigned long*, v8::internal::Isolate*) [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node] [SERVER]: 12: 0x13cf019 [/home/jakutis/.nvm/versions/node/v12.18.3/bin/node]Node v12.14.1 on Linux 4.9.186
0 0x0000007faeff4c88 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55 1 0x0000007faeff6068 in __GI_abort () at abort.c:89 2 0x0000007faf6b4710 in node::Abort () at third_party/node/src/node_errors.cc:321 3 0x0000007faf6b3c84 in node::Assert (info=...) at third_party/node/src/node_errors.cc:337 4 0x0000007faf5dba5c in node::InternalCallbackScope::Close (this=0x7fec6fa5e0) at third_party/node/src/api/callback.cc:110 5 0x0000007faf5db888 in node::InternalCallbackScope::~InternalCallbackScope (this=0x7fec6fa5e0) at third_party/node/src/api/callback.cc:75 6 0x0000007faf71a6cc in node::PerIsolatePlatformData::RunForegroundTask (task=...) at third_party/node/src/node_platform.cc:375 7 0x0000007faf719104 in node::PerIsolatePlatformData::FlushForegroundTasksInternal (this=<optimized out>) at third_party/node/src/node_platform.cc:439 8 0x0000007faf71ac34 in node::NodePlatform::FlushForegroundTasks (this=<optimized out>, isolate=<optimized out>) at third_party/node/src/node_platform.cc:464 9 0x0000007faf63dee0 in node::inspector::NodeInspectorClient::runMessageLoop (this=0x353d618) at third_party/node/src/inspector_agent.cc:710 10 node::inspector::NodeInspectorClient::runMessageLoopOnPause (this=0x353d618, context_group_id=<optimized out>) at third_party/node/src/inspector_agent.cc:476 11 0x0000007faea35658 in v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int> > const&, v8::debug::ExceptionType, bool) () from /usr/lib64/libv8.so 12 0x0000007fae5165e4 in v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::FixedArray>) () from /usr/lib64/libv8.so 13 0x0000007fae515b00 in v8::internal::Debug::Break(v8::internal::JavaScriptFrame*, v8::internal::Handle<v8::internal::JSFunction>) () from /usr/lib64/libv8.so 14 0x0000007fae8120fc in v8::internal::Runtime_DebugBreakOnBytecode(int, unsigned long*, v8::internal::Isolate*) () from /usr/lib64/libv8.so 15 0x0000007faece484c in Builtins_CEntry_Return2_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit () from /usr/lib64/libv8.soi get a very similar stacktrace on node 12.20.1, but its not related to
--inspect, it happens on a production build. We updated some deps so we are unsure where it is coming from.but i wanted to share it because the stack trace looks similar
node-process-name[1]: ../src/api/callback.cc:123:void node::InternalCallbackScope::Close(): Assertion `(env_->execution_async_id()) == (0)' failed. 0xa18150 node::Abort() [node-process-name] 0xa181ce [node-process-name] 0x984625 node::InternalCallbackScope::~InternalCallbackScope() [node-process-name] 0x9b9dfe node::Environment::RunAndClearNativeImmediates(bool) [node-process-name] 0x9ba242 node::Environment::CheckImmediate(uv_check_s*) [node-process-name] 0x1378b1c [node-process-name] 0x137100f uv_run [node-process-name] 0xa5b336 node::NodeMainInstance::Run() [node-process-name] 0x9e8a3c node::Start(int, char**) [node-process-name] 0x7f5ef1dcb2e1 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6] 0x981d35 [node-process-name]Reacted by Doron Roberts-Kedes@macrozone You're not running a meteor app having just upgraded to 2.0 by any chance, are you?
We're experiencing this.
@macrozone Not sure if you're using
dd-tracefrom datadog, but I've narrowing in on that as my main suspect.DD_TRACE_ENABLED=falsecauses the issue to go away for us.@macrozone Not sure if you're using
dd-tracefrom datadog, but I've narrowing in on that as my main suspect.DD_TRACE_ENABLED=falsecauses the issue to go away for us.yeah! we indeed had the exact same problem and figured it out yesterday 🤦♂️
we updated to meteor 2.0 and use datadog and fixed it by setting
DD_TRACE_ENABLED=falseHi folks! If you're running into this while using Meteor and
dd-trace, please see this comment which explains a workaround so that you can keep tracing enabled.If anyone is able to provide a reproduction case, that would be fantastic. Please let us know on that thread. Thanks!
Given that this seems to still be an issue that isn't limited to v10.x, and given that v10.x is reaching end of life, I'm removing the v10.x label.
github-actions commented
on Jul 20, 2026 on Jul 20, 2026 – with GitHub ActionsContributorMore actionsThis issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jul 20, 2026 - 您的邮件已收到,我会尽快处理!祝您身体健康,工作顺利!
- removedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jul 21, 2026

8.9.1 LTS
macOS 10.13.1 (17B48) (Darwin Kernel Version 17.2.0)
Webstorm 2017.2.5
Chrome: 62.0.3202.94
No crash using Webstorm 2017.1.4
While using the Chrome DevTools and node --inspect, the node process crashes right after Chrome auto-detected the debug session as a network target.
Reproduce:
mongod --config /usr/local/etc/mongod.confnpm run buildand configure a run configuration by addingNode.jsRun Configuration and changeJavaScript filetodist/server.jssrc/controllers/user.tsLine 30http://localhost:3000Step OutFor me, this crash is only reproducible on one of three Mac systems with identical software versions.