Bug 487571 - Firefox crashes when Explicit Sync is in use
Summary: Firefox crashes when Explicit Sync is in use
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: git-stable-Plasma/6.1
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL: https://bugzilla.mozilla.org/show_bug...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-26 08:25 UTC by George
Modified: 2024-06-19 06:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George 2024-05-26 08:25:06 UTC
SUMMARY

When launching Firefox in Wayland mode (default nowadays, at least with Nightly/beta, probably stable too), on kwin 6.0.90.1-1 with Nvidia 555 series drivers, Firefox crashes very quickly on most web pages. about:support and some internal pages seem fine. The error message printed in console is from kwin, however, not Firefox, leading me to report it here. This is also reproducible in Mutter.

STEPS TO REPRODUCE
1. Install Nvidia 555 series drivers on a system with Nvidia graphics as primary display (NOT Prime, Nvidia must be in use for the compositor)
2. Launch a plasma wayland session
3. Launch Firefox with MOZ_ENABLE_WAYLAND=1 (default), visit google.com (or many other pages reproduce)

Setting MOZ_ENABLE_WAYLAND=0 or running a Xorg session works around this.

OBSERVED RESULT

Firefox crashes

EXPECTED RESULT

Firefox not to crash

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: kwin 6.0.90.1-1
(available in About System)
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION

Firefox crashes with:
[GFX1-]: Wayland protocol error: wp_linux_drm_syncobj_surface_v1@66: error 4: explicit sync is used, but no acquire point is set

This error print is within kwin code, here: https://invent.kde.org/plasma/kwin/-/blob/master/src/wayland/linux_drm_syncobj_v1.cpp#L164
Also reported to Mozilla and Mutter (and Nvidia by email), since this seems to reproduce in many areas:
https://bugzilla.mozilla.org/show_bug.cgi?id=1898476
https://gitlab.gnome.org/GNOME/mutter/-/issues/3504
Comment 1 Zamundaaa 2024-05-27 13:05:33 UTC
Firefox is doing something forbidden by the explicit sync protocol and thus gets disconnected. There's nothing we can do about this, it has to be fixed in the NVidia driver (or in Firefox directly, both could be doing the wrong thing)
Comment 2 daron439 2024-06-18 16:07:59 UTC
Would it be possible to add an environment variable to disable explicit sync in kwin to workaround the issue for those who are satisfied with the sync just in xwayland + nvidia 555?
Comment 3 Zamundaaa 2024-06-18 17:06:57 UTC
I'd rather not. You can make Firefox run through Xwayland with MOZ_ENABLE_WAYLAND=0 to work around the problem until it's fixed.

Maybe we should add a generic way to block protocols for specific apps though