vscode: Extension host terminated unexpectedly.

Issue Type: Bug

I am using Mac OS Big Sur 11.1 with Macbook Pro 2017(intel i5). VScode always pop up the issue"Extension host terminated unexpectedly." especially while I use C++.

VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:30:02.420Z) OS version: Darwin x64 20.2.0

System Info
Item Value
CPUs Intel® Core™ i5-7360U CPU @ 2.30GHz (4 x 2300)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 5, 4
Memory (System) 8.00GB (0.87GB free)
Process Argv –crash-reporter-id 3f12e0b1-128d-4528-9fb3-29fc2b9c754f
Screen Reader no
VM 0%
Extensions (62)
Extension Author (truncated) Version
html-snippets abu 0.2.1
Bookmarks ale 12.1.4
code-gnu-global aus 0.2.2
bracket-pair-colorizer Coe 1.0.61
bracket-pair-colorizer-2 Coe 0.2.0
doxdocgen csc 1.1.0
c-cpp-compile-run dan 1.0.13
vscode-eslint dba 2.1.14
githistory don 0.6.14
gitlens eam 11.1.3
vscode-html-css ecm 1.9.1
EditorConfig Edi 0.16.4
prettier-vscode esb 5.8.0
git-project-manager fel 1.7.1
php-debug fel 1.14.5
php-intellisense fel 2.3.14
php-pack fel 1.0.2
vscode-firefox-debug fir 2.9.1
code-runner for 0.11.2
vscode-javac geo 0.2.37
vscode-tree-sitter geo 0.1.26
vscode-pull-request-github Git 0.22.0
go gol 0.21.0
go-nightly gol 2021.1.2021
todo-tree Gru 0.0.196
CppSnippets har 0.0.15
better-cpp-syntax jef 1.15.5
flutter-tree mar 1.0.0
git-graph mhu 1.28.0
Angular-BeastCode Mik 10.0.3
vscode-clang mit 0.2.3
csharp ms- 1.23.8
python ms- 2020.12.424452561
vscode-pylance ms- 2021.1.2
jupyter ms- 2020.12.414227025
remote-containers ms- 0.154.2
remote-ssh ms- 0.62.0
remote-ssh-edit ms- 0.62.0
remote-wsl ms- 0.52.0
vscode-remote-extensionpack ms- 0.20.0
cmake-tools ms- 1.5.3
cpptools ms- 1.1.3
cpptools-extension-pack ms- 1.0.0
vsliveshare ms- 1.0.3484
vsliveshare-audio ms- 0.1.91
vsonline ms- 1.0.3076
debugger-for-chrome msj 4.12.11
java red 0.74.0
LiveServer rit 5.6.1
document-tree sac 1.0.1
code-spell-checker str 1.10.2
open-in-browser tec 2.0.0
cmake twx 0.0.17
windows-terminal Tyr 0.6.0
vscodeintellicode Vis 1.2.10
vscode-java-debug vsc 0.30.0
vscode-java-dependency vsc 0.17.0
vscode-java-pack vsc 0.12.1
vscode-java-test vsc 0.27.0
vscode-maven vsc 0.27.1
vscode-icons vsc 11.1.0
html-css-class-completion Zig 1.20.0

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
openlogontheside:30221877
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30211401
wsl2promptcf:30224613
pythonvsdeb440:30242242
unusedpromptcf:30224611
folderexplorer:30224614
openfilemenucf:30224648
pythonvsded773cf:30236630
vstes627:30244334
pythonvspyt875:30247033

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 83 (26 by maintainers)

Most upvoted comments

ahh, I found out how to test the extensions as they are loading, Bracket-Pair-Colorizer-2 was causing the extension host to completely crash out on startup of vscode

@TimMensch I am sorry about the crashes you have experienced. With VS Code’s architecture, we have managed to isolate extensions from the core of VS Code, but all extensions execute together in a single process called the extension host process. So a single misbehaving extension can “take down” the entire extension host. This problem has come up multiple times over the years (e.g. https://github.com/microsoft/vscode/issues/75627 ) and we plan to investigate spawning multiple extension hosts in the future, but this is not an easy undertaking, nor is it clearly the best thing to do. From your post I see that you probably have over 50 extensions. Spawning an extension host process for each of those extensions would cause stutters under Windows (which is notoriously problematic with spawning very many processes quickly) and might eat up a whole lot of RAM. Also, each extension host needs to be managed (events are sent to it, text buffers are mirrored, etc.) by the renderer process, so the overhead for the renderer to keep around 50 extension host processes might be incredibly high.

Our current strategy is to create tooling to help you isolate problematic extensions. We automatically profile the extension host when it is not responsive and identify the top executing extension (F1 > Running extensions) and render a warning icon next to it. We have other tooling like extension bisect to help narrow down the problematic extension. But ultimately, we need the cooperation of extension authors to improve their extensions to stop causing high CPU usage or crashes. We recommend to our extension authors to move any CPU intensive tasks off the extension host process and into a worker or a separate process.

soo i downgraded to 1.52 and it is working fine now but its too buggy

By the way, this happens when I have NO user installed extensions running, so it definitely points to a VSCode bug. Here’s an example error message:

  ERR Extension host terminated unexpectedly. The following extensions were running: vscode.microsoft-authentication, vscode.debug-auto-launch, vscode.git, ms-vscode.js-debug, vscode.github, vscode.github-authentication, vscode.emmet, vscode.merge-conflict, vscode.testing-editor-contributions