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

[Meta] Crash with webview after updated to 1.43.0 #92420

Closed
vuon9 opened this issue Mar 11, 2020 · 19 comments
Closed

[Meta] Crash with webview after updated to 1.43.0 #92420

vuon9 opened this issue Mar 11, 2020 · 19 comments
Assignees
Labels
candidate Issue identified as probable candidate for fixing in the next release confirmed Issue has been confirmed by VS Code Team member freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority linux Issues with VS Code on Linux macos Issues with VS Code on MAC/OS X verified Verification succeeded webview Webview issues windows VS Code on Windows issues

Comments

@vuon9
Copy link
Contributor

vuon9 commented Mar 11, 2020

Issue Type: Bug

Actual:

  • Crash after updated to 1.43.0 successfully (when VSCode tries to restart).
  • Crash when click on Restart Required of extension randomly.

Instead of restart editor, it just stops.

Reproduce steps:
It's random, cannot reproduce.

VS Code version: Code 1.43.0 (78a4c91, 2020-03-09T19:34:44.548Z)
OS version: Darwin x64 19.3.0

System Info
Item Value
CPUs Intel(R) Core(TM) 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: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 5
Memory (System) 16.00GB (1.14GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (28)
Extension Author (truncated) Version
vscode-vlang 0x9 0.1.1
better-comments aar 2.0.5
increment-selection alb 0.2.0
cucumberautocomplete ale 2.14.1
better-toml bun 0.3.2
path-intellisense chr 1.4.2
vscode-markdownlint Dav 0.34.0
gitlens eam 10.2.1
EditorConfig Edi 0.14.4
vscode-great-icons emm 2.1.47
code-runner for 0.9.17
glitch gli 0.1.6
todo-tree Gru 0.0.169
rest-client hum 0.23.2
rainbow-csv mec 1.6.0
python ms- 2020.2.64397
remote-wsl ms- 0.42.3
cpptools ms- 0.26.3
Go ms- 0.13.1
vscode-xml red 0.10.1
vscode-yaml red 0.7.2
code-settings-sync Sha 3.4.3
code-spell-checker str 1.8.0
lua sum 0.15.6
vscodeintellicode Vis 1.2.6
codetour vsl 0.0.4
gistfs vsl 0.0.62
markdown-pdf yza 1.4.2

(1 theme extensions excluded)

@vscodebot
Copy link

vscodebot bot commented Mar 11, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vuon9 vuon9 changed the title Crash after updated to 1.43.0, crash when Require Restart of some extensions. Random crash after updated to 1.43.0, crash when Require Restart of some extensions. Mar 11, 2020
@xzela
Copy link

xzela commented Mar 12, 2020

I too am experiencing random crashes while using VSCode 1.43. Since upgrading, VSCode seems to crash at random. I have been unable to replicate the exact steps but I do find it crashes more often when I navigate the application using the keyboard (instead of using the mouse). This may be a false lead but I believe it is worth noting.

I disabled all installed extensions and used VSCode as normally as I could but the random crashing persisted.

I have attached my raw crash log from OSX

vscode_crash_raw.txt

Please let me know if you need any other information.

@Blaisorblade
Copy link

Blaisorblade commented Mar 12, 2020

Also experienced repeated crashes on my Mac right after the upgrade. At some point, after a crash, VSCode failed to start altogether — so I downgraded to 1.42.1.

@vuon9 vuon9 changed the title Random crash after updated to 1.43.0, crash when Require Restart of some extensions. Random crash after updated to 1.43.0, crash on Required Restart clicking of some extensions. Mar 12, 2020
@vuon9 vuon9 changed the title Random crash after updated to 1.43.0, crash on Required Restart clicking of some extensions. Random crash after updated to 1.43.0, crash on Required Restart clicking of extension. Mar 12, 2020
@moritzwilksch
Copy link

moritzwilksch commented Mar 13, 2020

Same here, random non-reproducable crashes while using or while in background. Only started after the 1.43 update
#92356

@maratib
Copy link

maratib commented Mar 13, 2020

Well experiencing the same after upgrading to version 1.43.0 on my mac.

@sandy081 sandy081 assigned deepak1556 and unassigned sandy081 Mar 13, 2020
@deepak1556 deepak1556 added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues macos Issues with VS Code on MAC/OS X info-needed Issue requires more information from poster labels Mar 13, 2020
@deepak1556
Copy link
Collaborator

Can everyone try adding this setting and see if the crash still happens "webview.experimental.useExternalEndpoint": true

Also can you provide the info based on #92192 (comment)

@deepak1556 deepak1556 changed the title Random crash after updated to 1.43.0, crash on Required Restart clicking of extension. Random crash on macOS after updated to 1.43.0 Mar 13, 2020
@deepak1556 deepak1556 changed the title Random crash on macOS after updated to 1.43.0 [Meta] Random crash on macOS after updated to 1.43.0 Mar 13, 2020
@lopezhansel
Copy link

lopezhansel commented Mar 13, 2020

I'm having similar issues, but in my case it seems to crash after switching between windows roughly every 15 mins. This only start happening today. I have not added any new extensions in weeks, and I did attempt disabling all of them, but VsCode still crashed

Here's 15 logs related to this, not all are the same.
crash-reports.zip

Here's the most common one.
Electron_2020-03-13-135952_ADMINs-MacBook-Pro.txt

@lopezhansel
Copy link

lopezhansel commented Mar 13, 2020

Can everyone try adding this setting and see if the crash still happens "webview.experimental.useExternalEndpoint": true

Also can you provide the info based on #92192 (comment)

I've been trying this for about an hour and It looks promising. No crashes yet.

@deepak1556
Copy link
Collaborator

Thanks @lopezhansel for the crash reports, they indicate the same trace as #92192 (comment) and based on your last comment it confirms crash originates from electron webview.

To further narrow down a reliable repro, would be good to know what kind tabs are opened when you see the crash, for ex: is there any kind of markdown editor ?

/cc @mjbvz what other actions would trigger an electron webview creation ?

@deepak1556 deepak1556 added the webview Webview issues label Mar 13, 2020
@Blaisorblade
Copy link

Ooh; I use the VsCoq plugin, which I guess uses a webview for the "proof state" (https://github.com/coq-community/vscoq/blob/f587c15aaa3d3adef3c2e87f429328b2d1906942/client/src/HtmlCoqView.ts#L119).

@mjbvz
Copy link
Collaborator

mjbvz commented Mar 14, 2020

@deepak1556 We should only create electron webviews in two cases:

  • The webview itself is visible
  • The webview was previously visible but is now hidden AND the webview set the retainContextWhenHidden

Webviews are used in VS code for the following features:

  • Release notes
  • Extension marketplace pages
  • The webview api

@deepak1556 deepak1556 added confirmation-pending and removed info-needed Issue requires more information from poster labels Mar 14, 2020
@lopezhansel
Copy link

I was definitely editing JavaScript, and might have been editing markdown at some point. It was a node.js application and I did edit and previewed a markdown file at one point.

@deepak1556
Copy link
Collaborator

deepak1556 commented Mar 18, 2020

Can everyone try the latest insiders https://code.visualstudio.com/insiders/ and see if it still crashes ?

If the setting "webview.experimental.useExternalEndpoint": true is enabled, do remove it and verify. Thanks!

@deepak1556 deepak1556 changed the title [Meta] Crash on macOS with webview after updated to 1.43.0 [Meta] Crash with webview after updated to 1.43.0 Mar 18, 2020
@Tyriar Tyriar closed this as completed Mar 24, 2020
@deepak1556
Copy link
Collaborator

To verify this crash due to race:

  • Make sure to create and destroy webview panels
  • Perform some window operations like resize, scroll etc

Demo -> https://streamable.com/zjavi

@Tyriar Tyriar added verified Verification succeeded candidate Issue identified as probable candidate for fixing in the next release labels Mar 24, 2020
deepak1556 added a commit to electron/electron that referenced this issue Apr 30, 2020
There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
deepak1556 added a commit to electron/electron that referenced this issue Apr 30, 2020
There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
deepak1556 added a commit to electron/electron that referenced this issue Apr 30, 2020
There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
deepak1556 added a commit to electron/electron that referenced this issue May 1, 2020
…3342)

There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
trop bot pushed a commit to electron/electron that referenced this issue May 1, 2020
There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
deepak1556 added a commit to electron/electron that referenced this issue May 1, 2020
…3374)

There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420

Co-authored-by: deepak1556 <hop2deep@gmail.com>
deepak1556 added a commit to electron/electron that referenced this issue May 4, 2020
…3342)

There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
deepak1556 added a commit to electron/electron that referenced this issue May 4, 2020
…3342)

There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
deepak1556 added a commit to electron/electron that referenced this issue May 4, 2020
…3342) (#23398)

There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
deepak1556 added a commit to electron/electron that referenced this issue May 4, 2020
…3342) (#23397)

There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: microsoft/vscode#92420
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
candidate Issue identified as probable candidate for fixing in the next release confirmed Issue has been confirmed by VS Code Team member freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority linux Issues with VS Code on Linux macos Issues with VS Code on MAC/OS X verified Verification succeeded webview Webview issues windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests