Skip to content

Hard crash (of everything) when debugging nodejs #18758

Closed

Description

@chadbr
  • VSCode Version: Version 1.8.1 (1.8.1) - ee428b0 - 2016-12-19T14:40:36.266Z
  • OS Version: macos 10.12.2
  • Nodejs version: v6.7.0

Steps to Reproduce:

  1. open code in empty folder
  2. create an app.js with 2 console.writeline() functions
  3. set breakpoints
  4. go to debug pane, accept default setup
  5. press f5 or debug button
  6. when breakpoint is hit, press the stop button

On my colleges machine, vscode crashes. On my machine everything crashes (the shell, all applications, everything...) then the shell restarts.

repo gif attached... you don't see the crash because the app recording the gif gets killed...
crashanim

Anyone else???

Activity

  1. added
    debug
    on Jan 19, 2017
  2. isidorn commented on Jan 19, 2017

    @isidorn

    Chad Brockman (@chadbr) I can not reproduce this behavior.

    1. Do you see this all the time
    2. Do you only see this when debugging Javascript or for all languages
    3. Do you also see this when you disable all extensions in vscode
    4. Do you see this with VSCode insiders also

    ping Andre Weinand (@weinand) for ideas

  3. added
    info-needed
    on Jan 19, 2017
  4. chadbr commented on Jan 19, 2017

    @chadbr
    Author

    Isidor Nikolic (@isidorn)

    1. yes, every time.

    for my colleague - this just started. He asked me to try to see if I had the same issues.

    He rolled back to the previous version of vscode and had the same result.

    I haven't debugged any node code in a while -- so I'm not sure when it started on my machine.

    1. only nodejs AFAIK. I debugged both .net core & angular2 tests very recently with no issues.

    2. I'll try this today...

    3. Same results with the insiders build.

  5. isidorn commented on Jan 19, 2017

    @isidorn

    Andre Weinand (@weinand) might it be that node-debug somehow terminates vscode by accident

    Chad Brockman (@chadbr) since this seems to be happening for your celleague and you (nobody else complained) can you distill what do those two machines have in come. Same node version? Same os version? Something special

  6. chadbr commented on Jan 19, 2017

    @chadbr
    Author

    Isidor Nikolic (@isidorn) Andre Weinand (@weinand)

    Tried #3 - disabled all plugins - didn't help.

    I don't have anything special going on -- typical mac dev box with 500 apps on it :)

    I'm happy to let you remote in? or is there some telemetry I can enable or?

  7. chadbr commented on Jan 19, 2017

    @chadbr
    Author

    could uninstalling / reinstalling potentially help? any instructions for "cleaning code" from a machine?

    I hope to get this working soon - I use code all day every day!

  8. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    Cannot reproduce either.
    console does not have a function writeline(), but this doesn't explain the issue you are seeing...

    Please add a trace property to your launch config like this:

    		{
    			"type": "node",
    			"request": "launch",
    			"name": "Launch Program",
    			"program": "${workspaceRoot}/test.js",
    			"cwd": "${workspaceRoot}",
    			"trace": "all"
    		}

    and post the resulting debug console output here.

  9. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    What happens if you do not press the 'terminate' button but the green 'continue' (play) button instead?

  10. chadbr commented on Jan 19, 2017

    @chadbr
    Author

    if I press pause it crashes - let me play with above -

  11. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    Please try our experimental node2 debugger by changing the value of the type attribute in your launch config to node2. Do you see the same behaviour?

  12. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    More things you can try (only one at a time):

    • reboot your Mac
    • install a different version of node, e.g. 6.5
    • open the "Console" application and then watch out for any suspicious entries that appear when pressing the 'terminate' button in VS Code.
  13. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    Inside the VS Code app is a script "terminateProcess.sh" in "/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/extensions/ms-vscode.node-debug/out/node/terminateProcess.sh"
    This scripts uses the pgrep command. Do you have a different pgrep command installed on your system?
    If you don't know you could rename the "terminateProcess.sh" temporarily so that VS Code will not find it any more. Does the crash still occur?

  14. 13 remaining items

  15. removed
    info-needed
    on Jan 19, 2017
  16. lucas-natraj commented on Jan 19, 2017

    @lucas-natraj

    That seemed to fix it. Stops debugging immediately!

    ...Happiness...

    Gratitudes!!

  17. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    Lucas Natraj (@lucas-natraj) Chad Brockman (@chadbr) thanks a lot for helping with the investigation!

  18. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    I can easily reproduce the problem after running this brew install proctools

  19. lucas-natraj commented on Jan 19, 2017

    @lucas-natraj

    Good to hear.
    Am curious to know why it was previously delaying and then crashing vscode, but after the reinstall only the delay remained.

  20. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    pgrep is used to find all sub-processes launched by the debug target. For a simple node program it should not find any sub-processes.

    So if I launch node and then do a ps to find its process ID (e.g. 36915) and then use /usr/bin/pgrep -P 36915 no process IDs are listed. This is the correct behaviour.

    If I use the pgrep installed by brew I get a list of 456 process IDs. This doesn't seem right. So either brew's pgrep is broken or the semantics of the -Poption is different.

    The "terminateProcess.sh" script then tries to kill all those processes (which takes a long time and most kills will fail due to missing permissions).

  21. lucas-natraj commented on Jan 19, 2017

    @lucas-natraj

    Cool. That explains the delay.
    Was the crash occurring because of the missing kill permission? Or something else?

  22. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    The crash of VS Code or the Finder etc. occurs because brew's pgrep returns the process IDs of many (if not all) processes and the script tries to kill them all. I really mean all macOS processes!

    The -P option should filter this list to only those processes that are child processes of the specified process. But this filter doesn't work for brew's pgrep command.

  23. weinand commented on Jan 19, 2017

    @weinand
    Contributor

    Fixed in tomorrows Insiders build

  24. added
    verified
    on Jan 27, 2017
  25. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdebugimportantverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions