-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
[Bug]: Crash when opened under Wayland #37531
Comments
Hello @yagarea. Thanks for reporting this and helping to make Electron better! Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. Now adding the |
This appears to be a crash in Element Desktop which is an Electron wrapper for Element Web. @yagarea if this can be reproduced with standalone Electron, e.g. if just running |
Running stack trace
This does not happen without the |
Electron v23.2.1 seems to work fine with Discord on Wayland 🐸 |
I filed a similar issue in element-hq/element-desktop#873 which only occurs under certain circumstances (mixed-scaled dual monitor setup). Note that it behaves a bit differently in element-nightly (electron 24.0.0) and element 1.11.29 (electron 23.1.3). This might be related. (Or not.) |
This might be a Chromium issue. I encounter similar issues with Chrome, Brave on Arch for a couple weeks at this point, and found this when I was searching for the error.
I also use Wayland/Sway/Arch, with multiple monitors in different scales. |
I'm also experiencing the same issue on a machine with two monitors (high-ish DPI, but scale = 1). With debuginfod, I got the following stacktrace, it's different from @hrdl-github's but also has the same memcpy called from
I couldn't reproduce with a different electron app than Element because they all crash or immediately stop for seemingly unrelated reasons 🥲 (e.g. Signal Desktop for some reason trying to do some migration on its DB before starting the main window when run through the regular electron binary) … but VSCode has also been crashing at startup for me when the ozone wayland backend is enabled. @VerteDinde with two stack traces, is it still right for this to be marked as need-info? |
Probably related to #38430 , which also contains 3 stacktraces. At this point no Electron app that uses 22.x is functional for me under wayland. I use Arch as well with all latest updates if that matters. Should not be tagged with need-info. |
I filed another issue in element-hq/element-desktop#1026 which occurs since |
Note that I cannot provoke the issue with https://github.com/electron/electron-quick-start or https://github.com/oli-moreau/electron-quick-start-wayland. |
This is potentially linked to the window being maximized. For Element, un-maximizing the window got me the application back in a working state: flathub/im.riot.Riot#376 (comment) |
As @travier said it's related to window being maximized. On sway with Element flatpak I had to follow this comment and it works perfectly. And when I try to make the window not floating by clicking EDIT: Looks like another electron app Signal has the same problem signalapp/Signal-Desktop#6247 |
Reproduced on Arch Linux using the distribution packaged vscode and electron22 with debug symbols installed. Got a debugger with gdb --args /usr/lib/electron22/electron --enable-features=UseOzonePlatform --ozone-platform=wayland --ozone-platform-hint=auto /usr/lib/code/code.js The issue seems to happen about 1/2 of the time with electron occasionally managing to start multiple times in a row and then fail many times. So the behavior doesn't seem to be truly random. The debugger yielded following stacktraces for the segfaults: 1: In printing::PrinterSemanticCapsAndDefaults::Paper::Paper
2: In ui::WaylandZcrColorManagementSurface::SetColorSpace
3: In printing::PrinterSemanticCapsAndDefaults::Paper::Paper (Interestingly the window managed to open & display code editor with file open already)
4: In views::(anonymous namespace)::BuildViewsWithLayers
5: In views::View::UpdateChildLayerBounds (as in others, window visible and has dark grey side bar and lighter color in other window visible already, no content showing though)
It seems that I can somewhat reliably reproduce the issue by changing the display I'm focused on compared to last execution. Not sure about changing monitor in focus midst the app is launching though. Interestingly sometimes the application crashes continuously when tried to launch on some display consecutively, in those cases trying to launch is on other monitor seems to most often help and get it running. I couldn't reproduce the issue with Electron demo app which is launched when removing the Using Sway 1.8.1 as Wayland compositor and 2 monitors with 3440x1440 (scale 1) and 3840x2160 (scale 1.7) resolutions. Changing both scalings to be just 1 didn't help with the crashes. |
Seems there are possibly multiple codepaths & crashes with vscode + I was able to get stacktraces for one of these in the downstream bug report here: microsoft/vscode#184124. In that case it was in:
See downstream bug comment for details on that one. Just now I was able to roll the dice again by restarting For that one, see below: EXPAND for platform / package version info
Here are logs from EXPAND terminal log
$ code --verbose
Warning: 'ozone-platform-hint' is not in the list of known options, but still passed to Electron/Chromium.
[2754875:0717/230216.735661:WARNING:wayland_object.cc(144)] Binding to zwp_linux_dmabuf_v1 version 3 but version 4 is available.
[2754875:0717/230216.735741:WARNING:wayland_object.cc(144)] Binding to wl_seat version 5 but version 8 is available.
[2754875:0717/230216.735748:WARNING:wayland_object.cc(144)] Binding to zwp_pointer_gestures_v1 version 1 but version 3 is available.
[2754875:0717/230216.810629: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”
[2754875:0717/230216.810639:WARNING:property.cc(144)] version: GetAndBlock: failed.
[2754875:0717/230216.810645:ERROR:select_file_dialog_linux_portal.cc(274)] Failed to read portal version property
[2754875:0717/230216.841229:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[2754914:0717/230216.879788:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is
[2754914:0717/230216.883056:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process.
[main 2023-07-18T05:02:16.922Z] [File Watcher (node.js)] Request to start watching: /home/trinitronx/.config/Code - OSS/User (excludes: <none>, includes: <all>),/home/trinitronx/.config/Code - OSS/User/settings.json (excludes: <none>, includes: <all>)
[main 2023-07-18T05:02:16.934Z] Starting VS Code
[main 2023-07-18T05:02:16.935Z] from: /usr/lib/code
[main 2023-07-18T05:02:16.935Z] 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,
'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/trinitronx/.config/Code - OSS/logs/20230717T230216'
}
[main 2023-07-18T05:02:16.936Z] Resolving machine identifier...
[main 2023-07-18T05:02:16.937Z] Resolved machine identifier: 2a5e40e6528e9fb1909dedf03d3a2246bc954c49221f676157cfeb59d1da6044
[main 2023-07-18T05:02:16.937Z] Main->SharedProcess#connect
[main 2023-07-18T05:02:16.939Z] [File Watcher (node.js)] Started watching: '/home/trinitronx/.config/Code - OSS/User'
[main 2023-07-18T05:02:16.940Z] [File Watcher (node.js)] Started watching: '/home/trinitronx/.config/Code - OSS/User/settings.json'
[main 2023-07-18T05:02:16.941Z] StorageMainService: creating application storage
[main 2023-07-18T05:02:16.944Z] ElectronURLListener: waiting for window to be ready to handle URLs...
[main 2023-07-18T05:02:16.944Z] lifecycle (main): phase changed (value: 2)
[main 2023-07-18T05:02:16.944Z] windowsManager#open
[main 2023-07-18T05:02:16.944Z] windowsManager#open pathsToOpen [
{
backupPath: '/home/trinitronx/.config/Code - OSS/Backups/1689545493004',
remoteAuthority: undefined
}
]
[main 2023-07-18T05:02:16.944Z] windowsManager#doOpenEmpty {
restore: true,
remoteAuthority: undefined,
filesToOpen: undefined,
forceNewWindow: true
}
[main 2023-07-18T05:02:16.945Z] IPC Object URL: Registered new channel vscode:456ff340-4d7e-4735-a6b8-a1fa2d587188.
[main 2023-07-18T05:02:16.945Z] window#validateWindowState: validating window state on 1 display(s) { mode: 1, x: 0, y: 0, width: 467, height: 508 }
[main 2023-07-18T05:02:16.945Z] window#validateWindowState: 1 monitor working area { x: 0, y: 0, width: 1920, height: 1080 }
[main 2023-07-18T05:02:16.945Z] window#ctor: using window state { mode: 1, x: 0, y: 0, width: 467, height: 508 }
[2754875:0717/230216.946116:WARNING:wayland_surface.cc(149)] Server doesn't support zcr_alpha_compositing_v1.
[2754875:0717/230216.946125:WARNING:wayland_surface.cc(164)] Server doesn't support overlay_prioritizer.
[2754875:0717/230216.946127:WARNING:wayland_surface.cc(178)] Server doesn't support surface_augmenter.
[2754875:0717/230216.946130:WARNING:wayland_surface.cc(193)] Server doesn't support wp_content_type_v1
[2754875:0717/230216.946132:WARNING:wayland_surface.cc(212)] Server doesn't support zcr_color_management_surface.
[2754875:0717/230216.954393:WARNING:xdg_activation.cc(86)] Cannot activate a window because no active windows found!
[2754875:0717/230216.954429:WARNING:xdg_activation.cc(86)] Cannot activate a window because no active windows found!
[main 2023-07-18T05:02:16.954Z] window#load: attempt to load window (id: 1)
[main 2023-07-18T05:02:16.960Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 1, emptyToOpen: 0)
[main 2023-07-18T05:02:16.960Z] lifecycle (main): phase changed (value: 3)
[main 2023-07-18T05:02:16.960Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[main 2023-07-18T05:02:16.960Z] update#ctor - updates are disabled as there is no update URL
[main 2023-07-18T05:02:16.998Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[0717/230217.040530:ERROR:elf_dynamic_array_reader.h(64)] tag not found EXPAND for stacktraces via
|
So I have a similiar issue, it's just that Electron v25.3.2 works half of the time... LogUsing this command to launch electron itself... gives me this on a crash (also it hangs the terminal/doesnt give control back without Ctrl+C)
Same output is given whenever it successfully launches and it hangs at the same spot! PS: |
I've tested Tutanota and Element flatpak which both have updated to Electron 26 and the crashes are gone entirely. :) |
Are sure they haven't simply disabled Wayland? If I start the Element 1.11.42 Flatpak, it runs under XWayland 🙂 |
I have disabled X11 socket, ipc and even fallback-X11 to make sure. |
A bit offtopic, but: A simple way to test, if a window uses Xorg or Wayland, is to launch Would be great if this would be fixed with Electron 26. Unfortunately Electron 26 causes some other crashes, so I currently cannot test whether it fixes the issue for my application or not. |
Having pretty much the same issue on Electron 27 and 26, it works on 27 when using EDIT: Here's the actual error log
|
That explains why flatpak apps work fine on Electron 26 as they always use that option if I'm not mistaken. |
Another side-note: Also, one can use |
In our application, this issue seems fixed starting with Electron 28. (Version 27 still had some rendering issues, and sometimes segfaults when exiting. I did not observe this yet with 28.) |
I can also confirm that Electron 28 fixes the issue.
…On Mon, Dec 18, 2023, 13:47 Danilo Bargen ***@***.***> wrote:
In our application, this issue seems fixed starting with Electron 28.
(Version 27 still had some rendering issues, and sometimes segfaults when
exiting. I did not observe this yet with 28.)
—
Reply to this email directly, view it on GitHub
<#37531 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKHUEXTM4UIPRV6SFFZZVE3YKA3NRAVCNFSM6AAAAAAVTRXPI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRQGQYDQNZVGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Closing as fixed as per previous two comments. @threema-danilo, @RubberDuckShobe, thanks for the info! |
I see this issue in 30.x even without Wayland. |
I can confirm these crashes are no longer happening on my system running ArchLinux packages:
EXPAND for platform / package version info
|
Also confirming this is resolved (Wayland and otherwise.) |
Note: I have been running VSCode + Electron 29 on Wayland (Sway), with All the crashes on window creation seem to be fixed, even when I set However, when running with For example: Once today I saw that menu dropdown dialogs stopped appearing when clicking on the top row menu buttons (e.g. " |
Electron Version
22.0.3
What operating system are you using?
Other Linux
Operating System Version
6.2.2-arch1-1
What arch are you using?
x64
Last Known Working Electron version
?
Expected Behavior
start without crashing
Actual Behavior
Testcase Gist URL
No response
Additional Information
This is happening since I have added
to
~/.config/electron-flags.conf
.I am using sway on wayland.
The text was updated successfully, but these errors were encountered: