Skip to content

Insiders on macOS ARM64: Extension Host crashes (SIGILL, EFAULT, EPIPE) #113410

Description

Issue Type: Bug

I haven't seen this reported anywhere, so here goes.

Using the latest insiders version on macOS, I noticed that there are stability issues with extensions.

After some time running vscode, the extension host either crashes and needs to be restarted, or the code actions that trigger on saving a document start hanging.

I noticed that in the Developer Tools it frequently logs messages like:

Uncaught Exception:  Error: read EFAULT
    at Pipe.onStreamRead (internal/stream_base_commons.js:205:27)
t.log @ console.ts:137

Screenshot 2020-12-25 at 10 14 32

The EFAULT exceptions might be triggering this behavior.

This also hangs and spins forever:
Screenshot 2020-12-25 at 10 10 39

If I cancel it, then run Developer: Restart Extension Host it will then save properly.

(It's possible one of my extensions might be interfering as well, as I have a ton of them enabled - but I don't remember seeing this on Stable VSCode with Rosetta.)

VS Code version: Code - Insiders 1.53.0-insider (4a875e2, 2020-12-21T12:34:09.548Z)
OS version: Darwin arm64 20.2.0

System Info
Item Value
CPUs undefined
GPU Status 2d_canvas: 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) 2, 3, 3
Memory (System) 8.00GB (0.17GB free)
Process Argv --crash-reporter-id ea63df4b-e690-4545-96f3-6944dca865ad
Screen Reader no
VM 0%
Extensions (58)
Extension Author (truncated) Version
better-comments aar 2.1.0
vscode-base64 ada 0.1.0
vsc-rename-files alf 2.1.0
ng-template Ang 0.1100.2
vscode-color ans 0.4.5
vscode-apollo apo 1.18.0
vscode-zipfs arc 2.2.2
folder-source-actions bie 0.2.0
markdown-preview-github-styles bie 0.1.6
path-intellisense chr 2.3.0
react-toolkit Cod 1.1.23
angular-schematics cyr 4.7.0
vscode-eslint dba 2.1.14
emulate Die 1.4.0
es7-react-js-snippets dsz 3.1.0
gitlens eam 11.1.0
tsl-problem-matcher eam 0.3.1
prettier-vscode esb 5.8.0
vscode-todo-plus fab 4.18.0
flow-for-vscode flo 1.5.0
vscode-yarn gam 1.7.1
beautify Hoo 1.5.0
vscode-edit-csv jan 0.5.3
Angular2 joh 11.0.0
vscode-peacock joh 3.9.1
chat kar 0.35.0
graphql-for-vscode kum 1.15.3
vscode-wsl-workspacefolder lfu 1.1.2
ftp-sync luk 0.3.9
auto-barrel mik 1.7.1
dotenv mik 1.0.1
mongodb-vscode mon 0.3.0
vscode-csscomb mrm 5.3.2
vscode-docker ms- 1.9.0
vscode-edge-devtools ms- 1.1.1
remote-wsl ms- 0.52.0
vscode-js-profile-flame ms- 0.0.13
vsliveshare ms- 1.0.3375
vsliveshare-audio ms- 0.1.91
vsliveshare-pack ms- 0.4.0
debugger-for-chrome msj 4.12.11
vscode-react-native msj 1.2.0
angular2-inline nat 0.0.17
vscode-ios-common-files Ort 1.0.5
vscode-react-native-storybooks Ort 2.7.1
format-code-action roh 0.0.1
vscode-coverage-gutters rya 2.6.0
vscode-hexdump sle 1.8.1
move-ts str 1.12.0
theshukran-react-utils the 1.0.2
gitflow vec 1.2.1
es-quotes vil 0.2.6
vscodeintellicode Vis 1.2.10
vscode-wakatime Wak 4.0.10
vscode-html-pug-convertor way 0.1.1
vscode-ruby win 0.27.0
code-template-tool yua 0.6.2
sort-js-object-keys zen 1.0.6

(2 theme extensions excluded)

A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
openlogontheside:30221882
python763:30178808
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
python504:30227505
vswsl492:30208929
wsl2promptcf:30219163
vstry914:30230485
pythonvsdeb440:30224570
unusedpromptcf:30219165
folderexplorercf:30219167
openfilemenucf:30219169
pythonvsded773:30223139
core-portspanel:30233467

Activity

  1. andreialecu commented on Dec 25, 2020

    @andreialecu
    Author

    Possibly relevant, this is also in the developer tools log:

     WARN [File Watcher (chokidar)] Watcher is not using native fsevents library and is falling back to unefficient polling.
    
  2. andreialecu commented on Dec 25, 2020

    @andreialecu
    Author

    Also these from when Extension Host actually crashes:

    Screenshot 2020-12-25 at 10 22 39

  3. changed the title [-]Insiders on macOS ARM64: `Error: read EFAULT`[/-] [+]Insiders on macOS ARM64: Extension Host crashes (`SIGILL`, `EFAULT`, `EPIPE`)[/+] on Dec 25, 2020
  4. andreialecu commented on Dec 26, 2020

    @andreialecu
    Author

    One other error I've been seeing in developer tools prior to an Extension Host crash:

    ERR Request textDocument/codeAction failed with message: Cannot read .eslintignore file: /Users/andreialecu/Work/proj/.eslintignore
    Error: EFAULT: bad address in system call argument, read: Error: Request textDocument/codeAction failed with message: Cannot read .eslintignore file: /Users/andreialecu/Work/proj/.eslintignore
    Error: EFAULT: bad address in system call argument, read
    	at /Users/andreialecu/.vscode-insiders/extensions/dbaeumer.vscode-eslint-2.1.14/client/out/extension.js:1:52031
    	at /Users/andreialecu/.vscode-insiders/extensions/dbaeumer.vscode-eslint-2.1.14/client/out/extension.js:1:52325
    	at Immediate.<anonymous> (/Users/andreialecu/.vscode-insiders/extensions/dbaeumer.vscode-eslint-2.1.14/client/out/extension.js:1:52690)
    	at processImmediate (internal/timers.js:456:21)
    
  5. andreialecu commented on Dec 26, 2020

    @andreialecu
    Author

    New one:

    [Extension Host] Error: Illegal argument    at Object.t.illegalArgument (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:50:803)    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1705:214    at d.invokeFunction (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1759:614)    at u._tryExecuteCommand (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4214:45)    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4213:814 (at _executeContributedCommand (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:707:780))
    t.log @ /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:336
    
    
  6. andreialecu commented on Dec 30, 2020

    @andreialecu
    Author

    Possibly relevant, this is also in the developer tools log:

     WARN [File Watcher (chokidar)] Watcher is not using native fsevents library and is falling back to unefficient polling.
    

    Likely relevant for this issue: fsevents/fsevents#349

  7. andreialecu commented on Jan 4, 2021

    @andreialecu
    Author

    Robo (@deepak1556) if you need any further information kindly let me know.

    I'm curious about one thing
    Screenshot 2021-01-04 at 16 03 39

    This seems to specify that it's running on node 12, but node 12 isn't compatible with arm64 (at least not the general purpose one). Only node 15 is.

    Is this right?

    Also, fsevents/fsevents#350 has been merged and pending release as fsevents 2.3.0 which will hopefully happen today, and might help with the chokidar issue.

  8. deepak1556 commented on Jan 4, 2021

    @deepak1556
    Collaborator

    Can you run the arm64 insiders in a new user data dir --user-data-dir <some-absolute-path> and see if the crash continues.

    This seems to specify that it's running on node 12, but node 12 isn't compatible with arm64 (at least not the general purpose one). Only node 15 is.

    The runtime is patched to work in electron.

  9. andreialecu commented on Jan 5, 2021

    @andreialecu
    Author

    Robo (@deepak1556) I ran:

    code-insiders --user-data-dir `mktemp -d` .
    

    Then had to use Reload Window from the command pallette due to some issues with extensions.

    Still got the crash:

    (hopefully Reload Window didn't mess with the data dir)

    Screenshot 2021-01-05 at 11 26 19

    Note that it happens randomly, I've seen it mostly happen when the angular app I'm running in the integrated terminal detects a code change and starts compiling. However, it can happen without any integrated terminal tasks running as well.

    What I've been doing and helps a bit, was to run Workspaces: Duplicate in new window and run my Run task there (which spawns about 3 nodejs processes).

    It's possible it is related to file change detection though. In this particular crash above, it crashed immediately after saving a file, and when angular started recompiling (running via ng serve).

  10. andreialecu commented on Jan 5, 2021

    @andreialecu
    Author

    Screenshot 2021-01-05 at 11 45 13

    Also, at times, this pops up when saving a file and either: a) takes a long time, b) doesn't finish at all (waiting for minutes). I have to cancel it and Reload Window.

    While this one was spinning, there was nothing relevant logged in the Developer tools, no warnings or errors.

  11. andreialecu commented on Jan 5, 2021

    @andreialecu
    Author

    Attaching the CPU profile of the vscode.git warning, which has been popping up repeatedly. git integration definitely seems slow, but not sure if it's git itself being slow or something else.

    exthost-840d83.cpuprofile.zip

  12. deepak1556 commented on Jan 5, 2021

    @deepak1556
    Collaborator

    Can you also try to remove the .vscode-insiders folder under home directory and see if the extension host crashes.

    As for the git integration slowdown, its triggered by child_process.spawn calls based on your profile and the root issue is tracked in upstream electron/electron#26143

  13. 79 remaining items

  14. purge commented on Mar 11, 2021

    @purge

    this happened again today with SIGILL. It may just be nodejs/node#36826
    so out of your control.

    /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1857 Extension host terminated unexpectedly. Code:  null  Signal:  SIGILL
    
  15. andreialecu commented on Mar 11, 2021

    @andreialecu
    Author

    Simon Elliott (@purge) see: #113410 (comment)

    The command I was using was: code-insiders --crash-reporter-directory ~/vscode-crash ..

    I haven't personally seen any SIGILLs in a long time, but if they happen frequently for you, it would likely help a lot if you can attach the crash dumps.

  16. removed this from the March 2021 milestone on Mar 26, 2021
  17. bpasero commented on Apr 28, 2021

    @bpasero
    Contributor

    Lately I have seen a crash of the extension host on macOS 11.x ARM almost daily.

  18. bl-ue commented on Jun 10, 2021

    @bl-ue

    Have we determined that it's memory related? Or is it something like network sockets timing out/disconnecting/becoming invalidated?

  19. bpasero commented on Jun 10, 2021

    @bpasero
    Contributor

    Since I posted in April, I have not seen a single extension host crash ever since. I am still using macOS ARM.

  20. purge commented on Jun 10, 2021

    @purge

    Agreed, i have not seen it for months either. not sure whether its was node or macos update that fixed it.

  21. deepak1556 commented on Jun 29, 2021

    @deepak1556
    Collaborator

    Is anyone in this thread actively experiencing this issue on latest macOS Big Sur 11.4 and VS Code version 1.57.1 ?

  22. andreialecu commented on Jun 29, 2021

    @andreialecu
    Author

    Robo (@deepak1556) There has been some activity here nodejs/node#36826 (comment) and a report of a SIGSEGV with the extension host under high memory pressure.

    Luckily a nodejs contributor is looking into it, so perhaps we'll have some answers soon.

    Personally, I haven't seen almost any crashes in a long time. I use VSCode 8+ hrs per day and in the past 3 months or so I only got one extension host crash or maybe two. (It might still happen more often on a 8GB machine though.)

    Edit: just noticed you were involved in that same discussion, and the conclusion was that macOS 11.4 might have fixed it.

  23. deepak1556 commented on Jun 29, 2021

    @deepak1556
    Collaborator

    Yup I am now looking for users who are hitting this issue on 11.4 to validate the nodejs issue findings. I will give this issue some time before closing as fixed.

  24. deepak1556 commented on Jul 12, 2021

    @deepak1556
    Collaborator

    Closing per above comment.

  25. locked and limited conversation to collaborators on Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugextension-hostExtension host issuesfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issues

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions