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

Element doesn't work well with native Wayland #728

Open
jplatte opened this issue Sep 8, 2021 · 31 comments
Open

Element doesn't work well with native Wayland #728

jplatte opened this issue Sep 8, 2021 · 31 comments

Comments

@jplatte
Copy link

jplatte commented Sep 8, 2021

Changelog: https://www.electronjs.org/docs/breaking-changes#planned-breaking-api-changes-140

I've just tried running Element in native Wayland mode (--enable-features=UseOzonePlatform --ozone-platform=wayland) and it seems that currently breaks Element entirely in smoe circumstances (had the window be fully transparent at startup once, and in general it goes all white when trying to join a Jitsi conference). All my apps using Electron 14 as well as Chromium seem to run fine with these flags so I hope once Element upgrades it will work too :)

Being able to run Element natively under Wayland would have many advantages, most notably proper HiDPI support in wayland-based desktop environments.

@jplatte jplatte changed the title Upgrade electron to v13 Upgrade electron to v14 Sep 8, 2021
@dbkr dbkr added T-Task Tasks for the team like planning and removed T-Enhancement labels Sep 8, 2021
@wantija
Copy link

wantija commented Sep 9, 2021

Updating to Electron 14 will allow (hopefully) the desktop app to use KDE's file picker when uploading files with GTK_USE_PORTAL=1 exported, hope this happens soon!

@dbkr
Copy link
Member

dbkr commented Sep 17, 2021

Electron 14 pulls in chrome 93 which causes problems with jitsi. We'll need to make sure these are fixed before updating.

@damnms
Copy link

damnms commented Oct 8, 2021

fedora 35 has a repo for element which unfortunately does not work (anymore) because element needs a newer version of electron. workaround (at the moment) is to pass --disable-seccomp-filter-sandbox as start parameter, see element-hq/element-web#19329

@jplatte
Copy link
Author

jplatte commented Oct 15, 2021

Where can I read more about these issues with Jitsi? Could an upgrade to Electron v15 be done directly? (that's based on Chromium 94)

@novocaine
Copy link
Contributor

novocaine commented Nov 16, 2021

Changing this into a defect which describes the actual problem as we have a few people filing against this.

I think there is a known workaround noted in #728 to get it to at least start, but I'm uncertain if that solves all problems so maybe S-major is best. Changing to O-Uncommon because I think Wayland users are a small % of our user base

@novocaine
Copy link
Contributor

@jplatte - how confident are you that upgrading to Electron 14 will actually solve the Wayland issues? Are you just basing that off other Electron 14 apps seeming okay? I couldn't quickly find anything specific about Electron 14 that suggests its Wayland support is improved - I worry Element just has some specific issues that need be worked through that aren't linked to Electron version..

If you're game for testing it on your system, you could try flipping this line to 14 locally and taking the build for a spin..

@jplatte
Copy link
Author

jplatte commented Nov 16, 2021

Are you just basing that off other Electron 14 apps seeming okay?

Yes

I couldn't quickly find anything specific about Electron 14 that suggests its Wayland support is improved

Have you checked the corresponding Chromium changelogs?

If you're game for testing it on your system, you could try flipping this line to 14 locally and taking the build for a spin..

Sure, will try tomorrow.

@novocaine
Copy link
Contributor

Are you just basing that off other Electron 14 apps seeming okay?

Yes

I couldn't quickly find anything specific about Electron 14 that suggests its Wayland support is improved

Have you checked the corresponding Chromium changelogs?

I have not! Can you link to what you've noticed?

If you're game for testing it on your system, you could try flipping this line to 14 locally and taking the build for a spin..

Sure, will try tomorrow.

Awesome :)

@damnms
Copy link

damnms commented Nov 16, 2021

the problem i reported is not linked to wayland(!), this problem occurs on all fedora 35 versions, no matter which x window system is used.
this problem also affected ms teams, signal, etc. - but they already provided updates.
teams released an update that fixed it correctly, the signal version for fedora just added the mentioned start parameter.
i only posted here because i got "redirected" from my original bug report ;)

@jplatte
Copy link
Author

jplatte commented Nov 16, 2021

So I changed that line, built and ran with ./node_modules/.bin/electron . --enable-features=UseOzonePlatform --ozone-platform=wayland. It didn't even start (it did without the flags), instead raising the following errors:

[16760:1116/113754.825514:ERROR:cursor_loader.cc(114)] Failed to load a platform cursor of type kNull
[16795:0100/000000.864680:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is egl, ANGLE is
/home/jplatte/code/element-desktop/node_modules/electron/dist/electron exited with signal SIGSEGV
[16795:0100/000000.647927:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.

@jplatte
Copy link
Author

jplatte commented Nov 16, 2021

Oh, actually yarn add electron from the readme instructions seems to have overwritten the electron version to 16.0.0 ...

@jplatte
Copy link
Author

jplatte commented Nov 16, 2021

Starting from git w/o a config directory, or only at the old Riot path results in

Your Element is misconfigured

Invalid configuration: no default server specified.

Not going to open a separate issue because the issue template looks super complicated ._.

Edit: Also Ctrl+Q w/ Electron 14 + Wayland (which then displays a nicer-looking gtk3 dialog) doesn't work. I can press "Close Element", but nothing happens.

@jplatte
Copy link
Author

jplatte commented Nov 16, 2021

Alright so I managed to run it with native wayland & electron 14. The close confirmation prompt bug remains and the mouse cursor is tiny when on the window (same in regular Chromium, there's a reason using this still requires cmdline flags), but otherwise it seems usable. Notably, Jitsi works¹.

¹ I added a widget w/ the integration manager; the conference name was literally $roomName but that seems like an unrelated bug

@novocaine
Copy link
Contributor

Alright so I managed to run it with native wayland & electron 14. The close confirmation prompt bug remains and the mouse cursor is tiny when on the window (same in regular Chromium, there's a reason using this still requires cmdline flags), but otherwise it seems usable. Notably, Jitsi works¹.

¹ I added a widget w/ the integration manager; the conference name was literally $roomName but that seems like an unrelated bug

Thanks so much for getting this working and testing. Sounds promising, we will see what testing produces on other platforms.

@novocaine
Copy link
Contributor

novocaine commented Nov 16, 2021

the problem i reported is not linked to wayland(!), this problem occurs on all fedora 35 versions, no matter which x window system is used. this problem also affected ms teams, signal, etc. - but they already provided updates. teams released an update that fixed it correctly, the signal version for fedora just added the mentioned start parameter. i only posted here because i got "redirected" from my original bug report ;)

Okay - element-hq/element-web#19743 (comment) suggests that @jakobkmar at least can run Element under XOrg on Fedora 35, unless I have misunderstood something (quite possible).

If you can't get it to run under XOrg on Fedora 35, then I think we should re-open your ticket as a distinct issue (and sorry for the runaround ;)

@jakobkmar
Copy link

Okay - element-hq/element-web#19743 (comment) suggests that @jakobkmar at least can run Element under XOrg on Fedora 35, unless I have misunderstood something (quite possible).

You understood it correctly, for me it is only a Wayland issue, not a Fedora issue.

@damnms
Copy link

damnms commented Nov 17, 2021

not sure what happened but the latest version from taw (fedora repository for element) does not require --disable-seccomp anymore, so i guess that has been updated and my problem is solved

@jplatte
Copy link
Author

jplatte commented Jan 7, 2022

Sounds promising, we will see what testing produces on other platforms.

@novocaine Has there been any progress? Just got a HiDPI notebook and Element is looking quite bad since it is drawn at low resolution and then upscaled.

@t3chguy
Copy link
Member

t3chguy commented Jan 11, 2022

#299 upgrades to Electron 16 which will hopefully close this issue out.

@jplatte jplatte closed this as completed Jan 11, 2022
@jplatte jplatte reopened this Jan 11, 2022
@jplatte
Copy link
Author

jplatte commented Jan 11, 2022

That wasn't intentional. What I wanted to actually comment is that all my Electron apps except VSCode (for some reason) have regressed on this, and are now segfaulting at start (albeit only if --ozone-platform=wayland is explicitly set). "Bare" Chromium, like VSCode, works. I guess I should try building #299 and see whether that works.

Relevant upstream bug might be electron/electron#31885.

@jplatte
Copy link
Author

jplatte commented Jan 11, 2022

I tried with a dev build of element-desktop + element-web 1.9.8. It worked with my locally-installed electron from the arch linux repository while segfaulting with node_modules/.bin/electron. Both report version 16.0.6... Anyways I guess this means I can properly enjoy element desktop as a native desktop app once the next release is done and the element-desktop arch package updated 😊

@jplatte
Copy link
Author

jplatte commented Jan 13, 2022

Update: Actually, the locally-installed one crashes too.. When it launches a .asar file instead of being given an app directory. I created a debug build of Electron which took hours, but still didn't get the needed symbol information for finding out more about the crash 😢

@novocaine
Copy link
Contributor

if you're doing your own build .. you could try hacking in the electron crash reporter?

e.g. like electron/electron#26509 (comment)

(on our list to integrate this properly)

@jplatte
Copy link
Author

jplatte commented Jan 13, 2022

As long as the stack traces are all ?? entries, I don't think that would help, right? I haven't yet been able to fix that; apparently full symbols are only supported on "component builds" but I get a clang++ compile error for that, maybe I could try g++ instead.

@novocaine
Copy link
Contributor

are the stack traces totally blank, or do they tell you which executable/binary the frames are in (even if the function names are missing)? if the latter, you can still see which library is responsible for the crash

@jplatte
Copy link
Author

jplatte commented Jan 13, 2022

Thread 1 "electron" received signal SIGSEGV, Segmentation fault.
0x0000555557f75c1e in ?? ()
(gdb) bt
#0  0x0000555557f75c1e in  ()
vector-im/element-web#1  0x0000266e00d7c970 in  ()
vector-im/element-web#2  0xaf62bd6d4ee57b00 in  ()
vector-im/element-web#3  0x00007fffffffc840 in  ()
vector-im/element-web#4  0x00005555577cd42b in  ()
vector-im/element-web#5  0x0000266e00da6cc0 in  ()
vector-im/element-web#6  0x0000000000000018 in  ()
vector-im/element-web#7  0x0000000000000018 in  ()
vector-im/element-web#8  0x0000004554415453 in  ()
vector-im/element-web#9  0xaf62bd6d4ee57b00 in  ()
vector-im/element-web#10 0x0000266e00d7c970 in  ()
vector-im/element-web#11 0x00007fffffffc910 in  ()
vector-im/element-web#12 0x00007fffffffcbe0 in  ()
vector-im/element-web#13 0x00007fffffffcc60 in  ()
vector-im/element-web#14 0x00005555577bc7d8 in  ()
vector-im/element-web#15 0x000010c5080a0b4d in  ()
vector-im/element-web#16 0x000000000000026c in  ()
vector-im/element-web#17 0x00000000000003c0 in  ()
vector-im/element-web#18 0x0000266e00116488 in  ()
vector-im/element-web#19 0x0000026c000003c0 in  ()
vector-im/element-web#20 0x000003c00000026c in  ()
vector-im/element-web#21 0x0000266e00116240 in  ()
vector-im/element-web#22 0x0000000000000001 in  ()
vector-im/element-web#23 0x00007fffffffce30 in  ()
vector-im/element-web#24 0x0000000000000000 in  ()

@davidmehren
Copy link

I found a way to get stack traces without compiling electron myself:

This results in

(gdb) run /opt/Element-Nightly/resources/app.asar --ozone-platform=wayland
Starting program: /home/david/Downloads/electron-v16.0.7-linux-x64/electron /opt/Element-Nightly/resources/app.asar --ozone-platform=wayland
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe45cb640 (LWP 969571)]
[Detaching after fork from child process 969572]
[Detaching after fork from child process 969573]
[Detaching after fork from child process 969574]
[New Thread 0x7fffe3dca640 (LWP 969577)]
[New Thread 0x7fffe35c9640 (LWP 969578)]
[New Thread 0x7fffe2dc8640 (LWP 969579)]
[New Thread 0x7fffe25c7640 (LWP 969580)]
[New Thread 0x7fffe1dc6640 (LWP 969581)]
[New Thread 0x7fffe15c5640 (LWP 969582)]
[New Thread 0x7fffe0dc4640 (LWP 969583)]
[New Thread 0x7fffe0269640 (LWP 969584)]
[New Thread 0x7fffdfa68640 (LWP 969585)]
[New Thread 0x7fffdf267640 (LWP 969586)]
[New Thread 0x7fffdea66640 (LWP 969587)]
[New Thread 0x7fffe02c7640 (LWP 969588)]
/home/david/.config/Element-Nightly exists: yes
/home/david/.config/Riot-Nightly exists: no
[New Thread 0x7fffdd88a640 (LWP 969590)]
[New Thread 0x7fffdd055640 (LWP 969591)]
[New Thread 0x7fffdc831640 (LWP 969592)]
[New Thread 0x7fffdbfc9640 (LWP 969593)]
[New Thread 0x7fffdb7ac640 (LWP 969594)]
[New Thread 0x7fffdae12640 (LWP 969595)]
[Thread 0x7fffdae12640 (LWP 969595) exited]
[New Thread 0x7fffdae12640 (LWP 969596)]
[New Thread 0x7fffda290640 (LWP 969597)]
[Thread 0x7fffdae12640 (LWP 969596) exited]

(electron:969491): Gtk-WARNING **: 19:05:07.090: Theme file for volantes_light_cursors has no directories
[Thread 0x7fffda290640 (LWP 969597) exited]
[New Thread 0x7fffda290640 (LWP 969598)]
[New Thread 0x7fffdae12640 (LWP 969599)]
[Thread 0x7fffda290640 (LWP 969598) exited]
[New Thread 0x7fffda290640 (LWP 969600)]
[New Thread 0x7fffd99c5640 (LWP 969601)]
[Thread 0x7fffda290640 (LWP 969600) exited]
[Thread 0x7fffdae12640 (LWP 969599) exited]
[New Thread 0x7fffdae12640 (LWP 969602)]
[New Thread 0x7fffda290640 (LWP 969603)]
[Thread 0x7fffd99c5640 (LWP 969601) exited]
[Thread 0x7fffdae12640 (LWP 969602) exited]
[Thread 0x7fffda290640 (LWP 969603) exited]
[New Thread 0x7fffda290640 (LWP 969604)]
[New Thread 0x7fffda2b6640 (LWP 969605)]
[New Thread 0x7fffd99c5640 (LWP 969607)]
[New Thread 0x7fffdae12640 (LWP 969606)]
[New Thread 0x7fffd8196640 (LWP 969608)]
[New Thread 0x7fffd7975640 (LWP 969609)]
[New Thread 0x7fffd7174640 (LWP 969610)]
[New Thread 0x7fffd6973640 (LWP 969613)]
[New Thread 0x7fffd60b6640 (LWP 969614)]
[New Thread 0x7fffd5795640 (LWP 969615)]
[New Thread 0x7fffd4f94640 (LWP 969616)]
[New Thread 0x7fffd4793640 (LWP 969617)]
[New Thread 0x7fffd3f92640 (LWP 969618)]
[Detaching after fork from child process 969626]
Starting auto update with base URL: https://packages.element.io/nightly/update/
Auto update not supported on this platform
[New Thread 0x7fffd3112640 (LWP 969627)]
[969491:0125/190507.261418:ERROR:cursor_loader.cc(114)] Failed to load a platform cursor of type kNull
[969611:0125/190507.283905:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is egl, ANGLE is 
[969611:0125/190507.294176:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.

Thread 1 "electron" received signal SIGSEGV, Segmentation fault.
std::__1::find_if<std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, base::internal::ProjectedUnaryPredicate<base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity>(base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}&, base::identity&)::{lambda(auto:1&&)#1}>(std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, base::internal::ProjectedUnaryPredicate<base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity>(base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}&, base::identity&)::{lambda(auto:1&&)#1}) (__first=..., __last=..., __pred=...) at ../../buildtools/third_party/libc++/trunk/include/algorithm:943
Download failed: Das Argument ist ungültig.  Continuing without source file ./../../buildtools/third_party/libc++/trunk/include/algorithm.
943	../../buildtools/third_party/libc++/trunk/include/algorithm: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  std::__1::find_if<std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, base::internal::ProjectedUnaryPredicate<base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity>(base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}&, base::identity&)::{lambda(auto:1&&)#1}>(std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, base::internal::ProjectedUnaryPredicate<base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity>(base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}&, base::identity&)::{lambda(auto:1&&)#1}) (__first=..., __last=..., __pred=...) at ../../buildtools/third_party/libc++/trunk/include/algorithm:943
vector-im/element-web#1  base::ranges::find_if<std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity, std::__1::random_access_iterator_tag>(std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, std::__1::__wrap_iter<base::internal::UncheckedObserverAdapter const*>, base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity) (first=..., last=..., pred=..., proj=...) at ../../base/ranges/algorithm.h:465
vector-im/element-web#2  base::ranges::find_if<std::__1::vector<base::internal::UncheckedObserverAdapter, std::__1::allocator<base::internal::UncheckedObserverAdapter> > const&, base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity, std::__1::random_access_iterator_tag>(std::__1::vector<base::internal::UncheckedObserverAdapter, std::__1::allocator<base::internal::UncheckedObserverAdapter> > const&, base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const::{lambda(auto:1 const&)#1}, base::identity) (pred=..., range=<optimized out>, proj=...)
    at ../../base/ranges/algorithm.h:483
vector-im/element-web#3  base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::HasObserver(x11::EventObserver const*) const (obs=0x112e01bb9720, this=<optimized out>) at ../../base/observer_list.h:304
vector-im/element-web#4  base::ObserverList<x11::EventObserver, false, true, base::internal::UncheckedObserverAdapter>::AddObserver(x11::EventObserver*) (this=<optimized out>, obs=0x112e01bb9720) at ../../base/observer_list.h:271
vector-im/element-web#5  x11::Connection::AddEventObserver(x11::EventObserver*) (this=0x112e000cb808, observer=0x112e01bb9720) at ../../ui/gfx/x/connection.cc:486
vector-im/element-web#6  0x000055555769c6d4 in electron::WindowStateWatcher::WindowStateWatcher(electron::NativeWindowViews*) (this=0x112e01bb9720, window=<optimized out>) at ../../electron/shell/browser/ui/x/window_state_watcher.cc:25
vector-im/element-web#7  0x000055555768dc02 in std::__1::make_unique<electron::WindowStateWatcher, electron::NativeWindowViews*>(electron::NativeWindowViews*&&) (__args=<optimized out>) at ../../buildtools/third_party/libc++/trunk/include/__memory/unique_ptr.h:725
vector-im/element-web#8  electron::NativeWindowViews::NativeWindowViews(gin_helper::Dictionary const&, electron::NativeWindow*) (this=0x112e01026900, options=..., parent=0x0) at ../../electron/shell/browser/native_window_views.cc:268
vector-im/element-web#9  0x0000555557690a3b in electron::NativeWindow::Create(gin_helper::Dictionary const&, electron::NativeWindow*) (options=..., parent=0x0) at ../../electron/shell/browser/native_window_views.cc:1652
vector-im/element-web#10 0x000055555754075e in electron::api::BaseWindow::BaseWindow(v8::Isolate*, gin_helper::Dictionary const&) (this=<optimized out>, isolate=0x112e00460000, options=...) at ../../electron/shell/browser/api/electron_api_base_window.cc:96
vector-im/element-web#11 0x000055555754f875 in electron::api::BrowserWindow::BrowserWindow(gin::Arguments*, gin_helper::Dictionary const&) (this=0x112e000cf800, args=0x7fffffff9430, options=...) at ../../electron/shell/browser/api/electron_api_browser_window.cc:33
vector-im/element-web#12 0x0000555557551b4c in electron::api::BrowserWindow::New(gin_helper::ErrorThrower, gin::Arguments*) (thrower=..., args=0x7fffffff9430) at ../../electron/shell/browser/api/electron_api_browser_window.cc:513
vector-im/element-web#13 0x000055555755217d in base::RepeatingCallback<gin_helper::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)>::Run(gin_helper::ErrorThrower, gin::Arguments*) const & (this=0x112e01bb8e48, args=..., args=<optimized out>)
    at ../../base/callback.h:241
vector-im/element-web#14 gin_helper::internal::InvokeFactory<gin_helper::ErrorThrower, gin::Arguments*>(gin::Arguments*, base::RepeatingCallback<gin_helper::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&) (callback=..., args=<optimized out>)
    at ../../electron/shell/common/gin_helper/constructor.h:43
vector-im/element-web#15 gin_helper::internal::InvokeNew<gin_helper::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)>(base::RepeatingCallback<gin_helper::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, gin_helper::Arguments*)
    (factory=..., isolate=<optimized out>, args=0x7fffffff9430) at ../../electron/shell/common/gin_helper/constructor.h:134
vector-im/element-web#16 0x000055555754741d in base::RepeatingCallback<void (v8::Isolate*, gin_helper::Arguments*)>::Run(v8::Isolate*, gin_helper::Arguments*) const & (this=0x7fffffff9458, args=0x112e01bb9720, args=0x0) at ../../base/callback.h:241
vector-im/element-web#17 gin_helper::Invoker<gin_helper::IndicesHolder<0ul, 1ul>, v8::Isolate*, gin_helper::Arguments*>::DispatchToCallback(base::RepeatingCallback<void (v8::Isolate*, gin_helper::Arguments*)>) (this=0x7fffffff9460, callback=...)
    at ../../electron/shell/common/gin_helper/function_template.h:230
vector-im/element-web#18 gin_helper::Dispatcher<void (v8::Isolate*, gin_helper::Arguments*)>::DispatchToCallback(v8::FunctionCallbackInfo<v8::Value> const&) (info=<optimized out>) at ../../electron/shell/common/gin_helper/function_template.h:264
vector-im/element-web#19 0x00005555585982d3 in v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) (this=0x7fffffff9548, handler=...) at ../../v8/src/api/api-arguments-inl.h:152
vector-im/element-web#20 v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (isolate=0x112e00460000, function=..., new_target=..., fun_data=..., receiver=..., args=...) at ../../v8/src/builtins/builtins-api.cc:112
vector-im/element-web#21 0x0000555558596414 in v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (args=..., isolate=0x112e00460000) at ../../v8/src/builtins/builtins-api.cc:138
vector-im/element-web#22 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (args_length=<optimized out>, args_object=<optimized out>, isolate=<optimized out>) at ../../v8/src/builtins/builtins-api.cc:130
vector-im/element-web#23 0x0000068300080eb8 in  ()
vector-im/element-web#24 0x0000000000000004 in  ()
vector-im/element-web#25 0x00007fffffff97c0 in  ()
vector-im/element-web#26 0x000000000000002a in  ()
vector-im/element-web#27 0x00007fffffff9830 in  ()
vector-im/element-web#28 0x0000068300009c2f in  ()
vector-im/element-web#29 0x00000683099a9f15 in  ()
vector-im/element-web#30 0x00000683099a9f15 in  ()
vector-im/element-web#31 0x000000000000000c in  ()
vector-im/element-web#32 0x000006830800242d in  ()
vector-im/element-web#33 0x00000683085523b1 in  ()
vector-im/element-web#34 0x0000068308551bad in  ()
vector-im/element-web#35 0x0000000000000004 in  ()
vector-im/element-web#36 0x000006830852a81d in  ()
vector-im/element-web#37 0x0000000000000026 in  ()
vector-im/element-web#38 0x00007fffffff9898 in  ()
vector-im/element-web#39 0x00000683001196fb in  ()
vector-im/element-web#40 0x0000000000000000 in  ()
(gdb) 

Still not complete, but at least better than nothing.

@jplatte
Copy link
Author

jplatte commented Jan 26, 2022

Looks like this is indeed electron/electron#31885 (or electron/electron#32436 if that's not a duplicate). Either way I get the same stacktrace (on 17-beta.7 too), and the proposed fix from the first issue, electron/electron#29618, also doesn't work 🙁

I guess that PR is a good place to follow up on this.

@jplatte
Copy link
Author

jplatte commented Jan 26, 2022

I found a workaround (instructions are arch-specific) for native-wayland Element on sway!

  • Downgrade sway to 1.6.1-3 and wlroots to 0.14.1-3 if already on 1.7 / 0.15 (add to IgnorePkg in /etc/pacman.conf to exclude from regular updates)
  • Install the electron15 package
  • Add the following to .config/electron15-flags.conf:
    --enable-features=UseOzonePlatform --ozone-platform=wayland
    
  • Create /usr/local/bin/element-desktop as
    #!/bin/bash
    /usr/bin/electron15 /usr/lib/element/app.asar "$@"
  • chmod +x /usr/local/bin/element-desktop
  • Profit!

@whoizit
Copy link

whoizit commented Mar 25, 2022

for me simply works this:

  • Add the following to ~/.config/electron15-flags.conf:
    --enable-features=UseOzonePlatform --ozone-platform=wayland
  • Create ~/bin/element as
    exec /usr/bin/electron15 /usr/lib/element/app.asar "$@"
  • chmod +x /usr/local/bin/element-desktop

@glaeqen
Copy link

glaeqen commented May 8, 2023

I tested it on my machine and it seems like element-desktop crashes with

fish: Job 1, 'electron /usr/lib/element/app.a…' terminated by signal SIGSEGV (Address boundary error)

only when trying to run it with latest electron22 on Arch Linux. I installed electron{17, 19, 20, 21} and running Element manually with electron<VERSION> /usr/lib/element/app.asar --disable-dev-mode --enable-features=UseOzonePlatform --ozone-platform=wayland works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants