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

segfault on wayland with 1.78 when window.titleBarStyle=custom #181533

Closed
russelltg opened this issue May 4, 2023 · 51 comments · Fixed by #183116
Closed

segfault on wayland with 1.78 when window.titleBarStyle=custom #181533

russelltg opened this issue May 4, 2023 · 51 comments · Fixed by #183116
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron electron-22-update freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded wayland Issue related to wayland display server

Comments

@russelltg
Copy link

russelltg commented May 4, 2023

Type: Bug

I've been using vscode 1.77 for a while and it's very stable on my system (Hyprland (wlroots) wayland, with --enable-features=UseOzonePlatform --ozone-platform=wayland in ~/.config/code-flags.conf. But after an upgrade to 1.78 it's quite crashy. What crashes for me (about 60% of the time) is running code --disable-extensions -d a b where a and b are local files. It was crashing in other locations as well though.

VS Code version: Code 1.78.0 (252e546, 2023-05-03T20:09:46.685Z)
OS version: Linux x64 6.3.1-arch1-1
Modes:
Sandboxed: Yes (I'm not sure why it says yes here--I'm using the visual-studio-code-bin package from the AUR)

EDIT: Seems to only happen when window.titleBarStyle=custom

Verbose log ``` $ code --disable-extensions -d ~/orin_refimage_shotoverkernel.log ~/orin_myimage_shotoverkernel.log --verbose 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. [0504/093229.704709:ERROR:file_io_posix.cc(152)] open /home/russell/.config/Code/Crashpad/pending/19ca2e88-8774-4393-bcf1-53aedd0811c6.lock: File exists (17) [0504/093229.704754:ERROR:file_io_posix.cc(152)] open /home/russell/.config/Code/Crashpad/pending/afefff46-1dd2-446d-b61e-88f1b4593ca0.lock: File exists (17) [63076:0504/093229.705274:WARNING:wayland_object.cc(144)] Binding to zwp_linux_dmabuf_v1 version 3 but version 4 is available. [63076:0504/093229.705324:WARNING:wayland_object.cc(144)] Binding to wl_seat version 5 but version 8 is available. [63076:0504/093229.705353:WARNING:wayland_object.cc(144)] Binding to zwp_pointer_gestures_v1 version 1 but version 3 is available. [63076:0504/093229.781404:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable. [63117:0504/093229.802904:ERROR:gl_display.cc(508)] EGL Driver message (Error) eglQueryDevicesEXT: EGL_BAD_ALLOC error: In eglQueryDevicesEXT: Failed to allocate device list. [63117:0504/093229.823966:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is [63117:0504/093229.826348:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process. [main 2023-05-04T15:32:29.834Z] [File Watcher (node.js)] Request to start watching: /home/russell/.config/Code/User (excludes: , includes: ),/home/russell/.config/Code/User/settings.json (excludes: , includes: ) [main 2023-05-04T15:32:29.842Z] Starting VS Code [main 2023-05-04T15:32:29.842Z] from: /opt/visual-studio-code/resources/app [main 2023-05-04T15:32:29.842Z] args: { _: [ '/home/russell/orin_refimage_shotoverkernel.log', '/home/russell/orin_myimage_shotoverkernel.log' ], diff: true, merge: false, add: false, goto: false, 'new-window': false, 'reuse-window': false, wait: false, help: false, 'list-extensions': false, 'show-versions': false, 'pre-release': false, version: false, verbose: true, status: false, 'prof-startup': false, 'no-cached-data': false, 'prof-v8-extensions': false, 'disable-extensions': true, 'disable-gpu': false, 'ms-enable-electron-run-as-node': false, telemetry: false, debugRenderer: false, 'enable-smoke-test-driver': false, logExtensionHostCommunication: false, 'skip-release-notes': false, 'skip-welcome': false, 'disable-telemetry': false, 'disable-updates': false, 'disable-keytar': false, 'disable-workspace-trust': false, 'disable-crash-reporter': false, 'crash-reporter-id': '7cf4773b-9eec-4e98-be97-71aead94ebd8', 'skip-add-to-recently-opened': false, 'unity-launch': false, 'open-url': false, 'file-write': false, 'file-chmod': false, force: false, 'do-not-sync': false, trace: false, 'force-user-env': false, 'force-disable-user-env': false, 'open-devtools': false, 'disable-gpu-sandbox': false, '__enable-file-policy': false, 'enable-coi': false, 'no-proxy-server': false, 'no-sandbox': false, nolazy: false, 'force-renderer-accessibility': false, 'ignore-certificate-errors': false, 'allow-insecure-localhost': false, 'disable-dev-shm-usage': false, 'profile-temp': false, logsPath: '/home/russell/.config/Code/logs/20230504T093229' } [main 2023-05-04T15:32:29.843Z] Resolving machine identifier... [main 2023-05-04T15:32:29.843Z] Resolved machine identifier: 5ae45673b43208087ad57923c5cb25a0522a935da792e6a7f2fe060c58ebab62 [main 2023-05-04T15:32:29.843Z] Main->SharedProcess#connect [main 2023-05-04T15:32:29.845Z] [File Watcher (node.js)] Started watching: '/home/russell/.config/Code/User' [main 2023-05-04T15:32:29.846Z] [File Watcher (node.js)] Started watching: '/home/russell/.config/Code/User/settings.json' [main 2023-05-04T15:32:29.846Z] StorageMainService: creating application storage [main 2023-05-04T15:32:29.849Z] ElectronURLListener: waiting for window to be ready to handle URLs... [main 2023-05-04T15:32:29.849Z] lifecycle (main): phase changed (value: 2) [main 2023-05-04T15:32:29.849Z] windowsManager#open [main 2023-05-04T15:32:29.850Z] windowsManager#open pathsToOpen [ { fileUri: w { scheme: 'file', authority: '', path: '/home/russell/orin_refimage_shotoverkernel.log', query: '', fragment: '', _formatted: null, _fsPath: null }, type: 1, exists: true, options: { selection: undefined } }, { fileUri: w { scheme: 'file', authority: '', path: '/home/russell/orin_myimage_shotoverkernel.log', query: '', fragment: '', _formatted: null, _fsPath: null }, type: 1, exists: true, options: { selection: undefined } } ] [main 2023-05-04T15:32:29.850Z] IPC Object URL: Registered new channel vscode:0d402d8f-3060-42dd-8008-ea93ed84c475. [main 2023-05-04T15:32:29.850Z] window#validateWindowState: validating window state on 2 display(s) { mode: 1, x: 0, y: 0, width: 884, height: 1526 } [main 2023-05-04T15:32:29.851Z] window#validateWindowState: multi-monitor working area { x: 0, y: 0, width: 2560, height: 1600 } [main 2023-05-04T15:32:29.851Z] window#ctor: using window state { mode: 1, x: 0, y: 0, width: 884, height: 1526 } [63076:0504/093229.851335:WARNING:wayland_surface.cc(149)] Server doesn't support zcr_alpha_compositing_v1. [63076:0504/093229.851344:WARNING:wayland_surface.cc(164)] Server doesn't support overlay_prioritizer. [63076:0504/093229.851346:WARNING:wayland_surface.cc(178)] Server doesn't support surface_augmenter. [63076:0504/093229.851348:WARNING:wayland_surface.cc(193)] Server doesn't support wp_content_type_v1 [63076:0504/093229.851351:WARNING:wayland_surface.cc(212)] Server doesn't support zcr_color_management_surface. [63076:0504/093229.861916:WARNING:xdg_activation.cc(86)] Cannot activate a window because no active windows found! [63076:0504/093229.861948:WARNING:xdg_activation.cc(86)] Cannot activate a window because no active windows found! [main 2023-05-04T15:32:29.862Z] window#load: attempt to load window (id: 1) [main 2023-05-04T15:32:29.866Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 0, emptyToOpen: 0) [main 2023-05-04T15:32:29.866Z] lifecycle (main): phase changed (value: 3) [main 2023-05-04T15:32:29.866Z] resolveShellEnv(): skipped (VSCODE_CLI is set) [main 2023-05-04T15:32:29.866Z] update#setState idle [main 2023-05-04T15:32:29.894Z] resolveShellEnv(): skipped (VSCODE_CLI is set) [0504/093229.952092:ERROR:elf_dynamic_array_reader.h(64)] tag not found [0504/093229.955272:ERROR:directory_reader_posix.cc(42)] opendir /home/russell/.config/Code/Crashpad/attachments/dbe6758a-c27c-4bc2-bd98-a8b25c6a26a5: No such file or directory (2) ```
System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz (16 x 3767)
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) 1, 1, 1
Memory (System) 31.08GB (25.95GB free)
Process Argv --enable-features=UseOzonePlatform --ozone-platform=wayland --crash-reporter-id 7cf4773b-9eec-4e98-be97-71aead94ebd8
Screen Reader no
VM 0%
DESKTOP_SESSION undefined
XDG_CURRENT_DESKTOP Hyprland
XDG_SESSION_DESKTOP undefined
XDG_SESSION_TYPE wayland
Extensions (37)
Extension Author (truncated) Version
better-toml bun 0.3.2
doxdocgen csc 1.4.0
gitlens eam 13.5.0
remotehub Git 0.56.0
vscode-pull-request-github Git 0.62.0
better-cpp-syntax jef 1.17.2
cmake-language-support-vscode jos 0.0.9
vscode-clangd llv 0.1.24
cortex-debug mar 1.10.0
Kotlin mat 1.7.1
Lisp mat 0.1.12
debug-tracker-vscode mcu 0.0.15
memory-view mcu 0.0.20
rtos-views mcu 0.0.6
vscode-docker ms- 1.25.0
vscode-dotnet-runtime ms- 1.6.0
jupyter-keymap ms- 1.1.0
remote-containers ms- 0.292.0
remote-ssh ms- 0.100.0
remote-ssh-edit ms- 0.84.0
remote-wsl ms- 0.78.4
azure-repos ms- 0.32.0
cmake-tools ms- 1.14.31
cpptools-extension-pack ms- 1.3.0
remote-explorer ms- 0.4.0
remote-repositories ms- 0.34.0
veriloghdl msh 1.11.4
probe-rs-debugger pro 0.17.4
awesome-vhdl puo 0.0.1
vscode-xml red 0.25.0
rust-analyzer rus 0.4.1501
crates ser 0.5.11
cmake twx 0.0.17
vscode-lldb vad 1.9.1
vim vsc 1.25.2
markdown-all-in-one yzh 3.5.1
vscode-proto3 zxh 0.5.5

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
2i9eh265:30646982
showlangstatbar:30730054
vsctsb:30705553
azdwalk:30721579
pythonms35:30701012
pythonfmttext:30731395
pythonclientmvcf:30725893
fixhidewlkth:30730051

@deepak1556
Copy link
Collaborator

Can you attach the crash logs following the steps at https://github.com/microsoft/vscode/wiki/Native-Crash-Issues#creating-a-crash-report

@deepak1556 deepak1556 added info-needed Issue requires more information from poster freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues electron-22-update labels May 4, 2023
@russelltg
Copy link
Author

Alright, here it is. I believe I've done it correctly.

vscodecrash.zip

@chrisr87
Copy link

chrisr87 commented May 5, 2023

I'm experiencing the same crash, but not just in vs code, other electron22 apps as well. Seems to be an upstream problem.

I'm not using hyprland but I'm using sway. But they use the same compositor.

Way upstream I guess. It's on the chromium level.

https://bugs.chromium.org/p/chromium/issues/detail?id=1409940

@ELT4N1N
Copy link

ELT4N1N commented May 5, 2023

Same for me. Sometimes it works and then not. Other electron22 applications like Obsidian are working fine.
I'm on Arch/Sway and start it with --ozone-platform-hint=auto
It crashes with the error [0505/131844.910450:ERROR:elf_dynamic_array_reader.h(64)] tag not found and I only see an window without content that closes instantly.

@deepak1556
Copy link
Collaborator

@russelltg are you using "window.titleBarStyle": "native" ? If not, can you change to it and start the application with the following flags --ozone-platform=wayland --enable-features=WaylandWindowDecorations and see if the crash repros.

@chrisr87 @ELT4N1N if you are on Sway then you might be hitting #179836, please check if #179836 (comment) helps in your case as well.

@chrisr87
Copy link

chrisr87 commented May 5, 2023

@chrisr87 @ELT4N1N if you are on Sway then you might be hitting #179836, please check if #179836 (comment) helps in your case as well.

Not using Sway or disabling scaling are not solutions though. I'm more inclined to not use VS Code than do either of those things.

@ELT4N1N
Copy link

ELT4N1N commented May 5, 2023

I also don't want to install gnome. VSCode should also work with sway. I don't think that #179836 is in my case the same issue because I don't use scaling. It happens on 1440p as well as on 1080p.

Besides of that I also tried it on my other PCs. There, it does not crash anywhere as often as on my work PC but still crashes sometimes.
Here is a full log of my startup of code with --verbose and WAYLAND_DEBUG=1: log.txt

@chrisr87
Copy link

chrisr87 commented May 5, 2023

I also don't want to install gnome. VSCode should also work with sway. I don't think that #179836 is in my case the same issue because I don't use scaling. It happens on 1440p as well as on 1080p.

Besides of that I also tried it on my other PCs. There, it does not crash anywhere as often as on my work PC but still crashes sometimes. Here is a full log of my startup of code with --verbose and WAYLAND_DEBUG=1: log.txt

Is your title bar style set to native?

@ELT4N1N
Copy link

ELT4N1N commented May 6, 2023

Is your title bar style set to native?

If it is not the default setting, no. I use sway without title bars. Here is the command i use: /usr/bin/code-oss --extensions-dir "/home/user/.local/share/vscode/extensions" --ozone-platform-hint=auto --unity-launch

@russelltg
Copy link
Author

@deepak1556 setting the title style to native does seem to workaround the bug--updating the description

@russelltg russelltg changed the title segfault on wayland with 1.78 segfault on wayland with 1.78 when window.titleBarStyle=custom May 10, 2023
@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) electron Issues and items related to Electron and removed info-needed Issue requires more information from poster labels May 10, 2023
@russelltg
Copy link
Author

Actually, it does still seem to crash, but much much much less often (90% -> 5%, and always works the second time)

@hossamdash
Copy link

Actually, it does still seem to crash, but much much much less often (90% -> 5%, and always works the second time)

for me the only thing getting code to launch is setting "window.titleBarStyle": "custom"
my code-flags.conf are

--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto

@deepak1556 deepak1556 added the wayland Issue related to wayland display server label May 15, 2023
@deepak1556
Copy link
Collaborator

deepak1556 commented Jun 2, 2023

@Mithras the crash dump you have attached shows a different trace than the one this issue was originally tracking, I am going to separate it out into #184124, lets continue the conversation in that issue.

@zjeffer can you update to latest insiders and check if the crash happens, the version you are on does not contain the fix electron/electron#38199

@russelltg can you confirm if you are facing the crash with latest insiders https://code.visualstudio.com/insiders ?

@deepak1556 deepak1556 added insiders-released Patch has been released in VS Code Insiders author-verification-requested Issues potentially verifiable by issue author and removed author-verification-requested Issues potentially verifiable by issue author labels Jun 2, 2023
@zjeffer
Copy link

zjeffer commented Jun 2, 2023

@deepak1556 Ah, yes that was it. There seems to be a minor issue with the AUR package (https://aur.archlinux.org/packages/visual-studio-code-insiders-bin) where it doesn't update to the latest version unless you completely remove the downloaded packages from the cache. Removing ~/.cache/paru/clone/visual-studio-code-insiders-bin/ and then installing again updated my code-insiders to the latest version, and fixed the issue.

@russelltg
Copy link
Author

I am not facing this particular crash on the latest insiders

@zjeffer
Copy link

zjeffer commented Jun 3, 2023

Looks like the issue is not fixed, it has been crashing again. Am I not on the latest version?

1.79.0-insider
05ae089c791aa5c8ec05abd5687c9a31517579bc

crash.zip

@deepak1556 deepak1556 added verified Verification succeeded and removed author-verification-requested Issues potentially verifiable by issue author labels Jun 5, 2023
@tianze0926
Copy link

It crashes every time now as long as window.titleBarStyle=custom.

I am using Hyprland on Arch Linux.

> code-insiders --version
1.80.0-insider
6cd5ac180a6362b45b415a624f62173caf7428a1
x64

With option: --ozone-platform-hint=auto

Verbose output (note that there is only one error now(tag not found), the no-such-file error is gone)

Warning: 'ozone-platform-hint' is not in the list of known options, but still passed to Electron/Chromium.
Found --crash-reporter-directory argument. Setting crashDumps directory to be '/home/leo/code-logs/'
[85933:0610/142246.236613:WARNING:wayland_object.cc(144)] Binding to zwp_linux_dmabuf_v1 version 3 but version 4 is available.
[85933:0610/142246.236702:WARNING:wayland_object.cc(144)] Binding to wl_seat version 5 but version 8 is available.
[85933:0610/142246.236749:WARNING:wayland_object.cc(144)] Binding to zwp_pointer_gestures_v1 version 1 but version 3 is available.
[85933:0610/142246.332647:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[85933:0610/142246.332670:WARNING:property.cc(144)] version: GetAndBlock: failed.
[85933:0610/142246.332685:ERROR:select_file_dialog_linux_portal.cc(274)] Failed to read portal version property
[85933:0610/142246.342513:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[85971:0610/142246.390798:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is
[85971:0610/142246.395136:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process.
[main 2023-06-10T06:22:46.448Z] [File Watcher (node.js)] Request to start watching: /home/leo/.config/Code - Insiders/User (excludes: , includes: ),/home/leo/.config/Code - Insiders/User/settings.json (excludes: , includes: )
[main 2023-06-10T06:22:46.466Z] Starting VS Code
[main 2023-06-10T06:22:46.466Z] from: /opt/visual-studio-code-insiders/resources/app
[main 2023-06-10T06:22:46.466Z] args: {
  _: [],
  diff: false,
  merge: false,
  add: false,
  goto: false,
  'new-window': false,
  'reuse-window': false,
  wait: false,
  help: false,
  'list-extensions': false,
  'show-versions': false,
  'pre-release': false,
  version: false,
  verbose: true,
  status: false,
  'prof-startup': false,
  'no-cached-data': false,
  'prof-v8-extensions': false,
  'disable-extensions': false,
  'disable-gpu': false,
  'ms-enable-electron-run-as-node': false,
  telemetry: false,
  debugRenderer: false,
  'enable-smoke-test-driver': false,
  logExtensionHostCommunication: false,
  'skip-release-notes': false,
  'skip-welcome': false,
  'disable-telemetry': false,
  'disable-updates': false,
  'disable-keytar': false,
  'disable-workspace-trust': false,
  'disable-crash-reporter': false,
  'crash-reporter-directory': '/home/leo/code-logs/',
  'skip-add-to-recently-opened': false,
  'unity-launch': false,
  'open-url': false,
  'file-write': false,
  'file-chmod': false,
  force: false,
  'do-not-sync': false,
  trace: false,
  'force-user-env': false,
  'force-disable-user-env': false,
  'open-devtools': false,
  'disable-gpu-sandbox': false,
  '__enable-file-policy': false,
  'enable-coi': false,
  'no-proxy-server': false,
  'no-sandbox': false,
  nolazy: false,
  'force-renderer-accessibility': false,
  'ignore-certificate-errors': false,
  'allow-insecure-localhost': false,
  'disable-dev-shm-usage': false,
  'profile-temp': false,
  logsPath: '/home/leo/.config/Code - Insiders/logs/20230610T142246'
}
[main 2023-06-10T06:22:46.469Z] Resolving machine identifier...
[main 2023-06-10T06:22:46.469Z] Resolved machine identifier: cc822720f44bcad27e3b1f751be9ec4415abe59d8f6ab454323fcb11b19ef868
[main 2023-06-10T06:22:46.469Z] Main->SharedProcess#connect
[main 2023-06-10T06:22:46.474Z] [File Watcher (node.js)] Started watching: '/home/leo/.config/Code - Insiders/User'
[main 2023-06-10T06:22:46.475Z] [File Watcher (node.js)] Started watching: '/home/leo/.config/Code - Insiders/User/settings.json'
[main 2023-06-10T06:22:46.477Z] StorageMainService: creating application storage
[main 2023-06-10T06:22:46.481Z] ElectronURLListener: waiting for window to be ready to handle URLs...
[main 2023-06-10T06:22:46.481Z] lifecycle (main): phase changed (value: 2)
[main 2023-06-10T06:22:46.481Z] windowsManager#open
[main 2023-06-10T06:22:46.483Z] windowsManager#open pathsToOpen [
  {
    workspace: { id: '302624584338130d29cfe9973c6d1231', uri: [o] },
    type: 2,
    exists: true
  }
]
[main 2023-06-10T06:22:46.483Z] windowsManager#doOpenFolderOrWorkspace {
  folderOrWorkspace: {
    workspace: { id: '302624584338130d29cfe9973c6d1231', uri: [o] },
    type: 2,
    exists: true
  },
  filesToOpen: undefined
}
[main 2023-06-10T06:22:46.484Z] IPC Object URL: Registered new channel vscode:9735bcfa-76d6-4c21-829d-a62fe6359c63.
[main 2023-06-10T06:22:46.484Z] window#validateWindowState: validating window state on 1 display(s) { mode: 1, x: 0, y: 0, width: 1256, height: 736 }
[main 2023-06-10T06:22:46.485Z] window#validateWindowState: 1 monitor working area { x: 0, y: 0, width: 1280, height: 800 }
[main 2023-06-10T06:22:46.485Z] window#ctor: using window state { mode: 1, x: 0, y: 0, width: 1256, height: 736 }
[85933:0610/142246.485683:WARNING:wayland_surface.cc(149)] Server doesn't support zcr_alpha_compositing_v1.
[85933:0610/142246.485701:WARNING:wayland_surface.cc(164)] Server doesn't support overlay_prioritizer.
[85933:0610/142246.485708:WARNING:wayland_surface.cc(178)] Server doesn't support surface_augmenter.
[85933:0610/142246.485714:WARNING:wayland_surface.cc(193)] Server doesn't support wp_content_type_v1
[85933:0610/142246.485721:WARNING:wayland_surface.cc(212)] Server doesn't support zcr_color_management_surface.
[85933:0610/142246.485978:WARNING:cursor_loader.cc(133)] Failed to load a platform cursor of type kNull
[85933:0610/142246.506228:WARNING:xdg_activation.cc(86)] Cannot activate a window because no active windows found!
[85933:0610/142246.506291:WARNING:xdg_activation.cc(86)] Cannot activate a window because no active windows found!
[main 2023-06-10T06:22:46.507Z] window#load: attempt to load window (id: 1)
[main 2023-06-10T06:22:46.515Z] StorageMainService: creating workspace storage (302624584338130d29cfe9973c6d1231)
[main 2023-06-10T06:22:46.516Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 1, emptyToRestore: 0, emptyToOpen: 0)
[main 2023-06-10T06:22:46.516Z] lifecycle (main): phase changed (value: 3)
[main 2023-06-10T06:22:46.517Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[main 2023-06-10T06:22:46.517Z] update#setState idle
[main 2023-06-10T06:22:46.600Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[0610/142246.635498:ERROR:elf_dynamic_array_reader.h(64)] tag not found

crash.zip

@jchv
Copy link

jchv commented Jun 12, 2023

FWIW, I am on 1.79.0 on NixOS and Sway and it crashes at startup frequently. It also crashes when creating a new window, albeit this seems less frequent.

Version: 1.79.0
Commit: b380da4ef1ee00e224a15c1d4d9793e27c2b6302
Date: 2023-06-07T14:28:44.251Z
Electron: 22.5.5
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.3.6

(Note: this is based on the upstream Linux VSCode binaries.)

I tried --enable-features=WaylandWindowDecorations and putting "window.titleBarStyle": "native" in my settings.json, but this didn't change much for me. If I do custom it crashes more often, but it's very sporadic either way.

The drag'n'drop thing seems like an unrelated fix. Based on the description of that one, it sounds like it could only ever matter on screens with a scale factor other than 1. While I do have some machines that have a scale factor of 2+, it makes no difference in particular for this bug in my experience.

I am not sure how to find the actual problem. I tried taking a look at the dumps with coredumpctl, but I don't have symbols. Nothing obvious shows up.

FWIW, VSCodium 1.78.2 based on Electron 22.3.5 has no issue. Nope, repro'd there too.

I think this should probably be re-opened?

@zjeffer
Copy link

zjeffer commented Jun 12, 2023

I tried --enable-features=WaylandWindowDecorations and putting "window.titleBarStyle": "native" in my settings.json, but this didn't change much for me. If I do custom it crashes more often, but it's very sporadic either way.

I can confirm I have the exact same behaviour on my system: much more frequent crashes with custom titlebar. Currently on code-insiders b380da4ef1ee00e224a15c1d4d9793e27c2b6302.

@ppenguin
Copy link

ppenguin commented Jun 14, 2023

Same for me (on nixos), frequent crashes when opening initial or further windows. Happens since update (everything ~1.78 and above). Since I had some issues with opengl and Hyprland/wlroots related to specific commits/dependencies it seems to be difficult to pinpoint, though for me it started around the transition to nixos-23.05.

With code --verbose there is not really an obvious reason logged for crashes. I haven't yet experimented with scaling, but a friend reported that crashes at start are solved when (temporary) setting scale=1.

image

(I.e. the electron version is higher than the fix mentioned for this issue)

The titleBarStyle setting doesn't appear to make significant difference for me.

@serfreeman1337
Copy link

serfreeman1337 commented Jun 15, 2023

Still crashing for me, but this time after [email protected]_max_size(2147483647, 2147483647).

Version: 1.80.0-insider
Commit: f3aa9a201b2455e6556797e8ffb7145d77adb792
Date: 2023-06-14T09:02:36.066Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.3.7-arch1-1

wayland-verbose.log
crash.zip

UPD:
Seems to be fixed with electron24. Haven't experienced any crash due to window maximizing so far.

Version: 1.78.0-exploration
Commit: 2a026dbfa74a48e629f23f1d54fd7cd788a44ffb
Date: 2023-04-25T04:33:54.625Z
Electron: 24.1.2
Chromium: 112.0.5615.87
Node.js: 18.14.0
V8: 11.2.214.9-electron.0
OS: Linux x64 6.3.7-arch1-1
Sandboxed: Yes

@Mithras
Copy link

Mithras commented Jun 17, 2023

I think the crush people still experience is not the original one but the new one reported here #184124
Anyway, as a short term workaround you can remove --ozone-platform or --ozone-platform-hint from code-flags.conf and use XWayland. It doesn't crash for me in XWayland.

@jchv
Copy link

jchv commented Jun 17, 2023

I'm in SwayWM, so I can't really maximize windows. For me the behavior of the bug has not changed since 1.78: some percentage of times a window is created (either during first launch or by clicking new window,) VS Code segfaults. The change that supposedly closed this bug seems to be related to drag'n'drop, which makes me skeptical that the original crash here was ever fixed.

@KorigamiK
Copy link

For me running on AMD/Nvidia card on Hyprland adding this to ~/.config/Code/User/settings.json fixed the issue

{
  "window.titleBarStyle": "custom",
  ...
}

and then to no see the annoying title bar I put this to my hyprland.conf and it looks just as good as the X11 platform

windowrulev2=fakefullscreen, class:^(code-url-handler)$

@oritwoen
Copy link

I checked it on 3 versions of Electron (22, 24, 25), on 2 instances of Gnome X11 and Wayland with the main branch built directly from git. And ERROR:elf_dynamic_array_reader.h(64)] tag not found it comes to me every time. Changing settings.json doesn't help either.

@djaonline
Copy link

djaonline commented Jun 23, 2023

Vscode keeps crashing when starting on wayland. IMHO the issue should be reopened.
My reproducible stuff:

nixos: 23.05
hyprland: v0.0.26, develop
vscode: 1.78, 1.79
window.titleBarStyle: "custom", "native"

@jchv
Copy link

jchv commented Jun 23, 2023

For now I've just downgraded to 1.77, and it seems it could be a while before anyone notices the fix has nothing to do with this bug. This is unfortunate, but not unexpected, being honest: I don't really expect Wayland support to be very good unless some VSCode maintainers actually use VSCode on Wayland, and I presume they probably are not right now. This is unfortunate but not surprising given that it's not even the default in Electron yet.

The issue should still be re-opened, though, as it is very seriously not fixed.

@sorig
Copy link

sorig commented Jun 23, 2023

Right now wayland users either have to use the native titlebar or use 1.77. This issue is not fixed

@herbiejhopkins
Copy link

Using native titlebar vs custom isn't a solution. The issue seems more frequent for me with native but it still happens some of the time with either option.

Running using native wayland doesn't get a lot of testing since using Xwayland is the default (and there's no issue when running using Xwayland).

@vially
Copy link
Contributor

vially commented Jun 28, 2023

The issue should still be re-opened, though, as it is very seriously not fixed.

The lack of a good stack-trace and some early comments in this thread (e.g.: #181533 (comment)) made it look like this issue might be a duplicate of #179836.

When more context was provided, it turned out they were two separate issues that were both resulting in segfaults on Wayland.

The reason this issue stays closed is because it got spun-out into #184124 which more accurately describes the underlying root issue (and also doesn't have some of the noise from this thread where different people were experiencing a segfault rather than this segfault).

TLDR: If you are still affected by this issue just subscribe and add your input to #184124 instead.

@claui
Copy link

claui commented Jun 30, 2023

For now I've just downgraded to 1.77

Right now wayland users either have to use the native titlebar or use 1.77. This issue is not fixed

PSA if you’re on Arch Linux: 1.77 is beginning to grow out of sync with its dependencies.

For starters, if you want to stay on 1.77 you’re going to need a copy libicui18n.so.72 as of today.
Easiest way to get that is probably the icu72-bin-v2 package on the AUR.

@griffi-gh
Copy link

Still broken (XWayland works fine tho~)

@krims0n32
Copy link

Not fixed. XWayland not working either (black menus, weird cursor stuff happening).

@serfreeman1337
Copy link

Not fixed. XWayland not working either (black menus, weird cursor stuff happening).

What about electron 24 ?

@linkfrg
Copy link

linkfrg commented Jul 11, 2023

starting with --verbose worked for me

@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron electron-22-update freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded wayland Issue related to wayland display server
Projects
None yet
Development

Successfully merging a pull request may close this issue.