Created attachment 141693 [details] Backtrace SUMMARY: When I tried installing a sandboxed snap on my system, either from the terminal or from pamac, it sometimes causes KWin to crash. STEPS TO REPRODUCE 1. Install a sandboxed snap(or multiple sandboxed snaps) on the system 2. KWin may crash while installing the sandboxed snap OBSERVED RESULT: KWin sometimes crashes while installing a sandboxed snap. EXPECTED RESULT: The snap installs and KWin does not crash SOFTWARE/OS VERSIONS: Linux/KDE Plasma: Operating System: Arch Linux KDE Plasma Version: 5.22.90 KDE Frameworks Version: 5.86.0 Qt Version: 5.15.2 Kernel Version: 5.14.5-zen2-1-zen (64-bit) Graphics Platform: Wayland Processors: 8 × AMD Ryzen 5 3450U with Radeon Vega Mobile Gfx Memory: 5.7 GiB of RAM Graphics Processor: AMD Radeon™ Vega 8 Graphics ADDITIONAL INFORMATION: KWin also flickers everytime I install a sandboxed snap
kwin crashes in bool needsModeset = std::any_of(m_allObjects.constBegin(), m_allObjects.constEnd(), [](auto obj){return obj->needsModeset();}); which makes absolutely no any sense (yay...)
> KWin also flickers everytime I install a sandboxed snap I can reproduce flickering, but not crash. Still, it's weird...
It seems like when install or uninstall an app using snap, kwin receives udev change events for the drm card. It's strange not to say the least, but there shouldn't be flickering.
Git commit e004f1b7fcfd479632078d1ad24df31884bce0d0 by Xaver Hugl. Committed on 20/09/2021 at 12:28. Pushed by zamundaaa into branch 'master'. platforms/drm: fix buffer re-using We don't always have explicit modifiers when we're using AMS M +2 -1 src/plugins/platforms/drm/drm_pipeline.cpp https://invent.kde.org/plasma/kwin/commit/e004f1b7fcfd479632078d1ad24df31884bce0d0
Git commit 266d41cd6eab455c3ae70066782b19f3cd1012a4 by Xaver Hugl. Committed on 20/09/2021 at 12:35. Pushed by zamundaaa into branch 'Plasma/5.23'. platforms/drm: fix buffer re-using We don't always have explicit modifiers when we're using AMS (cherry picked from commit e004f1b7fcfd479632078d1ad24df31884bce0d0) M +2 -1 src/plugins/platforms/drm/drm_pipeline.cpp https://invent.kde.org/plasma/kwin/commit/266d41cd6eab455c3ae70066782b19f3cd1012a4
@Samuel can you please check your wayland logs after kwin crashes? Wayland session logs can be found at ~/.local/share/sddm/wayland-session.log. Before uploading the log, please make sure that it contains no sensitive information.
My guess is that drmModeGetProperty() fails for some requested property so DrmObject nukes it, which later causes a crash.
Created attachment 141751 [details] SDDM Plasma Wayland Log File
I have attached the sddm wayland log file
> kwin_wayland_drm: Atomic commit failed! This should never happen! Device or resource busy It looks like KWin tries to find a fitting output configuration, fails because the events happen in the middle of a frame and then there's nullptr Pipelines that might get used... should be fixed by https://invent.kde.org/plasma/kwin/-/merge_requests/1435, although I should add some more checks so that it reverts to the previous configuration in the case of failure, instead of crashing. The function should never fail but it can't hurt to make sure. In the backtrace the DrmPipeline is not nullptr though... Not sure what's going on with that tbh.
Git commit 6d79d855be0db6d4a102072e8cbc0dd593f2de92 by Xaver Hugl. Committed on 21/09/2021 at 12:18. Pushed by zamundaaa into branch 'master'. platforms/drm: waitIdle before updating outputs KMS can only ever have one frame pending at the moment. If we update the outputs while a pageflip is still pending on any output the atomic commit will fail with EBUSY, which both invalidates the testing for output configuration and makes applying the wanted configuration fail. This can be removed again once KMS gains the ability to do mailbox presentation; that will likely still take a while though. M +1 -0 src/plugins/platforms/drm/drm_gpu.cpp https://invent.kde.org/plasma/kwin/commit/6d79d855be0db6d4a102072e8cbc0dd593f2de92
Git commit acebd1abeb39a95dc5d9c544fa72241451419235 by Xaver Hugl. Committed on 21/09/2021 at 12:19. Pushed by zamundaaa into branch 'Plasma/5.23'. platforms/drm: waitIdle before updating outputs KMS can only ever have one frame pending at the moment. If we update the outputs while a pageflip is still pending on any output the atomic commit will fail with EBUSY, which both invalidates the testing for output configuration and makes applying the wanted configuration fail. This can be removed again once KMS gains the ability to do mailbox presentation; that will likely still take a while though. (cherry picked from commit 6d79d855be0db6d4a102072e8cbc0dd593f2de92) M +1 -0 src/plugins/platforms/drm/drm_gpu.cpp https://invent.kde.org/plasma/kwin/commit/acebd1abeb39a95dc5d9c544fa72241451419235
*** Bug 442794 has been marked as a duplicate of this bug. ***