Skip to content

PS Integrated Console crashing on debug #2106

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
buckmuu opened this issue Jul 29, 2019 · 10 comments
Closed

PS Integrated Console crashing on debug #2106

buckmuu opened this issue Jul 29, 2019 · 10 comments
Labels
Resolution-Duplicate Will close automatically.

Comments

@buckmuu
Copy link

buckmuu commented Jul 29, 2019

Issue Description

I am experiencing a problem with a debugging session. It crashes immediately.

Untitled

Attached Logs

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

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.18362
VSCode 1.36.1
PowerShell Extension Version 2019.5.0

PowerShell Information

Name Value
PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.18362.145
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
mssql ms-mssql 1.6.0
powershell ms-vscode 2019.5.0
python ms-python 2019.6.24221
team ms-vsts 1.149.2
@rkeithhill
Copy link
Contributor

Which debug configuration are you using? If you are using PowerShell: Launch Current File, then what is the full path of the script you were trying to debug. If you are using PowerShell: Launch Script, please post the debug configuration here.

@buckmuu
Copy link
Author

buckmuu commented Jul 30, 2019

Hi @rkeithhill, thanks you for the quick answer.
I currently use the PowerShell: Launch Current File configuration on the following script:

C:\Users\us1.COMPANY.IT\OneDrive - Company Spa\Azure DevOps Repo\Project01\Test\Test.Customer01.ps1

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jul 30, 2019
@buckmuu
Copy link
Author

buckmuu commented Jul 30, 2019

I thougth the problem could be the - char, but the full path has always been that and it has always worked.

@SydneyhSmith
Copy link
Collaborator

@buckmuu thanks for the additional information, it seems like the one drive path could be the culprit, an issue that we are tracking here: #1994 ...although you said you arent seeing this issue with other scripts in under that file path?

@buckmuu
Copy link
Author

buckmuu commented Jul 31, 2019

@SydneyhSmith yes i confirm that if i try to start a debugging session on another project in the same root folder (C:\Users\us1.COMPANY.IT\OneDrive - Company Spa\Azure DevOps Repo\Project02\script.ps1) it works.

But if I try on another script in the same parent folder (C:\Users\us1.COMPANY.IT\OneDrive - Company Spa\Azure DevOps Repo\Project01\) it does not work.

@carsontwilson
Copy link

carsontwilson commented Jul 31, 2019

I also have crashing on debug. I filed a ticket before (but couldn't really repro so let it die) where I thought it crashing as a result in an exception in another class, but it turns out it just happens on debug. There's no rhyme or reason to it, it'll go for stretches where it's fine, then it will crash 10 or more times in a row on the same script. Some of the scripts are very simple with just a few lines, but all of them refer to other PowerShell classes in my case.

Attached are some log files for a sample crash, in this case the extension crashed after every single run resulting in VS Code noting the crash and asking for a wait or reopen (waiting doesn't change anything though I've not waited more than 5 minutes to be honest).

In this particular set of examples, the log errors are all the same, so I've only included one crash.
VS Version:
image
Extensions:
image

Powershell version:
image

Logs:
DebugSession-1.log
EditorServices.log
vscode-powershell.log

In this case I consistently see this error across multiple sessions:

2019-07-29 16:53:25.033 [ERROR] tid:15 in 'ExecuteCommand' C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 565
    Execution of the following command(s) completed with errors:
    
        c:\Work\devops\powershell\test.ps1
        Out-Default

There are days when my extension can crash 30+ times which is challenging to say the least.

I've completely uninstalled / reinstalled the extension, VS Code etc. but the results remain the same. Thanks!

@rjmholt
Copy link
Contributor

rjmholt commented Jul 31, 2019

@buckmuu

yes i confirm that if i try to start a debugging session on another project in the same root folder (C:\Users\us1.COMPANY.IT\OneDrive - Company Spa\Azure DevOps Repo\Project02\script.ps1) it works.

But if I try on another script in the same parent folder (C:\Users\us1.COMPANY.IT\OneDrive - Company Spa\Azure DevOps Repo\Project01) it does not work.

From the screenshot, it looks like this other script you're running has some character in the filename that is causing an issue. Basically VSCode will turn it into a URI and then we turn it back into a filepath. Can you share the name of that second script? Or otherwise any non alpha-numeric characters that might be in that filename?

@carsontwilson in your case it sounds like you're hitting a different issue to do with the debug pipe. Would you be able to open a new issue to track that?

@buckmuu
Copy link
Author

buckmuu commented Aug 1, 2019

Hi @rjmholt, I did some additional checks and I try to summarize as clearly as possibile:

  • Issue is present only for the scripts under this specific folder C:\Users\US01\OneDrive - Company Spa\Azure DevOps Repo\Project01.
  • All scripts in the problematic folder have this problem..
  • All other projects under AzureDevOps repository works correctly.
  • All the scripts work well if they are opened by themselves (not opening the whole project folder)
  • I have investigate this issue with advanced debugging (WinDbg) and i found this exception (that is the same reported by VSCode:

System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks (HRESULT) 0x80070057 (2147942487) - The parameter is incorrect.
System.ArgumentException: Illegal characters in path

  • I have identify the problematic path in this

C:\Users\US01\OneDrive - Company Spa\Azure DevOps Repo\Project01\git:\c%3A\Users\US01\OneDrive%20-%20Company%20Spa\Azure%20DevOps%20Repo\Project01\projectfullname\LocalModules\ClassRule.psm1?%7B%22path%22%3A%22c%3A%5C%5CUsers%5C%5CUS01%5C%5COneDrive%20-%20Company%20Spa%5C%5CAzure%20DevOps%20Repo%5C%5CProject01%5C%5Cprojectfullname%5C%5CLocalModules%5C%5CClassRule.psm1%22%2C%22ref%22%3A%22~%22%7D

  • This specific path is releated to a breakpoint set on the script.
  • I have remove all breakpoints and the debugging session of the script has work correctly.

So, at the moment, i don't have the issue but i haven't able to identify the root cause.
Removing the breakpoints resolve the issue and adding them again, the problem does not appear.

@rjmholt
Copy link
Contributor

rjmholt commented Aug 1, 2019

Ah that path is the important bit! Looks like you're hitting #1994. I'm working on fixing that currently

@SydneyhSmith SydneyhSmith added the Resolution-Duplicate Will close automatically. label Aug 1, 2019
@ghost
Copy link

ghost commented Aug 2, 2019

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Aug 2, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

5 participants