Skip to content

Preview extension 2019.12.0 crashes when debugging some scripts #2386

Closed
PowerShell/PowerShellEditorServices
#1140
@sba923

Description

@sba923

System Details

### VSCode version: 1.41.1 26076a4de974ead31f97692a0d32f90d735645c0 x64

### VSCode extensions:
alefragnani.Bookmarks@10.6.0
anseki.vscode-color@0.4.5
christian-kohler.path-intellisense@1.4.2
CoenraadS.bracket-pair-colorizer@1.0.61
Damien.autoit@1.0.3
DavidAnson.vscode-markdownlint@0.33.0
Gruntfuggly.todo-tree@0.0.162
hdg.live-html-previewer@0.3.0
mechatroner.rainbow-csv@1.3.1
ms-python.python@2019.11.50794
ms-vscode-remote.remote-wsl@0.41.6
ms-vscode.cmake-tools@1.2.3
ms-vscode.cpptools@0.26.2
ms-vscode.csharp@1.21.9
ms-vscode.powershell-preview@2019.12.0
msjsdiag.debugger-for-chrome@4.12.3
naco-siren.gradle-language@0.2.3
nobuhito.printcode@3.0.0
oderwat.indent-rainbow@7.4.0
plex.vscode-protolint@0.2.0
redhat.java@0.54.2
scala-lang.scala@0.3.8
slevesque.vscode-autohotkey@0.2.2
twxs.cmake@0.0.17
Tyriar.lorem-ipsum@1.2.0
VisualStudioExptTeam.vscodeintellicode@1.2.2
vscjava.vscode-java-debug@0.23.0
vscjava.vscode-java-dependency@0.6.0
vscjava.vscode-java-pack@0.8.1
vscjava.vscode-java-test@0.22.0
vscjava.vscode-maven@0.20.1
yzhang.markdown-all-in-one@2.6.1
zxh404.vscode-proto3@0.3.0


### PSES version: 2.0.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.1
PSEdition                      Core
GitCommitId                    7.0.0-rc.1
OS                             Microsoft Windows 10.0.17134
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

I'm debugging a script that automates Word via COM automation (FWIW).

Whenever a breakpoint is hit, the editor services crash.

Expected Behaviour

Normal debugging behavior: breakpoint hit, can proceed with debugging

Actual Behaviour

An "unhandled exception" crash occurs:




__/\\\\\\\\\\\\\_______/\\\\\\\\\\\____/\\\\\\\\\\\________/\\\\\\\\\_
 _\/\\\/////////\\\___/\\\/////////\\\_\/////\\\///______/\\\////////__
  _\/\\\_______\/\\\__\//\\\______\///______\/\\\_______/\\\/___________
   _\/\\\\\\\\\\\\\/____\////\\\_____________\/\\\______/\\\_____________
    _\/\\\/////////_________\////\\\__________\/\\\_____\/\\\_____________
     _\/\\\_____________________\////\\\_______\/\\\_____\//\\\____________
      _\/\\\______________/\\\______\//\\\______\/\\\______\///\\\__________
       _\/\\\_____________\///\\\\\\\\\\\/____/\\\\\\\\\\\____\////\\\\\\\\\_
        _\///________________\///////////_____\///////////________\/////////__


                  =====> PowerShell Integrated Console <=====

? c:\tmp\ExtractInfoFromChangeHistory.ps1

  Opening 'xxx.docx'...


An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will exit.
Unhandled exception.
An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will exit.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableDetails.GetValueStringAndType(Object value, Boolean isExpandable, String& typeName) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\Debugging\VariableDetails.cs:line 197
   at Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableDetails..ctor(String name, Object value) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\Debugging\VariableDetails.cs:line 93
   at Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableDetails..ctor(PSObject psVariableObject) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\Debugging\VariableDetails.cs:line 60
   at Microsoft.PowerShell.EditorServices.Services.DebugService.FetchVariableContainerAsync(String scope, VariableContainerDetails autoVariables) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 859
   at Microsoft.PowerShell.EditorServices.Services.DebugService.FetchGlobalAndScriptVariablesAsync() in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 835
   at Microsoft.PowerShell.EditorServices.Services.DebugService.FetchStackFramesAndVariablesAsync(String scriptNameOverride) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 824
   at Microsoft.PowerShell.EditorServices.Services.DebugService.OnDebuggerStopAsync(Object sender, DebuggerStopEventArgs e) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 1261
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableDetails.GetValueStringAndType(Object value, Boolean isExpandable, String& typeName) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\Debugging\VariableDetails.cs:line 197
   at Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableDetails..ctor(String name, Object value) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\Debugging\VariableDetails.cs:line 93
   at Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableDetails..ctor(PSObject psVariableObject) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\Debugging\VariableDetails.cs:line 60
   at Microsoft.PowerShell.EditorServices.Services.DebugService.FetchVariableContainerAsync(String scope, VariableContainerDetails autoVariables) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 859
   at Microsoft.PowerShell.EditorServices.Services.DebugService.FetchGlobalAndScriptVariablesAsync() in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 835
   at Microsoft.PowerShell.EditorServices.Services.DebugService.FetchStackFramesAndVariablesAsync(String scriptNameOverride) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 824
   at Microsoft.PowerShell.EditorServices.Services.DebugService.OnDebuggerStopAsync(Object sender, DebuggerStopEventArgs e) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\DebugService.cs:line 1261
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Note: the non-preview extension also crashes on that same script.

Attached Logs

1576843804-4085d900-df8f-4283-9e36-a2ae5ff86cf01576837364267.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions