Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Node crash when agent is concurrently enabled with inspect #356

Closed
ofrobots opened this issue Nov 4, 2017 · 6 comments
Closed

Node crash when agent is concurrently enabled with inspect #356

ofrobots opened this issue Nov 4, 2017 · 6 comments
Assignees
Labels
api: clouddebugger Issues related to the googleapis/cloud-debug-nodejs API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@ofrobots
Copy link
Contributor

ofrobots commented Nov 4, 2017

GCLOUD_USE_INSPECTOR=1 node --inspect log.js

Where log.js is a simple express app with this at the top:

const debug = require('@google-cloud/debug-agent').start({
  projectId: 'some project id'
});

Node crashes when DevTools connects.

/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node[32991]: ../src/inspector_agent.cc:346:void node::inspector::NodeInspectorClient::connectFrontend(node::inspector::InspectorSessionDelegate*): Assertion `(channel_) == (nullptr)' failed.
 1: node::Abort() [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 2: node::(anonymous namespace)::DomainEnter(node::Environment*, v8::Local<v8::Object>) [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 3: node::inspector::NodeInspectorClient::FatalException(v8::Local<v8::Value>, v8::Local<v8::Message>) [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 4: node::inspector::InspectorIo::DispatchMessages() [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 5: node::RunForegroundTask(v8::Task*) [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 6: node::NodePlatform::FlushForegroundTasksInternal() [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 7: uv__async_io [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 8: uv__io_poll [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
 9: uv_run [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
10: node::Start(v8::Isolate*, node::IsolateData*, int, char const* const*, int, char const* const*) [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
11: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
12: node::Start(int, char**) [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
13: start [/Users/ofrobots/.nvm/versions/node/v8.9.0/bin/node]
@ofrobots
Copy link
Contributor Author

ofrobots commented Nov 4, 2017

This is with node 8.9.0 with debug agent 2.2.2.

@ofrobots
Copy link
Contributor Author

ofrobots commented Nov 6, 2017

I cannot seem to reproduce the crash reliably so far today. D'oh. I was missing the environment variable.

/cc @eugeneo @ak239.

@ofrobots
Copy link
Contributor Author

ofrobots commented Nov 6, 2017

Minimal repro:

const inspector = require('inspector');
const session = new inspector.Session();
session.connect();

setInterval(() => { console.log('jello')}, 2000);

Start with node --inspect test.js. Attach devtools.

@ofrobots
Copy link
Contributor Author

ofrobots commented Nov 6, 2017

Without devtools:

// Flags: --inspect=9229
const inspector = require('inspector');
const session = new inspector.Session();
session.connect();

setInterval(() => { console.log('jello')}, 2000);

setTimeout(() => {
  require('child_process').spawn(process.execPath, [
    'inspect',
    'localhost:9229'
  ])
}, 1000);

@ofrobots
Copy link
Contributor Author

ofrobots commented Nov 6, 2017

Opened bug upstream: nodejs/node#16852

@ofrobots
Copy link
Contributor Author

ofrobots commented Nov 7, 2017

Closing as the bug is upstream.

@ofrobots ofrobots closed this as completed Nov 7, 2017
@google-cloud-label-sync google-cloud-label-sync bot added the api: clouddebugger Issues related to the googleapis/cloud-debug-nodejs API. label Jan 31, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: clouddebugger Issues related to the googleapis/cloud-debug-nodejs API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants