You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hard crash (of everything) when debugging nodejs #18758
bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesimportantIssue identified as high-priorityverifiedVerification succeeded
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
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?
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).
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.
bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesimportantIssue identified as high-priorityverifiedVerification succeeded
Activity
isidorn commentedon Jan 19, 2017
Chad Brockman (@chadbr) I can not reproduce this behavior.
ping Andre Weinand (@weinand) for ideas
chadbr commentedon Jan 19, 2017
Isidor Nikolic (@isidorn)
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.
only nodejs AFAIK. I debugged both .net core & angular2 tests very recently with no issues.
I'll try this today...
Same results with the insiders build.
isidorn commentedon Jan 19, 2017
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
chadbr commentedon Jan 19, 2017
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?
chadbr commentedon Jan 19, 2017
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!
weinand commentedon Jan 19, 2017
Cannot reproduce either.
consoledoes not have a functionwriteline(), but this doesn't explain the issue you are seeing...Please add a
traceproperty to your launch config like this:and post the resulting debug console output here.
weinand commentedon Jan 19, 2017
What happens if you do not press the 'terminate' button but the green 'continue' (play) button instead?
chadbr commentedon Jan 19, 2017
if I press pause it crashes - let me play with above -
weinand commentedon Jan 19, 2017
Please try our experimental node2 debugger by changing the value of the
typeattribute in your launch config tonode2. Do you see the same behaviour?weinand commentedon Jan 19, 2017
More things you can try (only one at a time):
weinand commentedon Jan 19, 2017
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
pgrepcommand. Do you have a differentpgrepcommand 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?
13 remaining items
lucas-natraj commentedon Jan 19, 2017
That seemed to fix it. Stops debugging immediately!
...Happiness...
Gratitudes!!
weinand commentedon Jan 19, 2017
Lucas Natraj (@lucas-natraj) Chad Brockman (@chadbr) thanks a lot for helping with the investigation!
weinand commentedon Jan 19, 2017
I can easily reproduce the problem after running this
brew install proctoolslucas-natraj commentedon Jan 19, 2017
Good to hear.
Am curious to know why it was previously delaying and then crashing vscode, but after the reinstall only the delay remained.
weinand commentedon Jan 19, 2017
pgrepis 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
psto find its process ID (e.g. 36915) and then use/usr/bin/pgrep -P 36915no process IDs are listed. This is the correct behaviour.If I use the
pgrepinstalled bybrewI get a list of 456 process IDs. This doesn't seem right. So either brew'spgrepis 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).
lucas-natraj commentedon Jan 19, 2017
Cool. That explains the delay.
Was the crash occurring because of the missing kill permission? Or something else?
weinand commentedon Jan 19, 2017
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
-Poption 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.weinand commentedon Jan 19, 2017
Fixed in tomorrows Insiders build
Copy vscode-node-debug fix for microsoft/vscode#18758