vscode: Extension Host terminated unexpectedly

Type: Bug

This issue is related to the Julia extension. I filed an issue there, but I also filing it here (as suggested by @pfitzseb).

As per the initial post of the above link, all extension work perfectly fine when the Julia extension is disabled.

here are dmp files as per this dmp-files.zip

VS Code version: Code 1.79.2 (695af097c7bd098fbf017ce3ac85e09bbc5dda06, 2023-06-14T08:57:04.379Z) OS version: Windows_NT x64 10.0.22621 Modes:

System Info
Item Value
CPUs 12th Gen Intel® Core™ i7-1270P (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.67GB (16.06GB free)
Process Argv –crash-reporter-id 014558b0-de03-4e1f-9649-f90be1cbe95b
Screen Reader no
VM 0%
Extensions (50)
Extension Author (truncated) Version
rainbow-brackets 2gu 0.0.6
vscode-django bat 1.10.0
python-environment-manager don 1.0.4
python-extension-pack don 1.7.0
code-runner for 0.12.0
copilot Git 1.94.220
vscode-github-actions git 0.25.8
vscode-pull-request-github Git 0.66.2
nbpreviewer jit 1.2.2
language-julia jul 1.47.2
vsc-python-indent Kev 1.18.0
vscode-github Kni 0.30.7
vscode-opn lfu 1.1.2
MagicPython mag 1.1.0
vscode-azureappservice ms- 0.24.9
vscode-azureresourcegroups ms- 0.7.5
vscode-docker ms- 1.25.2
csharp ms- 1.26.0
isort ms- 2022.8.0
python ms- 2023.10.1
vscode-pylance ms- 2023.6.40
jupyter ms- 2023.5.1101742258
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
remote-containers ms- 0.295.0
remote-ssh ms- 0.102.0
remote-ssh-edit ms- 0.86.0
remote-wsl ms- 0.79.5
vscode-remote-extensionpack ms- 0.24.0
azure-account ms- 0.11.5
cmake-tools ms- 1.14.34
cpptools ms- 1.16.3
cpptools-extension-pack ms- 1.3.0
powershell ms- 2023.6.0
remote-explorer ms- 0.4.0
remote-server ms- 1.2.1
autodocstring njp 0.6.1
r-debugger RDe 0.5.4
r REd 2.8.1
vscode-open san 0.1.0
spellchecker swy 1.4.0
python tht 0.2.3
rmarkdown Tia 0.0.14
cmake twx 0.0.17
vscode-counter uct 3.2.1
intellicode-api-usage-examples Vis 0.2.7
vscodeintellicode Vis 1.2.30
jinja who 0.0.8

(2 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30776702
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
vscrpc:30673769
pythonsymbol12:30671437
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
hideindicator:30766889
pythongtdpath:30769146
bgfeh915:30780428
pythonnosm12tcf:30779713
pythonidxpt:30772539
pythonnocebcf:30776496
cmakestatusbarv2:30779594

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 35 (19 by maintainers)

Most upvoted comments

Steps for verification:

  1. Open helloworld extension in latest stable, add the following changes
diff --git a/helloworld-minimal-sample/extension.js b/helloworld-minimal-sample/extension.js
index 9b28fa2..424008b 100644
--- a/helloworld-minimal-sample/extension.js
+++ b/helloworld-minimal-sample/extension.js
@@ -1,9 +1,7 @@
 // The module 'vscode' contains the VS Code extensibility API
 // Import the module and reference it with the alias vscode in your code below
 const vscode = require('vscode');
-
-// this method is called when your extension is activated
-// your extension is activated the very first time the command is executed
+const { spawnSync } = require('node:child_process');

 /**
  * @param {vscode.ExtensionContext} context
@@ -21,6 +19,8 @@ function activate(context) {

                // Display a message box to the user
                vscode.window.showInformationMessage('Hello World!');
+               spawnSync('winget', ['--version']);
+               spawnSync('node', ['--version']);
        });

        context.subscriptions.push(disposable);
  1. Debug extension, run hello world command
  2. Stop the debug session
  3. Start debug extension again, run hello world command
  4. It should crash the extension host

Perform steps 1-4 again in latest insiders with the fix and it should not crash.

Thanks for sharing the fix @pfitzseb , I will backport the fix into Electron as next step.

Apparrently Julia expects 8 arguments. Not sure why though…

if length(Base.ARGS) != 8 error(“Invalid number of arguments passed to julia language server.”) end

PS C:\temp> node  -v
v18.15.0


PS C:\temp> node .\spawn_julia_ls.js
  Activating project at `c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\environments\languageserver\v1.9`
[ Info: Starting the Julia Language Server
┌ Error: Some Julia code in the VS Code extension crashed
└ @ Main c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\error_handler.jl:15
ERROR: Invalid number of arguments passed to julia language server.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] top-level scope
   @ c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\languageserver\main.jl:34
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:457
 [4] exec_options(opts::Base.JLOptions)
   @ Base .\client.jl:307
 [5] _start()
   @ Base .\client.jl:522



PS C:\temp> node .\spawn_julia_ls.js
  Activating project at `c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\environments\languageserver\v1.9`
[ Info: Starting the Julia Language Server

Base.ARGS = ["c:\\Users\\bernhard.koenig\\Documents\\Repositories\\InfluxDBClient.jl", "--debug=no", "c:\\Users\\bernhard.koenig\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia", "download", "https://www.julia-vscode.org/symbolcache", "--detached=no"]

┌ Error: Some Julia code in the VS Code extension crashed
└ @ Main c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\error_handler.jl:15
ERROR: Invalid number of arguments passed to julia language server.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] top-level scope
   @ c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\languageserver\main.jl:35
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:457
 [4] exec_options(opts::Base.JLOptions)
   @ Base .\client.jl:307
 [5] _start()
   @ Base .\client.jl:522
PS C:\temp>