-
Notifications
You must be signed in to change notification settings - Fork 513
Debug adapter process terminated unexpectedly and PowerShell session has terminated due to an error at the same time and all time #1078
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
Comments
I get exactly the same error when attempting to attach to a powershell process to debug. |
Same VSCode and extension versions. PowerShell debugging does not work. No output to the debug console, session crashes constantly. Completely useless for debugging still. It's a bit frustrating to have to go back to the ISE to properly test anything. |
I see what the problem is here. I believe we can get this fixed for the next drop. BTW the problem pointed out by the log for this issue is the existence of an 'Untitled" editor window open in the workspace. If there is a breakpoint set in an unsaved file, we can't break on it. The PowerShell debug engine requires a filename and a line number. And even before it gets to that point, path handling code chokes on "untitled:Untitled-3". |
I was puzzled how to repro this. Finally figured it out. If you diff a PS1 file and then in the diff viewer, set a breakpoint in the right pane, a breakpoint of the form |
Thanks Keith for picking it up. I have closed the untitled-X file and opened a saved script and tried to debug and its still the same error. Thought of letting you know. Thanks. |
Can you attach the zipped log file for such a session? |
If you set a breakpoint in a non-saved file, then close that file without saving, the breakpoint remains in the breakpoint list and the debugger crashes. Even disabling the Untitled-x breakpoint causes the debugger to crash. If you remove all breakpoints and add a breakpoint to a saved file, the debugger works as expected. |
@MRWeather I believe I have that particular crash fixed. I think @Cognic is running into a different bug now but hard to tell unless I can get the log files. |
OK. It sounded the same to me - for me it wasn't the open unsaved file, but a breakpoint for any unsaved file that was causing the problem. If @Cognic had a breakpoint for an unsaved file, closing the file and opening a different one without removing the bad breakpoint would not do anything. Either way, thanks for working on this - I hope you get lots of appreciation :) |
No worries. Glad to have to the extra info! |
@rkeithhill Attached the logs. Thanks. |
for me its reproducible by simply opening a clean install of VSCode and attaching the debugger to an external powershell process. (Without opening any files/directories first) |
@ZHumphries That is a different bug related to debugging that is being tracked here |
@Cognic This looks to be the exact same issue as before:
I wonder if you're seeing what @MRWeather points out above. That is, you don't have an "Untitled-3" window open but at some point you did and you set a breakpoint in it and closed that window. But the breakpoint hung around. If you look in the Breakpoints view, do you see a breakpoint set on "Untitled-3"? If so, right-click and remove that breakpoint. That should get you debugging again. |
@rkeithhill Sorry I forgot to mention that I have tried what @MRWeather pointed out and didn't work. |
Ah, looks like they fixed the VSCode side of the debugger. I'm still going to commit my changes to make the PowerShell side more resilient to this. |
The breakpoint on an unsaved file is still an issue for me even with the new VSCode. |
I believe this particular issue has been fixed. If I haven't heard otherwise in a few days, I'm going to close this issue. |
I believe it is fixed. I have tested the conditions that I reported and the debugger doesn't crash. I still think it is odd that you can set a breakpoint in an unsaved file when it won't break on it. And if you save after setting a breakpoint, the Untitled-x breakpoint remains in the list of breakpoints. |
@MRWeather Thanks for following up. Yeah, there are some oddities with the interaction (or lack thereof) between the VSCode debug breakpoint UI and the target debugger - which doesn't actually get invoked until the user starts debugging. |
System Details
$PSVersionTable
:Name Value
PSVersion 5.1.14393.1532
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1532
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description:
"Debug adapter process has terminated unexpectedly"
"The PowerShell session has terminated due to an error, would you like to restart"
These two errors keeps popping up every time I run something from VScode, not even while debugging.
VSCode has been my primary editor for long but these days its very annoying to keep switching between VSCode for writing and ISE for debugging and running. Please fix.
Attached Logs
logs.zip
The text was updated successfully, but these errors were encountered: