PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.67k stars 478 forks source link

[PREVIEW] Integrated Terminal locks on Windows PowerShell (x64) #2387

Closed joshfria closed 4 years ago

joshfria commented 4 years ago

Issue Description

When trying to start Windows PowerShell (x64) using the integrated terminal the whole application will freeze for about 30 seconds. I have recreated the issue across both of my PCs. I've disabled all extension except the preview extension.

Reproducing the issue

I can either have "powershell.powershellDefaultVersion": "Windows PowerShell (x64)" in my settings or try to start Windows PowerShell(x64) from my session menu. The whole application will then freeze for 30 seconds. Then a pop up windows will appear that says: The window is no longer responding. Then a few seconds later I get a warning in vscode: The terminal process terminated with exit code: {0} Then maybe a minute later I get: The language service could not be started.

Attached Logs

vscode-powershell.zip Attached log file. Added some lines that appeared in the Powershell extension logs terminal that were not in the .log for some reason.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.17763
VSCode 1.41.1
PowerShell Extension Version 2019.12.0

PowerShell Information

Name Value
PSVersion 7.0.0-rc.1
PSEdition Core
GitCommitId 7.0.0-rc.1
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0-rc.1
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand) |Extension|Author|Version| |---|---|---| |azure-account|ms-vscode|0.8.7| |azurerm-vscode-tools|msazurermtools|0.8.3| |bracket-pair-colorizer-2|CoenraadS|0.0.29| |code-settings-sync|Shan|3.4.3| |macros|geddski|1.2.1| |material-icon-theme|PKief|3.9.2| |mssql|ms-mssql|1.8.0| |powershell-preview|ms-vscode|2019.12.0| |shell-launcher|Tyriar|0.4.0| |sublime-keybindings|ms-vscode|4.0.6| |vscode-azurefunctions|ms-azuretools|0.20.1| |vscode-babel-coloring|dzannotti|0.0.4| |vscode-logicapps|ms-azuretools|0.2.25|
PrzemyslawKlys commented 4 years ago

You're most likely seeing this: https://github.com/PowerShell/vscode-powershell/issues/2377

majst32 commented 4 years ago

I've had the same issue since I installed the new PowerShell preview extension (I was previously running the older preview). I've been unable to switch to Windows PowerShell (x64).

rjmholt commented 4 years ago

Can you let us know whether the VSCode window (other than the terminal) responds to input like mouse clicks when you see this hang. If so, it's almost certainly #2377.

joshfria commented 4 years ago

While the terminal is frozen I cannot interact with the vscode menus or other buttons in vscode.

rjmholt commented 4 years ago

While the terminal is frozen I cannot interact with the vscode menus or other buttons in vscode.

Thanks for that. The UI locking up like that is the VSCode bug we've been discussing in #2377. I'll mark this issue as a duplicate.

rjmholt commented 4 years ago

Given some elements of (1) this only occurring with the preview extension and (2) some evidence of UI activity, I reopened this issue.

I've fired up a Windows VM with the following OS version:

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.17763 N/A Build 17763

I used the master branch of the preview extension.

I initially just had Windows PowerShell installed and was able to start and use the extension. I then installed PowerShell 7.0.0-rc.1 alongside and tried switching between PS 7 and PS 5, as well as starting in PS 7 and switching to PS 5.

I haven't been able to reproduce this bug yet though unfortunately. @joshfria @majst32 if you're able to provide any more information about your set up (like policy or similar), or possibly a procdump of the frozen process, that might help us pin down the cause.

joshfria commented 4 years ago

Sorry for the delay @rjmholt. When I run procdump on the code.exe process I see these exceptions at the time of occurrence. [09:27:52] Exception: E06D7363.?AVLibWinptyException@@ [09:27:52] Exception: E06D7363.msc [09:27:53] Exception: 406D1388

I do have a dump file I can upload, but am leery of putting it on a public site. Is there anyway I can send it to you directly.

rjmholt commented 4 years ago

Thanks for following up!

Is there anyway I can send it to you directly

Absolutely, you can mail it (or a link to it) to vscode-powershell@microsoft.com.

Those exceptions don't look familiar (they don't look like CLR exceptions), but hopefully the dump will be elucidating.

joshfria commented 4 years ago

It has been sent. Thank you.

rjmholt commented 4 years ago

It has been sent. Thank you.

Thanks for that. It looks like it's a dump of code.exe, which is the VSCode process rather than the one running PowerShell Editor Services (a powershell.exe).

We can't do much the code.exe dump since that's another application. Given your initial bug report my thinking is that

Then a pop up windows will appear that says: The window is no longer responding.

this part is https://github.com/PowerShell/vscode-powershell/issues/2377.

However,

Then a few seconds later I get a warning in vscode: The terminal process terminated with exit code: {0}

this part is a crash within PSES.

If you're able to get a procdump of the powershell.exe that's a child process of VSCode, that might show us why that occurs.

rjmholt commented 4 years ago

After more discussion in #2377, I'm going to deduplicate this issue to that one