Skip to content

Debugger crashes a lot when BreakPoints are set in PowerShell code #1107

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
reddwarf666 opened this issue Nov 19, 2017 · 9 comments · Fixed by PowerShell/PowerShellEditorServices#592

Comments

@reddwarf666
Copy link

System Details

  • Operating system name and version:
    OSX High Sierra 10.13.1
  • VS Code version:
    1.18.1
  • PowerShell extension version:
    1.5.1
  • Output from $PSVersionTable:
    Name Value

PSVersion 6.0.0-rc
PSEdition Core
GitCommitId v6.0.0-rc
OS Darwin 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

$pseditor.EditorServicesVersion:
Major Minor Build Revision


1 5 1 0

One Dark Plus (2.0.0)
Path Intellisense (1.4.2)
PowerShell (1.5.1)
PowersShell Stack Overflow (0.0.2)
RSPG - Random String or Password Generator (1.0.1)
Settings Sync (2.8.6)

Issue Description

I am experiencing a problem with...
Crashing debugger, especially if I set break points

A lot of times the debugger crashes and a complete restart of VSCode is needed.
And if a break point is hit and I step over the point the debugger does not progress unless I hit a key on my keyboard.
I have to say though that adding the option ""powershell.developer.editorServicesLogLevel": "Verbose" seems to have stabalised the debugger a bit. Odd how that works, could be coincidense. Perhaps the logs can tell you guys more, I hope so!

@alexjordan6
Copy link

Seeing the same thing, nearly same specs (os version, ps version, etc)

@lantrix
Copy link

lantrix commented Dec 7, 2017

I'm seeing the same issue with everything the same except OSX 10.12.6, where the debugger seems to hang/crash. I'm trying to follow this walkthrough on PowerShell debugging.

After the Examples folder has loaded, open the DebugTest.ps1 file, and set a breakpoint on the line that has the Start-Sleep command.

I've enabled the Verbose logging as shown and attached logs from an attempt at a debug session that hangs.

"powershell.developer.editorServicesLogLevel": "Verbose"

System Details

  • Operating system name and version: 10.12.6 MacOS Sierra
  • VS Code version: 1.18.1
  • PowerShell extension version: 1.5.1
  • Output from $PSVersionTable:
PS /Users/lantrix/.vscode/extensions/ms-vscode.powershell-1.5.1/examples> code -v
1.18.1
929bacba01ef658b873545e26034d1a8067445e9
PS /Users/lantrix/.vscode/extensions/ms-vscode.powershell-1.5.1/examples> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      5      1      0


PS /Users/lantrix/.vscode/extensions/ms-vscode.powershell-1.5.1/examples> code --list-extensions --show-versions
Shan.code-settings-sync@2.8.6
abusaidm.html-snippets@0.1.0
anoff.theme-monokai-light@1.0.3
arcticicestudio.nord-visual-studio-code@0.6.0
aws-scripting-guy.cform@0.0.10
beardfury.simple-ocean@0.2.0
dbaeumer.vscode-eslint@1.4.3
dkundel.vscode-npm-source@1.0.0
jmallien.ReplaceWithNewline@0.0.1
mikelward.theme-plainlight@0.0.10
monokai.theme-monokai-pro-vscode@1.1.2
ms-mssql.mssql@1.2.1
ms-vscode.csharp@1.13.1
ms-vscode.PowerShell@1.5.1
ms-vscode.sublime-keybindings@3.0.3
msjsdiag.debugger-for-chrome@3.5.0
reblws.one-dark-flatland-monokai@0.1.0
vittorioromeo.expand-selection-to-scope@0.2.0
xabikos.JavaScriptSnippets@1.5.0
PS /Users/lantrix/.vscode/extensions/ms-vscode.powershell-1.5.1/examples> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-rc
PSEdition                      Core
GitCommitId                    v6.0.0-rc
OS                             Darwin 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct  4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

Same as @reddwarf666 - Debugger crashes a lot when BreakPoints are set in vscode-powershell

Attached Logs

EditorServices.log
vscode-powershell.log

@rkeithhill
Copy link
Contributor

rkeithhill commented Dec 7, 2017

There are two crippling bugs in debugging on non-Windows systems. The one you've run into - I call the InvalidOperationException / Task.SetResult called on an already completed task ... bug. And the other is that the debugger is locked until you press enter in the PowerShell Integrated Console. I've burned several days trying to fix these but I'm afraid as of yet - there is not a simple fix that I've found. :-(

@lantrix
Copy link

lantrix commented Dec 7, 2017

Wow - the debugger being locked until I press enter - that's something I would not have picked up. Thanks for that. My normal IDE/debug for PowerShell is ISESteroids, and of course that works like a dream on Windows.

@daviwil
Copy link
Contributor

daviwil commented Dec 7, 2017

@SeeminglyScience mentioned to me today that he might have fixed the debugger hanging issues, so hopefully we can get that merged soon!

@pessimism
Copy link

Any ETA on this merge happening?

@TylerLeonhardt
Copy link
Member

@SeeminglyScience Just curious where you ended up on that potential fix. I can assist in any way if you need another set of eyes!

@SeeminglyScience
Copy link
Collaborator

@tylerl0706 The fix is good, just a lot of logistics. I separated out the native code that's required for the fix into a different project, I just need to build it on all the platforms and publish the package so we can consume it.

The repo is UnixConsoleEcho.

I can assist in any way if you need another set of eyes!

If you could build the dylib on Mac and shoot it over to me that'd be very helpful. That's the one environment I can't build it on atm. Invoke-Build should work as is, assuming you have xcode installed, g++ is in your path, and I guessed the Mac compiler options correctly :)

Also if you (or any other PSES maintainers) want access to the repo let me know.

After that's published I'll get a PR with the PSES changes up.

@TylerLeonhardt
Copy link
Member

Awesome, @SeeminglyScience!!

If you could build the dylib on Mac and shoot it over to me that'd be very helpful.

Happy to help 😃

I ran into an error building from source and opened it here: SeeminglyScience/UnixConsoleEcho#1

Let me know what you think!

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.

8 participants