Skip to content

Process terminated bue to StackOverFlow - process terminated with code 3221225725 #1613

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
Amir-Mir opened this issue Nov 14, 2018 · 20 comments · Fixed by PowerShell/PowerShellEditorServices#795

Comments

@Amir-Mir
Copy link

Issue Type: Bug

The PowerShell process keep getting terminated. The keeps getting terminated and this goes on in loop.

Extension version: 1.9.0
VS Code version: Code 1.29.0 (5f24c93878bd4bc645a4a17c620e2487b11005f9, 2018-11-12T07:47:15.448Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 x 3592)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
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: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 31.69GB (14.92GB free)
Process Argv
Screen Reader no
VM 0%
@rjmholt
Copy link
Contributor

rjmholt commented Nov 14, 2018

Hi @BadSqlPro, thanks for opening an issue.

Can you please follow through our troubleshooting docs to attach your PowerShell extension logs.

We will need more information about what happened and a way to reproduce the issue in order to fix it.

@Amir-Mir
Copy link
Author

Hello @rjmholt , I followed the instructions and turned on the Verbose logging for "powershell.developer.editorServicesLogLevel": "Verbose". I am attaching the logs here, Please let me know if the logs have the relevant info. I also some screenshots.
Pleas let me know if I can provide further info.

EditorServices.log
Start-EditorServices-EditorServices.log
vscode-powershell.log

image

@rjmholt
Copy link
Contributor

rjmholt commented Nov 14, 2018

Thanks for that @BadSqlPro!

So it looks like RecursivelyEnumerateFiles has a problem here. There's a big list of errors like this one:

2018-11-14 12:32:13.221 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices\Workspace\Workspace.cs: In method 'RecursivelyEnumerateFiles', line 270: Could not enumerate files in the path 'c:\$Recycle.Bin\S-1-5-18' due to the path not being accessible
    System.UnauthorizedAccessException: Access to the path 'c:\$Recycle.Bin\S-1-5-18' is denied.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileSystemEnumerableIterator`1.CommonInit()
       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
       at System.IO.Directory.GetDirectories(String path)
       at Microsoft.PowerShell.EditorServices.Workspace.RecursivelyEnumerateFiles(String folderPath)

(That's the first, but it's identical to the others)

However it looks like that didn't crash anything (but we should handle/log it better).

EditorServices.log's last entry is this:

2018-11-14 12:33:06.025 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices\Workspace\Workspace.cs: In method 'GetFile', line 98:
    Opened file on disk: c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\WindowsUpdate\WindowsUpdate.psd1

So there's not much indication of what caused the crash there.

@BadSqlPro how did you determine that the cause of the crash was a stack overflow. If you've got a stack trace or any other error messages, can you share them? Otherwise, we might need to crank up logging to Diagnostic and come up with some repro steps.

@Amir-Mir
Copy link
Author

Amir-Mir commented Nov 15, 2018 via email

@rjmholt
Copy link
Contributor

rjmholt commented Nov 15, 2018

Right, I was looking at the screenshot, but it doesn't say stack overflow -- so I was wondering if there's another message?

Anyway, I think we'll need diagnostic logs to work out what's happening here.

@Amir-Mir
Copy link
Author

Well, to make matter even worst, my VS Code just wont work at all i.e. with the PowerShell extension. I even uninstalled VS Code and reinstalled it and was hoping that this issue would go away. But when I reinstalled VSCode, I saw all my previous extensions there, looks like they never got uninstalled. If it would help, I have Visual Studio 2015 and 2017 installed on my machine, hope that is not messing up the VS Code. I am also pasting a screenshot of the StackOverFlowException error that I see now, every single time I try to run a piece of PowerShell code. Please let me know how should I proceed.

image

And then I get these errors on the lower left corner of the window in VS Code.
image

And when I restart the session by clicking 'Yes' I get this error

image

@rjmholt
Copy link
Contributor

rjmholt commented Nov 16, 2018

Visual Studio installations wouldn't (to my knowledge) interfere with anything here either.

Reinstalling VSCode probably wouldn't touch the extensions. For that you need to close and uninstall VSCode, and then delete the ~/.vscode folder (rm -fo -r ~/.vscode will do it on Windows, rm -rf ~/.vscode on other platforms). Then reinstall VSCode.

We still need more information on reproducing the StackOverflowExtension you're seeing. So please set logging to Diagnostic, start the extension and post the logs here once it's crashed.

Another thing to try is finding the ~/.vscode/extensions/ms-vscode.powershell-1.9.0/modules/PowerShellEditorServices/Start-EditorServices.ps1 file, putting a Wait-Debugger in it and stepping through it one line at a time until you hit the crash.

@rjmholt
Copy link
Contributor

rjmholt commented Nov 16, 2018

My current theory is that there's maybe a cyclic symlink on your system that we try and traverse infinitely and eventually crash on. But I have no idea where we might be doing that.

@Amir-Mir
Copy link
Author

Amir-Mir commented Nov 18, 2018 via email

@rjmholt
Copy link
Contributor

rjmholt commented Nov 18, 2018

Try Diagnostic logging first and just attach the logs on GitHub (attaching by email won't work unfortunately).

I don't think the Wait-Debugger option will work actually, since this crash seems to be happening after startup.

So for now, we just need to work out where the crash might be occurring.

@MatthewHamous
Copy link

Also running into this issue, see below logs. Identical problems, but I'm not having any issue with the language client not being ready. I've had this occur on my native win10 installation as well as through an RDP connection to a windows server 2012r2 installation.

Win10 info:
Version 10.0.17134 Build 17134
OS Name Microsoft Windows 10 Pro
Processor Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz, 2904 Mhz, 2 Core(s), 4 Logical Processor(s)
System Type x64-based PC
BIOS Version/Date LENOVO N1MET49W (1.34 ), 7/2/2018

VS Code info:
Version: 1.29.0 (user setup)
Commit: 5f24c93878bd4bc645a4a17c620e2487b11005f9
Date: 2018-11-12T07:47:15.448Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

EditorServices.log
vscode-powershell.log

@rjmholt
Copy link
Contributor

rjmholt commented Nov 19, 2018

Looks like we need some better recursion checking here.

We might have to build a HashSet every time and ignore files that are already in it. Or, if it's a symlink problem, we should just ignore symlinks. Or just set a finite recursion depth of, perhaps, 127 or 255 or something.

@Amir-Mir
Copy link
Author

Amir-Mir commented Nov 28, 2018 via email

@rjmholt
Copy link
Contributor

rjmholt commented Nov 28, 2018

The issue was closed automatically since I merged a PR that we think will fix it. We're hoping to release next week, at which point we can follow up to see if the issue is still occurring or not. If it is, we can reopen this issue.

@Amir-Mir
Copy link
Author

Amir-Mir commented Nov 28, 2018 via email

@Amir-Mir
Copy link
Author

Amir-Mir commented Nov 29, 2018 via email

@TylerLeonhardt
Copy link
Member

Not yet. We're looking to do it on Monday.

@Amir-Mir
Copy link
Author

Amir-Mir commented Nov 29, 2018 via email

@Firmbyte
Copy link

Firmbyte commented Apr 3, 2020

I'm getting the same problem with version 1.43.2. Constantly crashes with error code 3221225725

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: powershell.exe
Problem Signature 02: 10.0.14409.1005
Problem Signature 03: 584a185c
Problem Signature 04: System.Management.Automation
Problem Signature 05: 10.0.14409.1018
Problem Signature 06: 5bac3bc0
Problem Signature 07: 7aae
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.3.9600.2.0.0.272.7
Locale ID: 1033
Additional Information 1: d34e
Additional Information 2: d34e763b2334d493da43dffdedbbc013
Additional Information 3: 61b9
Additional Information 4: 61b9b0a0f4cfa4e08cfb59e255b305e7

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 3, 2020
@corbob
Copy link
Contributor

corbob commented Apr 3, 2020

@Firmbyte could you open a new issue for this? This one has been closed for over a year and a half, the extension and underlying LSP has undergone significant changes in that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants