nodejs / nodejs/node

Debugger crashes with assertion failure while using Chrome DevTools and remote debug

Ouverte
#17,259 21 commentaires 8 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

async_hooks inspector
Langage dominant
JavaScript
Étoiles
122k
Forks
37.4k
Merge moyen
4 j 3 h
PR mergées (30 j)
272

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
nodejscrash

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 build and configure a run configuration by adding Node.js Run Configuration and change JavaScript file to dist/server.js
  • Set breakpoint in src/controllers/user.ts Line 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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par reproduire le crash avec Node 8.9.1, WebStorm, Chrome DevTools et les étapes de TypeScript-Node-Starter indiquées dans l’issue. Lisez l’assertion dans src/node.cc au niveau de InternalCallbackScope::Close et suivez le chemin de la pile de NodeInspectorClient::runMessageLoopOnPause. C’est terminé lorsque le débogage à distance et Chrome DevTools ne font plus planter le processus Node.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, node.js
Domaine
backend, devtools
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.