Skip to content

PowerShell Preview is Crashing 2019.11.0 #2275

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
PrzemyslawKlys opened this issue Nov 4, 2019 · 7 comments
Closed

PowerShell Preview is Crashing 2019.11.0 #2275

PrzemyslawKlys opened this issue Nov 4, 2019 · 7 comments
Assignees
Labels
Area-Engine Issue-Bug A bug to squash.

Comments

@PrzemyslawKlys
Copy link
Contributor

Issue Description

I am experiencing a problem with...crashing of extension.

Basically what I did is have an empty .ps1 file. Typed Get-Process to reproduce #2274 ticket, waited. Nothing showed up, pressed enter, and it showed @ as mentioned in #2274 and finally crashed a few seconds later.

I'm opening it as a separate issue as it may be worth try/catch or something. Feel free to close one if it's the same thing.

Relevant log.

2019-11-04 10:47:28.903 +01:00 [WRN] Runtime exception occurred while executing command:

System.Management.Automation.ParseException: At line:1 char:1
+ @
+ ~
Unrecognized token in source text.
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.<ExecuteCommandAsync>d__84`1.MoveNext()
2019-11-04 10:47:28.974 +01:00 [VRB] StartReadLoop called while read loop is already running
2019-11-04 10:47:28.974 +01:00 [VRB] Attempting to execute command(s):

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.17763
VSCode 1.39.2
PowerShell Extension Version 2019.11.0

PowerShell Information

Name Value
PSVersion 5.1.17763.771
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.17763.771
BuildVersion 10.0.17763.771
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
beautify HookyQR 1.5.0
gitlens eamodio 10.1.1
material-icon-theme PKief 3.9.1
open-in-browser techer 2.0.0
powershell-preview ms-vscode 2019.11.0
theme-monokai-pro-vscode monokai 1.1.14
vscode-wakatime WakaTime 2.2.1
@ghost ghost added the Needs: Triage Maintainer attention needed! label Nov 4, 2019
@rjmholt
Copy link
Contributor

rjmholt commented Nov 4, 2019

Looks like this is caused by PSReadLine's @ character issue that we're seeing. Fixing that will fix this.

@rjmholt
Copy link
Contributor

rjmholt commented Nov 4, 2019

@PrzemyslawKlys when you say the extension is crashing, do you mean the Integrated Console goes down and you get a restart message?

@PrzemyslawKlys
Copy link
Contributor Author

Yes

@rjmholt
Copy link
Contributor

rjmholt commented Nov 4, 2019

Can you share the log section above the one given in the description?

@PrzemyslawKlys
Copy link
Contributor Author

EditorServices.log

@rjmholt
Copy link
Contributor

rjmholt commented Nov 4, 2019

I've got a similar looking thing in the debugger. Not sure if it's the same exception but the stack trace looks right: here.

It's not crashing the extension though, just sending a parse error to the console.

The issue occurs as the prompt is cancelled here when something is run with F8.

@rjmholt
Copy link
Contributor

rjmholt commented Nov 4, 2019

So still haven't worked out where PowerShellContextService.ExecuteCommandAsync() is being called in a way that we don't handle it, but I do have some good info on the @ problem. Will share in a more specific thread.

@rjmholt rjmholt added Area-Engine Issue-Bug A bug to squash. labels Nov 4, 2019
@SydneyhSmith SydneyhSmith removed the Needs: Triage Maintainer attention needed! label Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Engine Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

3 participants