Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopping or restarting node.js debugger crashes vscode #14187

Closed
aheitzmann opened this issue Oct 21, 2016 · 8 comments
Closed

Stopping or restarting node.js debugger crashes vscode #14187

aheitzmann opened this issue Oct 21, 2016 · 8 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster

Comments

@aheitzmann
Copy link

aheitzmann commented Oct 21, 2016

  • VSCode Version: 1.6.1
  • OS Version: OSX El Capitan 10.11.6
  • Node version: 6.7.0

Steps to Reproduce:

  1. Start vscode through the finder
  2. Open a new folder
  3. Create a new file app.js in the root of the folder with contents
var msg = 'hello world'
console.log(msg)
  1. [optional] Confirm that "hello world" is printed when running the file with
    node app.js
  2. Click the gear in the DEBUG pane to create a Node.js launch.json config.
  3. Hit F5 or click the run button to run app.js with the debugger attached
    Expected behavior: "hello world" is printed to the console. No breakpoints are set, so the program runs and terminates, and the debugger detaches automatically.
    Actual behavior: "hello world" is printed to the console. The debugger stays attached.
  4. Hit Shift-F5 or the Stop Debugging button to detach the debugger and terminate the node program.
    Expected behavior: The debugger detaches and vscode exits debug mode.
    Actual behavior: Nothing happens for about 10 seconds, then vscode crashes.

Possible clue
If vscode was launched from the command line with
code
(see the shell command setup here https://code.visualstudio.com/docs/setup/mac)
Then step 7 produces the following output in the debug console, and vscode does not crash.

/usr/local/Cellar/node/6.7.0/bin/node[57339]: ../src/debug-agent.cc:149:void node::debugger::Agent::Stop(): Assertion `(err) == (0)' failed.
 1: node::Abort() [/usr/local/bin/node]
 2: node::RunMicrotasks(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
 3: node::debugger::Agent::~Agent() [/usr/local/bin/node]
 4: node::debugger::Agent::~Agent() [/usr/local/bin/node]
 5: node::Environment::~Environment() [/usr/local/bin/node]
 6: node::Start(int, char**) [/usr/local/bin/node]
 7: start [/usr/local/bin/node]
@roblourens roblourens added the debug Debug viewlet, configurations, breakpoints, adapter issues label Oct 21, 2016
@roblourens
Copy link
Member

Could you try with "type": "node2", our experimental new debugger, to see if it works any better? I'm also curious whether you see this with different versions of Node, or in vscode insiders build - code.visualstudio.com/insiders.

@weinand
Copy link
Contributor

weinand commented Oct 21, 2016

@aheitzmann It is possible that this issue is caused by an installed extension. Can you try to run VS Code without extensions? From the command line, execute: code --disable-extensions and try your steps again to see if it reproduces.

@roblourens node-debug2 shows the same behaviour: app.js does not terminate properly but crashing does not occur.

@roblourens
Copy link
Member

That part is expected because of this bug unfortunately - microsoft/vscode-node-debug2#11

@weinand weinand added the info-needed Issue requires more information from poster label Oct 21, 2016
@aheitzmann
Copy link
Author

@weinand Unfortunately the crash does not reproduce when vscode is launched from the command line. I get the "Assertion `(err) == (0)' failed" error in that case whether or not --disable-extensions is specified.

I tried simply uninstalling all of my extensions, and the crash still reproduces when launched from the finder.

My user settings are

// Place your settings in this file to overwrite the default settings
{
    "editor.rulers": [100],
    "editor.wrappingIndent": "indent",
    "diffEditor.ignoreTrimWhitespace": false,
    "files.trimTrailingWhitespace": true,
    "files.autoSave": "afterDelay",
    "typescript.useCodeSnippetsOnMethodSuggest": true,

    "vim.useCtrlKeys": true
}

and I'm attaching a zip of the project in case that helps with the repro.
nodecrashrepro.zip

@aheitzmann
Copy link
Author

aheitzmann commented Oct 22, 2016

@roblourens The crash also reproduces with the "type": "node2" debugger (again, only when vscode is launched through the finder)

@aheitzmann
Copy link
Author

@roblourens The crash also reproduces with the latest vscode insiders build.

@lucas-natraj
Copy link

lucas-natraj commented Jan 18, 2017

I've started seeing this issue as well with vscode 1.8.1, El Capitan, node version 6.9.1
Things were working just fine until yesterday, although I'm not sure what I have changed since then.
There was an update to vscode that I did install, but trying to revert to an earlier version still results in a crash on debugger detach.

Has anyone else experienced this? Since the last update to this issue was in October.

@weinand
Copy link
Contributor

weinand commented Feb 2, 2018

Please try the latest VS Code and a recent version of node.js. If the problem still exists, we can reopen this issue.

@weinand weinand closed this as completed Feb 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants