Skip to content
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

"Extension host terminated" Crash Again on Startup (for Yet Another Extension) + Errors Fail to Get Logged + Unable to Determine Extension Causing #80165

Closed
PowerWeb5 opened this issue Aug 31, 2019 · 21 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@PowerWeb5
Copy link

Issue Type: Bug

I opened a .txt file with VSCode on Windows 10 x64 and Yet again VS Code started up with "Extension host terminated" occurring within seconds of launching it, even when just using VSCode to open a text file. And this occurs randomly, even when trying the same test file. And occurs with failed logging of the errors and with many different extensions, including official ones, which seems to be the cause in different cases, seeming to indicate core VSCode or Extension Host issues more than extension-specific issues.

"Extension host terminated" Screenshot

image

Related Issue Detailing Trend of Increasing number of Extension host termination errors across many extensions

See #79782 for more details and overview of series of related bug reports, regarding this being a common issue that keeps reoccurring for many popular extensions and how it is impossible to determine which extension caused it and how the crash error itself and the error that caused it or even the extension activation that caused it, it seems, are failing to get logged, as occurred in this case as well.

I submitted this crash report to provide more details, log files and the like to use as a key test case for debugging and fixing the widespread VSCode issue which I'd described in #79782.

Failed Logging and Crash Timing

The crash occurred within seconds or less than 1 minute of launching, so around 3:06 PDT 8/31/2019.

I waited until around 3:12 PM to perform "Show Developer Tools".
I expanded all items in the Developer Tools with all levels shown and then saved the log file. Only in that log file does "terminated" or "onExtensionHostCrashed" show up. No were under any log file under any folder under C:\Users\Dan\AppData\Roaming\Code\logs\ does either of those words occur when searching all files there.
In fact, no errors of any kind (which occur only during Extension Host Crash sessions) show up in any of the log files for any of the folders created under that path.

This occurred again, 6 days later, after my last related bug report regarding this, despite having disabled other extensions known to cause such issues. Due to lack of error messages getting logged, or even it seems the related extension activation getting logged in time when the host crashes, combined with the fact that I have hundreds of extensions enabled and that this crash does not occur every time I startup VSCode, means that it is impossible to determine which extension caused it.

It seems like this may relate to a timing or extension update/activation/interdependency issue, as detailed in #79782, which needs to be addressed in code VSCode or Extension Host code instead of being any specific extension or something that can be fixed or worked around reliably by any extension. Even core Microsoft official extensions like Live Share Audio are aware but have mentioned they are unable to fix any time soon and others who are aware of it and have fixed it but keep having the issue reoccur despite this temporary workarounds. And there are 800+ bug reports across various extensions regarding this issue, recently, as all detailed in #79782.

Errors in Developer Tools

These errors are only shown in Developer Tools. No time stamps. And they do not appear on any of the log files on disk, as detailed above. Also, the issue reporter was unable to gather/submit this.

image

Developer Tools Saved Log File

Though the log folder doesn't show the error, I saved this log file from Developer Tools (after I enabled all Log Levels, manually expanded each log entry, and then saved to file) which at least shows the crash error (only place shown, not logged to disk anywhere, and only shown if show Dev Tools or Restart Extension Host I believe), plus associated zipped log folder (which fails to include that or any other error related to the crash it seems).

Non-Crash Logs for Comparison

For comparison as a control case, here is a log file I had saved from Dev Tools (also after expanding all items, with all log levels enabled) and the associated zipped log folder, created during a session right after the crash.

For that 2nd case, I had launched VSCode the same way (opening the same .txt file) and waited a minute for all extensions to load, which happened fine, without any crash. This shows how this may be some kind of timing related or seemingly randomly occurring issue with the Extension Host, not something that reliably occurs due to one broken extension. Also, due to failed logging issues, this may help you to identify what extension might have caused the crash by what extension activations, etc. occurred after logging had stopped during the crash case.

The below zipped log folder is from a session about 1 hour prior to the one where the crash had occurred. This may help identify if there is some issue related to leftover/deferred to next startup/incomplete extension updating for example, considering what seemed to be some of that occurring in the log files.

Many Empty Log Folders Being Created and Left Over

Strangely, like shown in the below screenshot of File Explorer, there were 6 empty log folders (which keep getting created and never cleaned up) which were created before I closed VSCode since the log folder first created on VSCode startup for this crash session.

You might want to also consider fixing that as well. With auto-cleanup or preventing those empty log folders from being created in the first place, as they make it hard to find the needed log files. Also, they might indicate some other issue with logging failing to occur.

image

My Platform and Configuration

  • Visual Studio Code v1.37.1 (user setup)
  • Windows 10 x64 Pro (Windows NT x64 10.0.18362)
  • Startup Command line args: "C:\Users\Dan\AppData\Local\Programs\Microsoft VS Code\Code.exe" "C:\Users\Dan\Backups\Firefox\Dev\LinkedHelper\build_cloud\manifest.json"
  • Electron: 4.27
  • Chrome: 69.0.3497.128
  • Node.js: 10.11.0
  • V8: 6.9.427.31-electron.0
  • Live Server (ritwickdey.liveserver) extension v5.6.1

VS Code version: Code 1.37.1 (f06011a, 2019-08-15T16:17:55.855Z)
OS version: Windows_NT x64 10.0.18362

Extensions Enabled and System Info from Issue Reporter

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.95GB (17.43GB free)
Process Argv C:\Users\Dan\Backups\Firefox\Dev\LinkedHelper\build_cloud\manifest.json
Screen Reader no
VM 0%
Extensions (166)
Extension Author (truncated) Version
livs abh 1.0.6
html-snippets abu 0.2.1
vscode-caniuse aga 0.5.0
Bookmarks ale 10.5.0
todo-pusher Ale 0.0.2
tsco alj 1.0.12
vbscript-language-server-client and 1.0.3
vscode-json and 1.5.0
ng-template Ang 0.802.3
vscode-node-readme ben 3.0.2
unique-lines bib 1.0.0
autofoldyeah bob 1.0.6
simple-react-snippets bur 1.2.2
vscode-typescript-refactors can 0.0.22
cs2ts-vscode-extension chi 0.2.1
refactor-jsx chi 0.0.1
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
regex chr 0.2.0
jsrefactor cms 2.18.2
dakara-foldplus dak 1.3.2
autoit Dam 0.2.3
angular2-snippets dan 1.0.21
vbscript Dar 1.0.4
vscode-markdownlint Dav 0.30.2
jshint dba 0.10.21
vscode-eslint dba 1.9.1
jsx-path-refactor Den 0.0.1
vscode-npm-source dku 1.0.0
docs-article-templates doc 0.2.7
docs-authoring-pack doc 0.1.2
docs-markdown doc 0.2.16
docs-preview doc 0.3.29
docs-yaml doc 0.2.3
auto-open-html-preview Don 1.0.2
auto-open-markdown-preview-single Don 1.0.0
jquerysnippets don 0.0.1
xml Dot 2.5.0
vscode-generate-getter-setter DSK 0.5.0
es7-react-js-snippets dsz 2.4.3
gitlens eam 9.9.3
vscode-html-css ecm 0.2.3
EditorConfig Edi 0.13.0
vscode-npm-script eg2 0.3.8
windows-explorer-context-menu ele 2.0.0
react-native-react-redux EQu 2.0.3
json-tools eri 1.0.2
prettier-vscode esb 2.2.2
git-project-manager fel 1.7.1
php-debug fel 1.13.0
file-icons fil 1.0.19
vscode-firefox-debug fir 2.1.0
vscode-npm fkn 3.3.0
flow-for-vscode flo 1.3.0
code-runner for 0.9.14
html-preview-vscode geo 0.2.5
json2ts Gre 0.0.6
todo-tree Gru 0.0.143
npm-dependency-links her 1.0.1
vscode-trello-viewer Ho- 0.6.0
vscode-npm-dependency how 1.2.2
rest-client hum 0.22.0
npm-ui imb 0.0.3
reg ion 1.0.1
fontawesome-autocomplete Jan 0.1.8
search-node-modules jas 1.3.0
copy-markdown-as-html jer 1.1.0
angular-essentials joh 0.6.3
Angular2 joh 8.1.1
vscode-peacock joh 3.1.5
office-ui-fabric-react-snippets jor 1.1.7
fuzzy-definitions jri 0.0.3
react-native-snippet jun 0.5.4
favorites kdc 2.4.5
vscode-codemetrics kis 1.20.0
vscode-gutter-preview kis 0.22.3
tag-rename kri 0.2.1
node-module-intellisense lei 1.5.0
ts-extension-pack loi 0.2.0
scss-refactoring luk 0.1.4
template-string-expander map 0.0.3
vscode-mocha-sidebar mat 0.22.2
font-awesome-codes-css med 0.1.1
font-awesome-codes-html med 0.0.7
vscode-language-babel mgm 0.0.23
Angular-BeastCode Mik 8.0.10
vscode-exec-node mir 0.5.1
goto-next-previous-member mis 0.0.5
auto-npm-install mos 1.0.17
vscode-autoprefixer mrm 2.2.0
azure-pipelines ms- 1.155.0
azurerm-vscode-tools msa 0.6.0
vscode-apimanagement ms- 0.1.1
vscode-azureappservice ms- 0.15.0
vscode-azurefunctions ms- 0.18.1
vscode-azurestorage ms- 0.7.1
vscode-cosmosdb ms- 0.10.2
vscode-docker ms- 0.7.0
mssql ms- 1.6.0
python ms- 2019.8.30787
vscode-ai ms- 0.6.2
azure-account ms- 0.8.4
azurecli ms- 0.4.6
cpptools ms- 0.25.1
csharp ms- 1.21.1
github-issues-prs ms- 0.9.1
powershell ms- 2019.5.0
vs-keybindings ms- 0.2.0
vscode-node-azure-pack ms- 0.0.9
vscode-typescript-tslint-plugin ms- 1.2.2
vsliveshare ms- 1.0.752
vsliveshare-audio ms- 0.1.64
vsliveshare-pack ms- 0.3.3
debugger-for-chrome msj 4.11.7
debugger-for-edge msj 1.0.11
vscode-react-native msj 0.11.0
angular2-inline nat 0.0.17
vscode-json-editor nic 0.2.3
gulptasks nic 1.3.1
vscode-for-node-js-development-pack nod 2.0.1
angular-console nrw 8.1.1
vscode-extension-auto-import Nuc 1.4.3
convert-css-in-js pau 1.1.3
vscode-versionlens pfl 0.24.0
material-icon-theme PKi 3.9.0
tsimporter pmn 2.0.1
vscode-css-peek pra 3.0.2
php-class-helper pre 0.1.8
typescript-mono-repo-import-helper q 0.0.6
qub-msbuild qub 0.6.3
quicktype qui 12.0.46
typescript-hero rbb 3.0.0
vscode-yaml red 0.5.2
easy-compile ref 1.1.3
vscode-format rya 0.0.6
comment-ts sal 0.9.11
yo sam 0.9.3
react-component-refactor san 0.2.0
bracket-jumper sas 1.1.8
vscode-javascript-booster sbu 0.11.0
powerquerymlanguage sea 1.0.0
code-settings-sync Sha 3.4.2
gitconfig sid 2.0.1
vs-code-office-ui-fabric siv 0.1.7
vba sky 2.8.0
vscode-hexdump sle 1.7.2
vba spe 1.2.0
vba-snippets spe 1.0.1
vscode-vba-icons spe 1.0.2
spremoteapi Ste 1.5.2
code-spell-checker str 1.7.18
move-ts str 1.11.5
vscode-make tec 1.0.2
theshukran-react-utils the 1.0.2
sort-lines Tyr 1.8.0
vscodeintellicode Vis 1.1.9
azure-iot-toolkit vsc 2.10.0
nodejs-extension-pack wad 0.1.9
quokka-vscode Wal 1.0.240
full-react-snippets wal 1.3.0
vscode-todo-highlight way 1.0.4
vscode-import-cost wix 2.12.0
save-and-run wk- 0.0.21
JavaScriptSnippets xab 1.7.2
firefox-debug yur 0.1.0
markdown-all-in-one yzh 2.4.2

(1 theme extensions excluded)

@Ferrzo
Copy link

Ferrzo commented Sep 2, 2019

Hi @PowerAccess I just had the same problem, I disabled "Angular console" and it started to work again.

@PowerWeb5
Copy link
Author

PowerWeb5 commented Sep 4, 2019 via email

@alexdima
Copy link
Member

alexdima commented Sep 9, 2019

Here is what I can piece together from your issue.

From your dev tools screenshot, the extension host process crashes with the exit code 2147483649. That is 0x80000001, but I could not find any relevant hits online. Any of the extensions you load can load up C++ code which could call exit(0x80000001).

From the extension host log, the extension host (at the time of crashing) has code executing from the following extensions:

vscode.configuration-editing
vscode.extension-editing
vscode.json-language-features
vscode.npm
eg2.vscode-npm-script
msazurermtools.azurerm-vscode-tools
nickdemayo.vscode-json-editor
pflannery.vscode-versionlens
vscode.debug-auto-launch
vscode.emmet
vscode.git
vscode.merge-conflict
alefragnani.Bookmarks
andyyaldoo.vscode-json
bobmagicii.autofoldyeah
christian-kohler.path-intellisense
dbaeumer.vscode-eslint
docsmsft.docs-article-templates
eamodio.gitlens
EditorConfig.EditorConfig
esbenp.prettier-vscode
Gruntfuggly.todo-tree
herrmannplatz.npm-dependency-links
Ho-Wan.vscode-trello-viewer
ionutvmi.reg
Janne252.fontawesome-autocomplete
johnpapa.vscode-peacock
kdcro101.favorites
kisstkondoros.vscode-codemetrics
kisstkondoros.vscode-gutter-preview
maty.vscode-mocha-sidebar
mishkinf.goto-next-previous-member
ms-azure-devops.azure-pipelines
ms-vscode.cpptools
ms-vsliveshare.vsliveshare
nickdodd79.gulptasks
nrwl.angular-console
PKief.material-icon-theme

Do you have any steps that reliably reproduce the crash?

@alexdima alexdima added the info-needed Issue requires more information from poster label Sep 9, 2019
@PowerWeb5
Copy link
Author

I had Extension Host crashed yet again today on startup.

There are no steps that can be taken to forcibly reproduce this. It occurs seemingly randomly, every few days, whether or not opening VS Code in the same way and performing the same steps. It will only occur once on a day it occurs. It will not occur again until a few days later. And despite opening under the same conditions for the same file or type of file, and only if I leave it open for about a minute or so at least.

Considering this, I suspect it may relate to extensions being updated.

The only common entry I noticed for extensions that were being updated was the following found in sharedprocess.log for the crash today and the previous crash, respectively.

[2019-09-09 12:44:08.769] [sharedprocess] [info] Deleted from disk ms-vsliveshare.vsliveshare c:\Users\Dan\.vscode\extensions\ms-vsliveshare.vsliveshare-1.0.752

[2019-08-31 15:05:30.560] [sharedprocess] [info] Deleted from disk ms-vsliveshare.vsliveshare c:\Users\Dan\.vscode\extensions\ms-vsliveshare.vsliveshare-1.0.721

According to the Visual Studio Code Live Share extension releases page on GitHub (https://github.com/MicrosoftDocs/live-share/releases) (unlike the published Changelog on VS Marketplace which is rarely updated: https://marketplace.visualstudio.com/items/MS-vsliveshare.vsliveshare/changelog), this crash occurred within a few days of the Live Share extension update being a released, in each case.
https://github.com/MicrosoftDocs/live-share/releases

This time I just opened VS Code directly instead of using to open a .md file like last time. However, I noticed that it auto opened an unsaved workspace and it may or may not have done so last time as well.

I noticed that "sharedprocess.log" always ends with the following line (followed by an empty line):
[2019-09-09 12:44:47.568] [sharedprocess] [info] Starting to clean up unused language packs.
Do you think that may be relevant or is that typically always the case?

This crash occurred despite my having disabled the following extensions (known to sometimes cause these crashes) a number of days prior to this having occurred.

  • Live Share Audio
  • Live Server
  • Live Share Chat

I will now try disabling "Live Share" extension and see if ends crashing the extension host on startup still, and fails to prevent it after the next Live Share extension release occurs, as I suspect it might be related to Live Share extension being updated.
Live Share is one of the extensions I'd seen many Extension Host crash reports for, in addition to other extensions I'd disabled already.

@PowerWeb5
Copy link
Author

Logs for New Crash Today

For the new extension host crash that occurred today, I have included Debug Console screenshot and copy-pasted text as well as a zip file which includes the logs/ subfolder as well as a few other files such as operation_log.txt and the exthost-d3aade.cpuprofile file it references.

20190909T124404-crash-new.zip

Different Error Code for New Crash

In this case there is a new error shown:
"WARN UNRESPONSIVE extension host, 'refgd.easy-compile' took 30% of 5282.14ms, saved PROFILE here: 'C:\Users\Dan\AppData\Local\Temp\exthost-d3aade.cpuprofile'"

However, that occurs after the extension host crash, and didn't show up in any of the many other crashes cases previously, from what I recall.

In this case, extension host crashed with a different exit code of 3221225477 (which I believe is 0xC0000005 for "Access Violation"). Yet another generic error code, and not even consistent in which one occurs.

For reference, this crash occurred at 12:44 PM (or possibly 12:45 PM) 9/9/2019 PDT, within a minute of opening VSCode.

Debug Console Screenshot for New Crash

image

Debug Console Text for New Crash

[abhiagr.livs]: Command extension.launchInVS appears multiple times in the commands section.
/C:/Users/Dan/AppDat…esktop.main.js:3424 [docsmsft.docs-markdown]: Command applyTemplate appears multiple times in the commands section.
/C:/Users/Dan/AppDat…esktop.main.js:3424 [fknop.vscode-npm]: Command npm-script.start appears multiple times in the commands section.
/C:/Users/Dan/AppDat…esktop.main.js:3424 [fknop.vscode-npm]: Command npm-script.test appears multiple times in the commands section.
/C:/Users/Dan/AppDat…esktop.main.js:3424 [fknop.vscode-npm]: Command npm-script.init appears multiple times in the commands section.
/C:/Users/Dan/AppDat…esktop.main.js:3424 [maty.vscode-mocha-sidebar]: Command mocha-maty.runAllTests appears multiple times in the commands section.
/C:/Users/Dan/AppDat…esktop.main.js:3424 [medzhidov.font-awesome-codes-css]: Unknown language in contributes.font-awesome-codes-css.language. Provided value: sass
_logMessageInConsole @ /C:/Users/Dan/AppDat…esktop.main.js:3424
/C:/Users/Dan/AppDat…esktop.main.js:3424 [medzhidov.font-awesome-codes-html]: Unknown language in contributes.font-awesome-codes-html.language. Provided value: pug
_logMessageInConsole @ /C:/Users/Dan/AppDat…esktop.main.js:3424
/C:/Users/Dan/AppDat…esktop.main.js:3424 [medzhidov.font-awesome-codes-html]: Unknown language in contributes.font-awesome-codes-html.language. Provided value: ejs
_logMessageInConsole @ /C:/Users/Dan/AppDat…esktop.main.js:3424
/C:/Users/Dan/AppDat…esktop.main.js:3424 [spences10.vba-snippets]: Unknown language in contributes.vba-snippets.language. Provided value: vbscript
_logMessageInConsole @ /C:/Users/Dan/AppDat…esktop.main.js:3424
/C:/Users/Dan/AppDat…esktop.main.js:3424 [xabikos.JavaScriptSnippets]: Unknown language in contributes.JavaScriptSnippets.language. Provided value: vue
_logMessageInConsole @ /C:/Users/Dan/AppDat…esktop.main.js:3424
/C:/Users/Dan/AppDat…esktop.main.js:4165 Overwriting grammar scope name to file mapping for scope source.js. Old grammar file: file:///c%3A/Users/Dan/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/javascript/syntaxes/JavaScript.tmLanguage.json. New grammar file: file:///c%3A/Users/Dan/.vscode/extensions/mgmcdermott.vscode-language-babel-0.0.23/grammars/Babel-Language.json
/C:/Users/Dan/AppDat…esktop.main.js:4165 Overwriting grammar scope name to file mapping for scope source.yaml. Old grammar file: file:///c%3A/Users/Dan/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json. New grammar file: file:///c%3A/Users/Dan/.vscode/extensions/ms-azure-devops.azure-pipelines-1.157.1/syntaxes/yaml.tmLanguage.json
/C:/Users/Dan/AppDat…esktop.main.js:4165 Overwriting grammar scope name to file mapping for scope source.sql. Old grammar file: file:///c%3A/Users/Dan/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/sql/syntaxes/sql.tmLanguage.json. New grammar file: file:///c%3A/Users/Dan/.vscode/extensions/ms-mssql.mssql-1.6.0/syntaxes/SQL.plist
/C:/Users/Dan/AppDat…esktop.main.js:4165 Overwriting grammar scope name to file mapping for scope source.yaml. Old grammar file: file:///c%3A/Users/Dan/.vscode/extensions/ms-azure-devops.azure-pipelines-1.157.1/syntaxes/yaml.tmLanguage.json. New grammar file: file:///c%3A/Users/Dan/.vscode/extensions/redhat.vscode-yaml-0.5.2/syntaxes/yaml.tmLanguage.json
register @ /C:/Users/Dan/AppDat…esktop.main.js:4165
/C:/Users/Dan/AppDat…esktop.main.js:3579 [Extension Host] debugger listening on port 53016
/C:/Users/Dan/AppDat…esktop.main.js:3577 Extension Host
/C:/Users/Dan/AppDat…esktop.main.js:3420 Extension host terminated unexpectedly. Code: 3221225477 Signal: null
_onExtensionHostCrashed @ /C:/Users/Dan/AppDat…esktop.main.js:3420
/C:/Users/Dan/AppDat…esktop.main.js:2542 Extension host terminated unexpectedly.
onDidNotificationChange @ /C:/Users/Dan/AppDat…esktop.main.js:2542
/C:/Users/Dan/AppDat…esktop.main.js:1504 WARN UNRESPONSIVE extension host, 'refgd.easy-compile' took 30% of 5282.14ms, saved PROFILE here: 'C:\Users\Dan\AppData\Local\Temp\exthost-d3aade.cpuprofile'
1. Array(26)
1. 0: {id: "agauniyal.vscode-caniuse", total: 71702, percentage: 1}
2. 1: {id: "alefragnani.Bookmarks", total: 1097, percentage: 0}
3. 2: {id: "andyyaldoo.vscode-json", total: 30788, percentage: 1}
4. 3: {id: "bobmagicii.autofoldyeah", total: 227, percentage: 0}
5. 4: {id: "christian-kohler.path-intellisense", total: 42861, percentage: 1}
6. 5: {id: "dbaeumer.jshint", total: 168375, percentage: 3}
7. 6: {id: "dbaeumer.vscode-eslint", total: 2864, percentage: 0}
8. 7: {id: "docsmsft.docs-article-templates", total: 477794, percentage: 9}
9. 8: {id: "Donaldtone.auto-open-html-preview", total: 245, percentage: 0}
10. 9: {id: "eamodio.gitlens", total: 15037, percentage: 0}
11. 10: {id: "EditorConfig.EditorConfig", total: 74524, percentage: 1}
12. 11: {id: "esbenp.prettier-vscode", total: 24133, percentage: 0}
13. 12: {id: "gc", total: 55049, percentage: 1}
14. 13: {id: "george-alisson.html-preview-vscode", total: 859636, percentage: 16}
15. 14: {id: "krizzdewizz.tag-rename", total: 173310, percentage: 3}
16. 15: {id: "program", total: 14526, percentage: 0}
17. 16: {id: "refgd.easy-compile", total: 1593285, percentage: 30}
18. 17: {id: "sburg.vscode-javascript-booster", total: 167534, percentage: 3}
19. 18: {id: "self", total: 880183, percentage: 17}
20. 19: {id: "VisualStudioExptTeam.vscodeintellicode", total: 22272, percentage: 0}
21. 20: {id: "vscode.debug-auto-launch", total: 1573, percentage: 0}
22. 21: {id: "vscode.emmet", total: 3588, percentage: 0}
23. 22: {id: "vscode.git", total: 8216, percentage: 0}
24. 23: {id: "vscode.html-language-features", total: 4410, percentage: 0}
25. 24: {id: "vscode.merge-conflict", total: 2946, percentage: 0}
26. 25: {id: "wix.vscode-import-cost", total: 585679, percentage: 11}
27. length: 26
28. proto: Array(0)
dom.ts:215 [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
A @ dom.ts:215
g @ dom.ts:235
_setListeningToMouseWheel @ scrollableElement.ts:320
v @ scrollableElement.ts:219
S @ scrollableElement.ts:507
a @ editorScrollbar.ts:54
z @ viewImpl.ts:143
_createView @ codeEditorWidget.ts:1465
_attachModel @ codeEditorWidget.ts:1361
setModel @ codeEditorWidget.ts:418
(anonymous) @ textFileEditor.ts:154
r @ errors.ts:199
_tickCallback @ internal/process/next_tick.js:68
dom.ts:215 [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
A @ dom.ts:215
g @ dom.ts:235
m @ mouseHandler.ts:126
d @ pointerHandler.ts:191
h @ pointerHandler.ts:225
z @ viewImpl.ts:224
_createView @ codeEditorWidget.ts:1465
_attachModel @ codeEditorWidget.ts:1361
setModel @ codeEditorWidget.ts:418
(anonymous) @ textFileEditor.ts:154
r @ errors.ts:199
_tickCallback @ internal/process/next_tick.js:68

(Many more similar "[Violation] Added non-passive event listener " omitted here).

@PowerWeb5
Copy link
Author

How to Get More Details with Error Missing In Log Files

In what log files can I look to find "_onExtensionHostCrashed" and the exit code you had mentioned or any kind of details regarding the extension host crash?
There is no error of any kind related to the extension host crash logged in Roaming/Code/logs folders or anywhere else I can find on disk, neither while VSCode is still running nor after closing it.
Even starting the Dev Tools, Submitting Report via VSCode, etc. still I can't find any reference except in the Dev Tools themselves.

Will enabling "Preserve Log" in Console help ensuring logging to files?

Is there an additional dump / crash report I can generate or locate when this next occurs that will be helpful?
Would the folder of .code files under Roaming\Code\CachedData\ for a session when VSCode crashes be of any use?

Is there any way to enable more details to be logged about these crashes such as with additional logging options enabled? It seems absurd that there is no way to identify which extension might be running code that could cause the crash, due to lack of isolation or otherwise, especially when allowing extensions to run native code.

Also, is there a way to enable Time Stamps to be shown in the Dev Tools or in whatever log file (if any) the Extension Host crash, etc. log entries might be able to be output to?

@PowerWeb5
Copy link
Author

PowerWeb5 commented Sep 9, 2019

@kief @alexandrudima

Live Share Extension Update Seems to Cause the Extension Host Crash

As detailed in my previous comment, it seems that the Visual Studio Code Extension Host crashes during or immediately after updating the Live Share extension.

However, the Live Share extension activation doesn't actually appear in the exthost log file, only the updating does.

Other References to Extension Updates (eg. with Live Share) Causing Host Crash

Other references to Live Share (or Live Share Audio) causing Extension Host crashes after being updated:

  1. Stuck "Downloading dependencies: Finishing VS Live Share installation..." live-share#2071 (comment)
  2. Extension host terminated unexpectedly. #75267 (comment)
  3. [VS Code] [Audio] Extension host terminated unexpectedly live-share#1510

According that 3rd related report, this issue isn't even planning to be addressed any time soon from the extension developers (possibly because it seems to be a reoccurring issue, with many reports going on for some time now, as described in #79782)

No Live Share Extension Activation In Log

Though it seems like the most recent cause of VSCode Extension Host crash is when Live Share extension gets updated, there doesn't seem to be any activation in the exthost log file.

Possible Causes

Considering that, it seems like either:

A. The crash prevents the activation from getting logged
B. The crash occurs during VSCode's core extension update logic instead of extension-specific code

In either case, it seems like something that may need to be addressed in core VSCode vs. extension-specific fixes, especially since, from what I'd reported in #79782 (with links to other related issue reports for various extensions), this issue keeps reoccurring for extensions once fixed temporarily.

Extension Activation and Errors Not Found in Logs (Making Nearly Impossible for Users to Identify and Disable Even as a Workaround)

Also, the extension causing the crash doesn't appear in logs (for its activation or any extension-specific logging or otherwise, at least not beyond log entries for updating it), making this even harder to identify and fix what is causing it, and making it impossible for users to determine and disable the extension causing this to get VSCode to stop crashing on startup many of the times they launch it (especially since can't even just try disabling one-by-one to determine by process of elimination since doesn't occur on every startup, as mentioned in #79782).

Extension Timing or Dependency Issues?

Also, I'd seen mention in some related reports of this possibly being related to inter-dependencies between extensions or timing issues related in updating and/or activating them.

Reliability & Logging Improvements/Fixes in VS Code Core/Extension Host

Are there changes that can be made to fix the underlying cause or minimize the frequency of Extension Host crashing, or at least to enable logging which extension is likely to be the cause, as well as to log the extension host crash itself to files (which as mentioned seems to be missing from any logs saved to disk), and to auto-restart the extension host (vs. always prompting the user to do so) when does repeatedly occur.

I'd summarized in #79782 a few specific suggestions related to that, based on a review of many related issue reports across different extensions.

Extension Isolation

Also, is Extension isolation, like I'd proposed in #52116 (along with details on some options and projects that may be able to help provide support for that, as has been used successfully with Electron-based applications, and as I'd suggested in #79782 how that could help with reliability even more than security) something that could be considered as well?

@alexdima
Copy link
Member

From the latest crash, here are the extensions that were loaded:

Latest extensions activated
agauniyal.vscode-caniuse
alefragnani.Bookmarks
andyyaldoo.vscode-json
Angular.ng-template
bobmagicii.autofoldyeah
cancerberosgx.vscode-typescript-refactors
christian-kohler.npm-intellisense
christian-kohler.path-intellisense
chrmarti.regex
dbaeumer.jshint
dbaeumer.vscode-eslint
docsmsft.docs-article-templates
Donaldtone.auto-open-html-preview
DSKWRK.vscode-generate-getter-setter
eamodio.gitlens
ecmel.vscode-html-css
EditorConfig.EditorConfig
eg2.vscode-npm-script
george-alisson.html-preview-vscode
kisstkondoros.vscode-codemetrics
krizzdewizz.tag-rename
leizongmin.node-module-intellisense
moshfeu.auto-npm-install
ms-vscode.vscode-typescript-tslint-plugin
msazurermtools.azurerm-vscode-tools
natewallace.angular2-inline
nickdemayo.vscode-json-editor
NuclleaR.vscode-extension-auto-import
paulmolluzzo.convert-css-in-js
pflannery.vscode-versionlens
pmneo.tsimporter
predrag-nikolic.php-class-helper
q.typescript-mono-repo-import-helper
rbbit.typescript-hero
refgd.easy-compile
sburg.vscode-javascript-booster
VisualStudioExptTeam.vscodeintellicode
vscode.configuration-editing
vscode.debug-auto-launch
vscode.emmet
vscode.extension-editing
vscode.git
vscode.html-language-features
vscode.json-language-features
vscode.merge-conflict
vscode.npm
vscode.typescript-language-features
wix.vscode-import-cost

Here are the extensions that were running code in the extension host for both crashes:

alefragnani.Bookmarks
andyyaldoo.vscode-json
bobmagicii.autofoldyeah
christian-kohler.path-intellisense
dbaeumer.vscode-eslint
docsmsft.docs-article-templates
eamodio.gitlens
EditorConfig.EditorConfig
eg2.vscode-npm-script
kisstkondoros.vscode-codemetrics
msazurermtools.azurerm-vscode-tools
nickdemayo.vscode-json-editor
pflannery.vscode-versionlens
vscode.configuration-editing
vscode.debug-auto-launch
vscode.emmet
vscode.extension-editing
vscode.git
vscode.json-language-features
vscode.merge-conflict
vscode.npm

What I find interesting is both log files end abruptly with ExtensionService#_doActivateExtension which makes no sense to me.

@sandy081

  • is it possible that the log is missing data/incomplete? Is spdlog flushing to disk after each log statement? because we might be focusing on the wrong extensions if the log is missing output...
  • here is the code in question:
    this._logService.info(`ExtensionService#_doActivateExtension ${extensionDescription.identifier.value} ${JSON.stringify(reason)}`);
    const activationTimesBuilder = new ExtensionActivationTimesBuilder(reason.startup);
    return Promise.all([
    this._loadCommonJSModule<IExtensionModule>(joinPath(extensionDescription.extensionLocation, extensionDescription.main), activationTimesBuilder),
    • it logs ExtensionService#_doActivateExtension
    • it instantiates a ExtensionActivationTimesBuilder instance (which has basically no code...)
    • it invokes this._loadCommonJSModule
    • that one basically immediately logs ExtensionService#loadCommonJSModule
      this._logService.info(`ExtensionService#loadCommonJSModule ${module.toString(true)}`);

There is no yielding or any undeterministic calls in between those two log statements, yet by looking at the log file, it appears the crash occurs in between them, which I cannot really imagine...

@PowerWeb5
Copy link
Author

@alexandrudima
I have had the Extension Host crash every time (for as far back as I've checked) after a Live Share extension update was released.
Also, the only common denominator seen between the most recent 2 crashes related to extension updated or found in sharedprocess.log was "Deleted from disk ms-vsliveshare.vsliveshare" (no other extensions were mentioned there in both of those log files).

In most recent crash in sharedprocess.log
[2019-09-09 12:44:08.769] [sharedprocess] [info] Deleted from disk ms-vsliveshare.vsliveshare c:\Users\Dan\.vscode\extensions\ms-vsliveshare.vsliveshare-1.0.752

In the crash before that in sharedprocess.log
[2019-08-31 15:05:30.560] [sharedprocess] [info] Deleted from disk ms-vsliveshare.vsliveshare c:\Users\Dan\.vscode\extensions\ms-vsliveshare.vsliveshare-1.0.721

Therefore it seems like the crash may occur whenever Live Share extension gets updated, occurring once until the next time it's updated.
It might not even occur due to activation of that extension (is it even supposed to be activated on startup or JIT when used?) just due to extension updating install or cleanup. Or it could be that the activation is missing from the log files (which seem to end abruptly and which don't even include the extension host termination error in them either).

Also, in what log file, if any, should the extension host termination error be found?
It only ever appears in Dev Tools (once I show them after prompted by the crash message), and is not found in any log file on disk (even after waiting for all code.exe processes to exit). That seems like something that should be fixed as well.

@PowerWeb5
Copy link
Author

I'd referred to a few issues where others reported Extension host terminating when Live Share or Live Share Audio extension (or update) installation occurs, with install/updating failing to complete successfully with failure to install binary dependencies. Those include:

@sandy081
Copy link
Member

@alexandrudima

is it possible that the log is missing data/incomplete? Is spdlog flushing to disk after each log statement? because we might be focusing on the wrong extensions if the log is missing output...

Flush happens at an interval of 500ms. It also flushes when the log service is disposed. Since it is a crash here I assume that last log statement would have been not written.

@alexdima
Copy link
Member

@sandy081 Is there a way to execute such that we flush after each log statement? Because otherwise we never know what really happens in case of crashes.

@maa3x
Copy link

maa3x commented Sep 11, 2019

Related #79116

@winrey
Copy link

winrey commented Sep 12, 2019

This problem bother me for a long time.......

The VS code's extension host will crush when startup and be recovery after restart the host several times.

It would be more better if we can get the info of which of the extension cause this by the console.

@winrey
Copy link

winrey commented Sep 12, 2019

BTW, the problem seems occurs after I install a series extensions of MS Remote but I'm not sure about that.

@alexdima
Copy link
Member

The current tooling we have around the extension host is making troubleshooting such crashes difficult. I've created #80862 and #80858 to improve things

@PowerWeb5
Copy link
Author

Though the frequency seems to reduce after disabling the VS Live Share extension, I just got another Extension Host terminated crash on startup again despite that, with another extension.

Related to Extension Updates or Language Packs?

Is there any chance this may be related to install/updating of extensions more than activation of them?
As mentioned, I have encountered the extension host crash every time I opened VS Code ever after VS Live Share extension update was released and the only common denominator seen in log files was that the update for that was installed or was cleaned up on startup before the extension host crashed.
Also, sharedprocess.log ends in "Starting to clean up unused language packs." (without any cleanup finished log statement, which I would suggest be added if not being logged).

And, as seen in the 2nd screenshot of Console Log which is shown after I opened a .txt file in VS Code after the crash occurred, there are a number of errors related to missing language packs and I had seen some of those in the log files for logs that occurred before the crash too.

Screenshots

image

Log Files

.zip of logs folder + an operation_log.txt also found under

Console Errors

image

[abhiagr.livs]: Command `extension.launchInVS` appears multiple times in the `commands` section.
abstractExtensionService.ts:395 [docsmsft.docs-markdown]: Command `applyTemplate` appears multiple times in the `commands` section.
abstractExtensionService.ts:395 [fknop.vscode-npm]: Command `npm-script.start` appears multiple times in the `commands` section.
abstractExtensionService.ts:395 [fknop.vscode-npm]: Command `npm-script.test` appears multiple times in the `commands` section.
abstractExtensionService.ts:395 [fknop.vscode-npm]: Command `npm-script.init` appears multiple times in the `commands` section.
abstractExtensionService.ts:395 [maty.vscode-mocha-sidebar]: Command `mocha-maty.runAllTests` appears multiple times in the `commands` section.
TMScopeRegistry.ts:45 Overwriting grammar scope name to file mapping for scope source.yaml.
Old grammar file: file:///c%3A/Users/Dan/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json.
New grammar file: file:///c%3A/Users/Dan/.vscode/extensions/ms-azure-devops.azure-pipelines-1.157.3/syntaxes/yaml.tmLanguage.json
register @ TMScopeRegistry.ts:45
TMScopeRegistry.ts:45 Overwriting grammar scope name to file mapping for scope source.sql.
Old grammar file: file:///c%3A/Users/Dan/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/sql/syntaxes/sql.tmLanguage.json.
New grammar file: file:///c%3A/Users/Dan/.vscode/extensions/ms-mssql.mssql-1.6.0/syntaxes/SQL.plist
register @ TMScopeRegistry.ts:45
TMScopeRegistry.ts:45 Overwriting grammar scope name to file mapping for scope source.yaml.
Old grammar file: file:///c%3A/Users/Dan/.vscode/extensions/ms-azure-devops.azure-pipelines-1.157.3/syntaxes/yaml.tmLanguage.json.
New grammar file: file:///c%3A/Users/Dan/.vscode/extensions/redhat.vscode-yaml-0.5.3/syntaxes/yaml.tmLanguage.json
register @ TMScopeRegistry.ts:45
extensionHost.ts:294 [Extension Host] debugger listening on port 11702
extensionHost.ts:202 Extension Host
extensionHost.ts:203 Debugger attached.
abstractExtensionService.ts:154 Extension host terminated unexpectedly. Code:  2147483649  Signal:  null
_onExtensionHostCrashed @ abstractExtensionService.ts:154
notificationsAlerts.ts:40 Extension host terminated unexpectedly.
onDidNotificationChange @ notificationsAlerts.ts:40
log.ts:173   ERR not opened: Error: not opened
    at WebSocket.send (c:\Users\Dan\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\chrome-remote-interface\node_modules\ws\lib\WebSocket.js:359:18)
    at Chrome._enqueueCommand (c:\Users\Dan\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\chrome-remote-interface\lib\chrome.js:270:18)
    at Promise (c:\Users\Dan\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\chrome-remote-interface\lib\chrome.js:84:22)
    at new Promise (<anonymous>)
    at Chrome.send (c:\Users\Dan\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\chrome-remote-interface\lib\chrome.js:83:20)
    at Object.handler [as stop] (c:\Users\Dan\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\chrome-remote-interface\lib\api.js:32:23)
    at Object.stop (c:\Users\Dan\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\v8-inspect-profiler\index.js:99:41)
    at d.<anonymous> (file:///C:/Users/Dan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3584:232)
    at Generator.next (<anonymous>)
    at file:///C:/Users/Dan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///C:/Users/Dan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at Object.stop (file:///C:/Users/Dan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3584:183)
    at w.<anonymous> (file:///C:/Users/Dan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3590:247)
    at Generator.next (<anonymous>)
    at r (file:///C:/Users/Dan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:35:399)

Additional Errors after Crash

I also found the following errors shown after the Extension Host crash during that same sessin as soon as I opened a .log text file in VS Code (as no file was opened when launched VS code), which I wonder if relate to language pack registration/clean/updating/installation?

image

@winrey
Copy link

winrey commented Sep 25, 2019

I tried to diasble the Live Shared from MS.
And it doesn't crash again until now.

@alexdima
Copy link
Member

@PowerSheetAI We now can trust our logging (because we flush after each log statement). Does the crash still occur for you?

@vscodebot vscodebot bot closed this as completed Mar 18, 2020
@vscodebot
Copy link

vscodebot bot commented Mar 18, 2020

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

7 participants