Bug 449103

Summary: Crash on exit
Product: [Plasma] kwin Reporter: David Edmundson <kde>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: crash CC: nate, nortexoid
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description David Edmundson 2022-01-24 21:48:05 UTC
(gdb) bt
#0  0x00007fbbf86bf01b in dri2_wl_release_buffer (user_data=0x55fd6a23ebf0, buffer=0x55fd6af469c0)
    at ../src/egl/drivers/dri2/egl_dri2.c:3235
#1  0x00007fbbf86d07a7 in destroy_buffer (resource=<optimized out>) at ../src/egl/wayland/wayland-drm/wayland-drm.c:48
#2  0x00007fbc0eb54e87 in destroy_resource (element=0x55fd6b238850, data=<optimized out>, flags=0)
    at ../src/wayland-server.c:727
#3  0x00007fbc0eb5b260 in for_each_helper
    (func=func@entry=0x7fbc0eb54df0 <destroy_resource>, data=data@entry=0x7ffe97628014, entries=0x55fd6a399360, entries=<optimized out>) at ../src/wayland-util.c:376
#4  0x00007fbc0eb5b750 in wl_map_for_each (map=0x55fd6a399360, func=0x7fbc0eb54df0 <destroy_resource>, data=0x7ffe97628014)
    at ../src/wayland-util.c:390
#5  0x00007fbc0eb55919 in wl_client_destroy (client=0x55fd6a399330) at ../src/wayland-server.c:886
#6  0x00007fbc0eb5632e in wl_display_destroy_clients (display=0x55fd69fe1820) at ../src/wayland-server.c:1459
#7  0x00007fbc0ebfa032 in KWaylandServer::Display::~Display() (this=0x55fd6a0081d0)
    at /home/david/projects/kde5/src/kde/workspace/kwayland-server/src/server/display.cpp:48
#8  0x00007fbc0f27fe0e in KWin::KWinDisplay::~KWinDisplay() (this=0x55fd6a0081d0)
    at /home/david/projects/kde5/src/kde/workspace/kwin/src/wayland_server.cpp:92
#9  0x00007fbc0f27fe39 in KWin::KWinDisplay::~KWinDisplay() (this=0x55fd6a0081d0)
    at /home/david/projects/kde5/src/kde/workspace/kwin/src/wayland_server.cpp:92
#10 0x00007fbc0c79abee in QObjectPrivate::deleteChildren() () at /usr/lib/libQt5Core.so.5
#11 0x00007fbc0c7a5985 in QObject::~QObject() () at /usr/lib/libQt5Core.so.5
#12 0x00007fbc0f276305 in KWin::WaylandServer::~WaylandServer() (this=0x55fd69ff5ee0)



I think based on this the order should be:

 - wl_display_destroy_clients
 - eglTerminate (aka destroying kwin's platform)
 - wl_display_destroy

that will also fix another issue I have with closing kwin emitting Output::~Output on clients.
Comment 1 Bug Janitor Service 2022-01-24 22:20:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1939
Comment 2 Michael D 2022-01-25 15:07:27 UTC
I had the same issue recently. Cursor moves but can't interact with apps.