Repository navigation
Debugger crashes with assertion failure while using Chrome DevTools and remote debug #17259
Copy link
Copy link
Open
Labels
async_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.staleIssues 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.
Description
- Version:
8.9.1 LTS - Platform:
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.
/usr/local/bin/node[28426]: ../src/node.cc:1449:void node::InternalCallbackScope::Close(): Assertion `(env_->trigger_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::RunForegroundTask(v8::Task*) [/usr/local/bin/node]
6: node::NodePlatform::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: 0x2fb5b0f842fd
13: 0x2fb5b108876c
14: 0x2fb5b103d1e0
Reproduce:
- Clone Demo Project: https://github.com/Microsoft/TypeScript-Node-Starter/
- Install mongodb via homebrew
- Start mongodb via
mongod --config /usr/local/etc/mongod.conf - Open demo project in Webstorm,
npm run buildand configure a run configuration by addingNode.jsRun Configuration and changeJavaScript filetodist/server.js - Set breakpoint in
src/controllers/user.tsLine 30 - Start debugger with the Bug icon, right next to the run icon in Webstorm
- Open client site in Chrome
http://localhost:3000 - Use the client site to trigger breakpoint (logged in as user)
- Resume by clicking
Step Out - Use the client site to trigger breakpoint again (logged in as user)
- Chrome: Right-click, Inspect
- Debugger crashes as shown
For me, this crash is only reproducible on one of three Mac systems with identical software versions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
async_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.staleIssues 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.

Activity
addaleax commentedon Nov 22, 2017
Do you have a reproduction for this?
SamuelSchepp commentedon Nov 22, 2017
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.
SamuelSchepp commentedon Nov 23, 2017
It crashes by using Step-Out instead of Resume.
AndreasMadsen commentedon Nov 28, 2017
@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.jsoref commentedon Nov 30, 2017
I'm pretty sure I'm hitting this using node9.2.0 (prebuilt) on Ubuntu 16.04.3 w/ Chrome DevTools running on macOS:
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...
johntiger1 commentedon Jan 7, 2018
I had an issue in Webstorm with this while trying to debug a basic Nodejs app but fixed it. Not sure if this will help anyone else, but pretty much I was misunderstanding how to use their Javascript debugging. I had to use the Before Launch area instead of the browser/live edit portion

nazar-pc commentedon May 24, 2018
The same happens for me with Node.js 10.1.0 on Ubuntu 18.10:
The 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.chris-asl commentedon Jan 24, 2019
Same thing happens for me.
When adding a breakpoint, specifically in the
connectevent handler of thesimple-peerlibrary (using thenode-webrtclib), the debugger crashes: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:
npm installnpm run testchrome://inspectand click on the related entryjosephg commentedon Jan 30, 2019
I'm getting the same issue using node v10.14.1 and node v11.8.0 on macos 10.14.2.
nikes commentedon Mar 6, 2019
Node v10.15.1 on Debain 9.5
asad-rauf-khan commentedon Aug 22, 2019
Happening 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: 0x13f344bbedb62 remaining items
dislon commentedon Sep 4, 2020
Node v12.14.1 on Linux 4.9.186
macrozone commentedon Jan 29, 2021
i 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
doronrk commentedon Feb 2, 2021
@macrozone You're not running a meteor app having just upgraded to 2.0 by any chance, are you?
We're experiencing this.
doronrk commentedon Feb 2, 2021
@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 commentedon Feb 2, 2021
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=falsebengl commentedon Feb 3, 2021
Hi 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!
jasnell commentedon Apr 26, 2021
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 commentedon Jul 20, 2026
This 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.
dislon commentedon Jul 20, 2026
github-actions commentedon Oct 20, 2026
This 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.
dislon commentedon Oct 20, 2026