microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.91k stars 28.76k forks source link

Crash when dragging file from explorer view, on Wayland #179836

Closed tengyifei closed 1 year ago

tengyifei commented 1 year ago

Type: Bug

Drag a file from the explorer side bar into the main panel. vscode insider crashes.

This problem happens when on Linux using the Wayland display backend (--ozone-platform=wayland on the command line). This problem cannot be reproduced under X11.

Here are the last lines of log output when WAYLAND_DEBUG=1:

[3976585.393] wl_pointer@6.leave(361277, wl_surface@34)
[3976585.472] wl_pointer@6.frame()
[3976585.475] wl_data_device@26.data_offer(new id wl_data_offer@4278190081)
[3976585.477] wl_data_offer@4278190081.offer("text/plain;charset=utf-8")
[3976585.480] wl_data_offer@4278190081.offer("text/plain")
[3976585.481] wl_data_offer@4278190081.offer("chromium/x-web-custom-data")
[3976585.483] wl_data_offer@4278190081.source_actions(3)
[3976585.484] wl_data_device@26.enter(361278, wl_surface@34, 611.34375000, 528.20703125, wl_data_offer@4278190081)
[3976585.488]  -> wl_data_offer@4278190081.accept(361278, "text/plain;charset=utf-8")
[3976585.491]  -> wl_data_offer@4278190081.accept(361278, "text/plain")
[3976585.493]  -> wl_data_offer@4278190081.accept(361278, "chromium/x-web-custom-data")
[3976585.580]  -> wl_data_offer@4278190081.set_actions(0, 0)
[3976585.600] wl_data_device@26.motion(0, 611.34375000, 528.20703125)
[3976585.625]  -> wl_data_offer@4278190081.set_actions(0, 0)
[3976585.666] wl_display@1.delete_id(55)
[3976585.672] wl_display@1.error(wl_surface@53, 2, "Buffer size (135x41) is not divisible by scale (2)")
[741338:0412/211158.918105:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_surface@53: error 2: Buffer size (135x41) is not divisible by scale (2)

[0412/211158.925013:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0412/211158.929516:ERROR:directory_reader_posix.cc(42)] opendir /home/yifeit/.config/Code - Insiders/Crashpad/attachments/deb92d33-e7d2-4ae0-9309-cd8604524855: No such file or directory (2)
[1]    741338 trace trap  /usr/share/code-insiders/code-insiders --unity-launch %F   --force-dark-mode
                                                                                                                                                                                                                                   ✘ TRAP 43s

[0412/211206.820570:INFO:crash_report_upload_thread.cc(349)] Report uploaded to AppCenter. Report: deb92d33-e7d2-4ae0-9309-cd8604524855

VS Code version: Code - Insiders 1.78.0-insider (e5512217bcfb2b644fe7ad6c465fe0b45d23265b, 2023-04-12T05:20:39.394Z) OS version: Linux x64 6.1.15-1rodete3-amd64 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 4596)| |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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|2, 1, 1| |Memory (System)|62.52GB (47.04GB free)| |Process Argv|--unity-launch --enable-features=UseOzonePlatform --ozone-platform=wayland --force-dark-mode --password-store=gnome-libsecret --crash-reporter-id b9e97912-bb60-4caf-a8ab-6cd0200a80b7| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|sway| |XDG_CURRENT_DESKTOP|undefined| |XDG_SESSION_DESKTOP|sway| |XDG_SESSION_TYPE|wayland|
Extensions (88) Extension|Author (truncated)|Version ---|---|--- terminal-commands|adr|1.0.5 vscode-m3u|af4|1.0.0 cppincludeguard|aki|1.6.0 Bookmarks|ale|13.3.1 hex-decimal-magic|all|0.0.1 meson|asa|1.3.0 vscode-neovim|asv|0.0.97 vscode-bazel|Baz|0.7.0 markdown-preview-github-styles|bie|1.0.1 shell-syntax|bma|1.0.5 better-toml|bun|0.3.2 gitignore|cod|0.9.0 arm|dan|1.7.4 vscode-markdownlint|Dav|0.49.0 bazel-code|Dev|0.1.9 vscode-wasm|dts|1.4.1 gitlens|eam|2023.4.1205 vscode-command-runner|edo|0.0.124 vsc-material-theme|Equ|33.8.0 vsc-material-theme-icons|equ|2.7.5 fuchsia-tree|fuc|0.0.5 language-fidl|fuc|0.5.0 vscode-fuchsia|fuc|1.2022111.2023040700 zxdb|fuc|1.0.4 go|gol|0.38.0 gc-excelviewer|Gra|4.2.57 vscode-systemd-support|han|1.0.1 svgeditor|hen|2.9.0 vscode-go-template|jin|0.2.1 svg|joc|1.5.2 language-haskell|jus|3.6.0 hex-fmt|ker|1.0.0 graphql-for-vscode|kum|1.15.3 vscode-clangd|llv|0.1.23 lzwme-eye-care|lzw|1.0.2 MagicPython|mag|1.1.0 prettify-json|moh|0.0.3 theme-monokai-pro-vscode|mon|1.2.0 vscode-json5|mrm|1.0.0 vscode-docker|ms-|1.24.0 vscode-dotnet-runtime|ms-|1.6.0 isort|ms-|2023.9.10931010 python|ms-|2023.6.0 vscode-pylance|ms-|2023.4.10 jupyter|ms-|2023.4.1001031011 jupyter-keymap|ms-|1.1.0 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.289.0 remote-ssh|ms-|0.101.2023041015 remote-ssh-edit|ms-|0.84.0 remote-wsl|ms-|0.78.0 vscode-remote-extensionpack|ms-|0.24.0 cpptools|ms-|1.15.2 cpptools-extension-pack|ms-|1.3.0 live-server|ms-|0.4.7 remote-explorer|ms-|0.5.2023040509 remote-server|ms-|1.0.0 vscode-typescript-next|ms-|5.1.20230411 vsliveshare|ms-|1.0.5857 gnls|mse|0.1.3 autotrim|Nat|1.0.6 vscode-gn|npc|1.1.0 prettier-standard-vscode|num|1.0.2 vetur|oct|0.37.3 vscode-gnformat|per|0.0.3 macos-dark-mode-theme|phi|1.1.3 text-power-tools|qcz|1.40.2 scheme|reb|0.0.2 fuchsiaware|Ric|0.5.1 rust-analyzer|rus|0.3.1472 vscode-coverage-gutters|rya|2.10.4 crates|ser|0.5.11 trailing-spaces|sha|0.4.1 markdown-preview-enhanced|shd|0.6.8 gitconfig|sid|2.0.1 rewrap|stk|1.16.3 code-spell-checker|str|2.20.4 shellcheck|tim|0.31.1 vscode-icons|vsc|12.3.0 vscode-ruby|win|0.28.0 change-case|wma|1.0.0 clang-format|xav|1.9.0 swig-tpl|zha|0.0.6 propertylist|zho|0.0.2 material-theme|zhu|3.15.8 vscode-proto3|zxh|0.5.5 (17 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256198 vstes627:30244334 vslsvsres303:30308271 pythontb:30258533 pythonptprofiler:30281269 vshan820:30294714 pythondataviewer:30285072 vscod805:30301674 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30404738 cppdebug:30492333 vsclangdf:30492506 c4g48928:30535728 dsvsc012:30540252 pynewext54:30618038 pylantcb52:30590116 nodejswelcome1:30587009 pyind779:30611226 pythonsymbol12:30651887 showlangstatbar:30659908 pythonb192cf:30661257 defaultazurewalk:30687958 pythonms35:30671666 f08j5886:30680471 7ij38806:30687742 pythonfmttext:30710679 pythonclientmv:30700173 ```

Minidump: 01049061-a078-4033-bf2e-2e611776f5a9.zip

deepak1556 commented 1 year ago

Upstream bug: https://github.com/swaywm/sway/issues/7398 CrBug: https://bugs.chromium.org/p/chromium/issues/detail?id=1409940

tengyifei commented 1 year ago

Thanks for the sleuthing!

What should I do in the meantime? Is my only choice to roll back to an earlier version of insider that's not on Electron 22, and wait until vscode picks up a version of Electron that doesn't have this bug?

deepak1556 commented 1 year ago

Yeah one option is to rollback, another would be to try changing the display scale factor and see if the helps.

tengyifei commented 1 year ago

FWIW, I switched to Gnome on Wayland and this problem doesn't happen there. I use a HiDPI monitor so changing the scale factor is infeasible though.

vially commented 1 year ago

Upstream bug: swaywm/sway#7398 CrBug: https://bugs.chromium.org/p/chromium/issues/detail?id=1409940

I think chromium#1409940 is a duplicate of chromium#1290059 which has been fixed in Chromium 110 with r4099423.

Since the fix seems relatively straight forward, I have submitted a pull-request (https://github.com/electron/electron/pull/38199) to backport it into Electron 22 so, hopefully, it will eventually land in vscode.

The other option is to just wait for vscode to upgrade to Electron 24 (#180466), but it might take a while until that lands.

deepak1556 commented 1 year ago

Thanks for the backport @vially I will update Electron to v22.3.9 which contains the fix this week.

VSCodeTriageBot commented 1 year ago

This bug has been fixed in the latest release of VS Code Insiders!

@tengyifei, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 52e56ad19ae0b7cc812f85fa6dcb98928b2ba00d of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

tengyifei commented 1 year ago

/verified

pgawron commented 1 year ago

code-insiders under wayland still fails to start most of the times on Fedora 38.

Version: 1.79.0-insider
Commit: 2dfb838f494f035099e999f0cd0eff5f1f488a30
Date: 2023-05-26T05:24:15.146Z
Electron: 22.5.3
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.2.15-300.fc38.x86_64
Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium.
1.79.0-insider
2dfb838f494f035099e999f0cd0eff5f1f488a30
x64
deepak1556 commented 1 year ago

Can you start with WAYLAND_DEBUG=1 and attach the output.

morgan9e commented 1 year ago

If its okay, I will attach log. I also have problem in almost same system.

Version: 1.79.0-insider
Commit: f6be5461f8bc69013a605f5baea834651c6589fb
Date: 2023-05-20T01:20:25.075Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.2.15-300.fc38.x86_64

code_log.txt

[2324463.321]  -> wl_data_source@35.offer("text/plain")
[2324463.322]  -> wl_data_source@35.offer("chromium/x-web-custom-data")
[2324463.325]  -> wl_data_source@35.set_actions(3)
[2324463.330]  -> wl_compositor@4.create_surface(new id wl_surface@47)
[2324463.333]  -> wp_viewporter@18.get_viewport(new id wp_viewport@52, wl_surface@47)
[2324463.337]  -> wl_surface@47.set_input_region(nil)
[2324463.339]  -> wl_surface@47.set_opaque_region(nil)
[2324463.341]  -> wl_surface@47.set_buffer_scale(2)
[2324463.345]  -> wl_data_device@21.start_drag(wl_data_source@35, wl_surface@33, wl_surface@47, 38300)
[2324463.348]  -> wl_surface@47.frame(new id wl_callback@54)
[2324463.430]  -> wl_shm@7.create_pool(new id wl_shm_pool@37, fd 198, 68600)
[2324463.434]  -> wl_shm_pool@37.create_buffer(new id wl_buffer@44, 0, 245, 70, 980, 0)
[2324463.443]  -> wl_shm_pool@37.destroy()
[2324463.508]  -> wl_surface@47.attach(wl_buffer@44, -9, -12)
[2324463.513]  -> wl_surface@47.damage(0, 0, 245, 70)
[2324463.515]  -> wl_surface@47.commit()
[2324464.467] wl_pointer@3.leave(38301, wl_surface@33)
[2324464.596] wl_pointer@3.frame()
[2324464.600] wl_data_source@35.target(nil)
[2324464.602] wl_data_device@21.data_offer(new id wl_data_offer@4278190082)
[2324464.604] wl_data_offer@4278190082.offer("text/x-moz-url")
[2324464.605] wl_data_offer@4278190082.offer("text/plain;charset=utf-8")
[2324464.606] wl_data_offer@4278190082.offer("text/plain")
[2324464.608] wl_data_offer@4278190082.offer("chromium/x-web-custom-data")
[2324464.609] wl_data_source@35.action(0)
[2324464.611] wl_data_offer@4278190082.action(0)
[2324464.613] wl_data_offer@4278190082.source_actions(3)
[2324464.614] wl_data_device@21.enter(38302, wl_surface@33, 1394.72656250, 69.80078125, wl_data_offer@4278190082)
[2324464.618]  -> wl_data_offer@4278190082.accept(38302, "text/x-moz-url")
[2324464.621]  -> wl_data_offer@4278190082.accept(38302, "text/plain;charset=utf-8")
[2324464.623]  -> wl_data_offer@4278190082.accept(38302, "text/plain")
[2324464.624]  -> wl_data_offer@4278190082.accept(38302, "chromium/x-web-custom-data")
[2324464.695]  -> wl_data_offer@4278190082.set_actions(0, 0)
[2324464.702] wl_keyboard@6.leave(38303, wl_surface@33)
[2324464.870] wl_display@1.delete_id(37)
[2324464.873] wl_display@1.error(wl_surface@47, 2, "Buffer size (245x70) must be an integer multiple of the buffer_scale (2).")
[57973:0527/052543.050481:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_surface@47: error 2: Buffer size (245x70) must be an integer multiple of the buffer_scale (2).

[0527/052543.055855:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0527/052543.056336:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0527/052543.056702:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0527/052543.062033:ERROR:directory_reader_posix.cc(42)] opendir /home/user/.config/Code - Insiders/Crashpad/attachments/e2a346e9-49b4-4bcd-a7de-3b5e10d59c39: No such file or directory (2)
[58056:0527/052543.830871:ERROR:broker_posix.cc(40)] Recvmsg error: Connection reset by peer (104)
[0527/052545.279804:INFO:crash_report_upload_thread.cc(349)] Report uploaded to AppCenter. Report: e2a346e9-49b4-4bcd-a7de-3b5e10d59c39
deepak1556 commented 1 year ago

@morgan-jeon thanks for the logs, looks like you are not on the latest insider. Can you update and try again, I believe the fix in https://github.com/microsoft/vscode/pull/183116 should the address the issue you are facing.

morgan9e commented 1 year ago

Oh it works well now, i forgot rpm build is bit slower. I think unexpected crashing also fixed in this build.