Skip to content

Start-EditorServices failure loading ps1 files #1474

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

Closed
weloytty opened this issue Aug 8, 2018 · 4 comments
Closed

Start-EditorServices failure loading ps1 files #1474

weloytty opened this issue Aug 8, 2018 · 4 comments
Labels
Issue-Bug A bug to squash.

Comments

@weloytty
Copy link

weloytty commented Aug 8, 2018

Issue Type: Bug

Occasionally (not every time), I open a .ps1 file and get the following error:

The terminal process command 'C:\Program Files\PowerShell\6.0.3\pwsh.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command '& 'C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\modules\PowerShellEditorServices\Start-EditorServices.ps1' -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.8.2'-AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\modules'-EnableConsoleRepl -LogLevel 'Diagnostic' -LogPath 'C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\logs\1533716573-5d7c6d0c-db8c-4e27-b713-84553e9420e11533716490676\EditorServices.log' -SessionDetailsPath 'C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\sessions\PSES-VSCode-20104-170759' -FeatureFlags @()'' failed to launch (exit code: 3221225477)

So I set "powershell.developer.editorServicesLogLevel": "Diagnostic", in my settings, and got this output.

8/8/2018 4:22:53 AM [NORMAL] - Visual Studio Code v1.25.1 64-bit
8/8/2018 4:22:53 AM [NORMAL] - PowerShell Extension v1.8.2
8/8/2018 4:22:53 AM [NORMAL] - Operating System: Windows 64-bit
8/8/2018 4:22:53 AM [DIAGNOSTIC] - Succesfully required c:\Program Files\Microsoft VS Code\resources\app/node_modules.asar/vscode-textmate
8/8/2018 4:22:53 AM [DIAGNOSTIC] - Loaded the vscode-textmate module
8/8/2018 4:22:53 AM [DIAGNOSTIC] - Created the textmate Registry
8/8/2018 4:22:53 AM [DIAGNOSTIC] - PowerShell grammar file specified as c:\Program Files\Microsoft VS Code\resources\app\extensions\powershell\syntaxes\powershell.tmLanguage.json
8/8/2018 4:22:53 AM [NORMAL] - Language server starting --
8/8/2018 4:22:53 AM [NORMAL] -     exe: C:\Program Files\PowerShell\6.0.3\pwsh.exe
8/8/2018 4:22:53 AM [NORMAL] -     args: C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.8.2'-AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\modules'-EnableConsoleRepl -LogLevel 'Diagnostic' -LogPath 'C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\logs\1533716573-5d7c6d0c-db8c-4e27-b713-84553e9420e11533716490676\EditorServices.log' -SessionDetailsPath 'C:\Users\Loyttyw\.vscode\extensions\ms-vscode.powershell-1.8.2\sessions\PSES-VSCode-20104-170759' -FeatureFlags @()
8/8/2018 4:22:53 AM [NORMAL] - Syntax Folding Provider registered
8/8/2018 4:22:54 AM [NORMAL] - powershell.exe terminated or terminal UI was closed
8/8/2018 4:23:10 AM [VERBOSE] - Formatting on type at position {"line":16,"character":4} - file:///d%3A/code/tfs/XXX/YYY/Source/src/TFS/Merge-CamstarChangeset.ps1...
8/8/2018 4:23:53 AM [NORMAL] - Language server startup failed.
8/8/2018 4:23:53 AM [ERROR] - The language service could not be started: 
8/8/2018 4:23:53 AM [ERROR] - Timed out waiting for session file to appear.

This behavior seems to have started with 1.8.x, I don't recall seeing this before that.

Extension version: 1.8.2
VS Code version: Code 1.25.1 (1dfc5e557209371715f655691b1235b6b26a06be, 2018-07-11T15:43:53.668Z)
OS version: Windows_NT x64 10.0.14393

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (4 x 2808)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: unavailable_software
webgl: enabled
webgl2: enabled
Memory (System) 23.88GB (11.05GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
@rjmholt
Copy link
Contributor

rjmholt commented Aug 8, 2018

Just looked up the exit code (0xC0000005 in hex). Possibly an access violation, which is pretty unexpected — we're not running any unmanaged code.

If this is an access violation, the best thing to do is probably get a core dump, which you can do by following the instructions here: https://docs.microsoft.com/en-us/windows/desktop/wer/collecting-user-mode-dumps.

Is it a specific ps1 file you're opening when it crashes? Or maybe it's doing something unusual like pInvoking or using COM? This is just the first I've seen an unmanaged crash for not just the extension but even PowerShell. Ideally we can reproduce it, but I imagine that might be tricky.

@weloytty
Copy link
Author

weloytty commented Aug 8, 2018

The problem usually happens when I do Open Folder on a folder of mixed .net (classic) and powershell code. I captured the dumps, and them along with logs at https://github.com/weloytty/issue1474-vscode-powershell (The dumps were all >100MB, so I had to zip them)

@rjmholt rjmholt added the Issue-Bug A bug to squash. label Aug 9, 2018
@weloytty
Copy link
Author

Problem does not reoccur on 1.26.1

@TylerLeonhardt
Copy link
Member

Glad to hear it @weloytty! If you ever hit this again, please reach out. Closing for now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

3 participants