Bug 428680 - kwin crashes after opening krita
Summary: kwin crashes after opening krita
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-04 11:31 UTC by Vlad Zahorodnii
Modified: 2020-11-05 07:08 UTC (History)
2 users (show)

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


Attachments
first case: kwin crashes after clicking pointer (13.35 KB, text/plain)
2020-11-04 11:32 UTC, Vlad Zahorodnii
Details
second case: kwin crashes just randomly (7.21 KB, text/plain)
2020-11-04 11:32 UTC, Vlad Zahorodnii
Details
the moment kwin is about to crash (note the desktop window displays krita's splash screen) (2.13 MB, image/jpeg)
2020-11-04 11:50 UTC, Vlad Zahorodnii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad Zahorodnii 2020-11-04 11:31:35 UTC
SUMMARY
Sometimes after opening krita, kwin_wayland crashes. I've noticed that before kwin crashes either Dolphin or a desktop window starts paining contents of Krita.

STEPS TO REPRODUCE
1. Open Krita

OBSERVED RESULT
Crash.

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Vlad Zahorodnii 2020-11-04 11:32:06 UTC
Created attachment 133016 [details]
first case: kwin crashes after clicking pointer
Comment 2 Vlad Zahorodnii 2020-11-04 11:32:26 UTC
Created attachment 133017 [details]
second case: kwin crashes just randomly
Comment 3 Vlad Zahorodnii 2020-11-04 11:33:19 UTC
I don't understand how XdgToplevelClient::surface() can return null. It should never happen.
Comment 4 Vlad Zahorodnii 2020-11-04 11:50:29 UTC
Created attachment 133019 [details]
the moment kwin is about to crash (note the desktop window displays krita's splash screen)
Comment 5 Vlad Zahorodnii 2020-11-04 12:16:06 UTC
It seems like this bug affects only git master.
Comment 6 Vlad Zahorodnii 2020-11-04 13:13:54 UTC
This is a regression introduced by https://invent.kde.org/plasma/kwin/-/commit/28b6db4993612ae7c7244faa07420b19e373b418. Weird.
Comment 7 Vlad Zahorodnii 2020-11-04 13:15:16 UTC
Ah resource ids are not unique across clients.
Comment 8 Bug Janitor Service 2020-11-04 13:42:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/424
Comment 9 Vlad Zahorodnii 2020-11-04 14:02:25 UTC
Git commit d91da41cef17e34841ad307041fc00f76c105ba6 by Vlad Zahorodnii.
Committed on 04/11/2020 at 13:35.
Pushed by vladz into branch 'master'.

wayland: Fix binding of xwayland surfaces to windows

Surface ids are not unique across clients. If the underlying surface of
an XdgToplevelClient is replaced with an Xwayland's surface, you may see
weird results such as a desktop window having the contents of an X11
window or even worse a crash.

M  +18   -5    wayland_server.cpp

https://invent.kde.org/plasma/kwin/commit/d91da41cef17e34841ad307041fc00f76c105ba6
Comment 10 Vlad Zahorodnii 2020-11-04 18:21:52 UTC
Not sure about Fixed-In. It's a git master regression.
Comment 11 Nate Graham 2020-11-04 20:10:54 UTC
Oh I see.
Comment 12 Brian 2020-11-04 21:58:48 UTC
(In reply to Vlad Zahorodnii from comment #9)
> Git commit d91da41cef17e34841ad307041fc00f76c105ba6 by Vlad Zahorodnii.
> Committed on 04/11/2020 at 13:35.
> Pushed by vladz into branch 'master'.
> 
> wayland: Fix binding of xwayland surfaces to windows
> 
> Surface ids are not unique across clients. If the underlying surface of
> an XdgToplevelClient is replaced with an Xwayland's surface, you may see
> weird results such as a desktop window having the contents of an X11
> window or even worse a crash.
> 
> M  +18   -5    wayland_server.cpp
> 
> https://invent.kde.org/plasma/kwin/commit/
> d91da41cef17e34841ad307041fc00f76c105ba6


I'm curious if this could have been the cause of 400987 ?
Comment 13 Vlad Zahorodnii 2020-11-05 07:08:14 UTC
(In reply to Brian from comment #12)
> I'm curious if this could have been the cause of 400987 ?

I doubt... However, I have never seen bug 400987 in action.