Skip to content

PowerShell Debug adapter terminates when using attach to host process #551

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
duffney opened this issue Sep 26, 2017 · 6 comments
Closed
Labels

Comments

@duffney
Copy link

duffney commented Sep 26, 2017

When using the PowerShell attach to process option in the debugger the debugger adapter terminates unexpectedly. The integrated powershell terminal also terminates unexpectedly preventing you from using the debugger with other PowerShell process.

code_2017-09-24_13-06-29

@rkeithhill
Copy link
Contributor

I believe the offending exception originates from here. A task result is being set (apparently a second time) and an InvalidOpException happens - the ex message is:

    System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
       at System.Threading.Tasks.TaskCompletionSource`1.SetResult(TResult result)
       at Microsoft.PowerShell.EditorServices.PowerShellContext.<ExecuteCommand>d__48`1.MoveNext()
    ...

@kborowinski
Copy link

@rkeithhill @daviwil : Unfortunately it looks like the attach to process is still crashing PowerShellEditorServices. I get ProtocolEndpoint_UnhandledException in EditorServicesHost.cs with PS 1.5.0 either on VSCode 1.17.2 or latest VSCode 1.18.0 insiders version. Logs attached.

vsc_1_17_2_ps_1_5_0_logs.zip
vsc_1_18_0_ps_1_5_0_logs.zip

@rkeithhill
Copy link
Contributor

rkeithhill commented Oct 28, 2017

Yup, that's why this issue hasn't been closed. We know where the bug is but are still looking for a way to fix it without breaking other behaviors.

@realonedet
Copy link

I am still experiencing this issue as well, i have tried new versions released through new test builds, still getting the error referenced here, very frustrating, is our only recourse to wait for an updated build of the plugin ?

@SeeminglyScience
Copy link
Collaborator

I suspect this will be fixed with all the changes PSReadLine brings. A large amount of logic around how we execute commands had to be refactored to handle nested prompts. No solid eta yet, but I would hold off attempting to fix this. Current progress is in this branch.

@andyleejordan
Copy link
Member

This has been long since fixed 😊

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

No branches or pull requests

8 participants