Bug 395346 - Closing an application crashes Kwin
Summary: Closing an application crashes Kwin
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: platform-wayland-nested (show other bugs)
Version: 5.13.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 392614 394774 396258 396692 (view as bug list)
Depends on:
Blocks: 395807
  Show dependency treegraph
 
Reported: 2018-06-14 07:07 UTC by Nowshed H. Imran
Modified: 2018-07-20 13:45 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Wayland+
mgraesslin: X11-


Attachments
journal output (16.81 KB, text/plain)
2018-06-14 07:20 UTC, Nowshed H. Imran
Details
kwin_wayland backtrace (23.32 KB, text/plain)
2018-06-18 19:09 UTC, Stefan K.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nowshed H. Imran 2018-06-14 07:07:34 UTC
I have tried the Wayland and make it my daily driver. When I log in there is screen tearing on the left side. However, the major problem is whenever I try to close an application, the compositor hangs and the session is restarted and I am back at the login screen.  If you need terminal output, give me some terminal command.
Comment 1 Nowshed H. Imran 2018-06-14 07:19:27 UTC
I have attached journalctl -f output.
Comment 2 Nowshed H. Imran 2018-06-14 07:20:09 UTC
Created attachment 113298 [details]
journal output
Comment 3 Martin Flöser 2018-06-14 14:57:10 UTC
Please provide a backtrace of the crash.
Comment 4 Stefan K. 2018-06-18 19:09:23 UTC
I can report the same behaviour (except the tearing). I´m still on X11, but also test wayland on regular basis. The last update on KDE Neon to Plasma 5.13 breaks kwin_wayland.

Maybe the bugs #395413 and #395295 are related?


Kernel: 4.14.42-141bc7 x86_64 (64 bit) Desktop: N/A Distro: KDE neon User Edition 5.13
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Device 67df
           Display Server: X.org 1.19.5 driver: amdgpu

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: AMD Radeon (TM) RX 470 Graphics (AMD POLARIS10 / DRM 3.19.0 / 4.14.42-141bc7, LLVM 5.0.0) (0x67df)
    Version: 17.2.8
    Accelerated: yes
    Video memory: 8171MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: X.Org
OpenGL renderer string: AMD Radeon (TM) RX 470 Graphics (AMD POLARIS10 / DRM 3.19.0 / 4.14.42-141bc7, LLVM 5.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.2.8
OpenGL core profile shading language version string: 4.50
Comment 5 Stefan K. 2018-06-18 19:09:59 UTC
Created attachment 113414 [details]
kwin_wayland backtrace
Comment 6 Martin Flöser 2018-06-18 19:31:08 UTC
You are using an aurorae theme?
Comment 7 Nowshed H. Imran 2018-06-18 20:02:07 UTC
I have no idea how but the problem is solved for me. Right now, when I drag a subtitle to vlc the session crashes. Problem may lie with vlc. I don't know how to collect information when my system crashes.
Comment 8 David Edmundson 2018-06-18 20:23:28 UTC
From the trace, yes.

We close our window, that closes the aurorae render Aurore instance, which in turn kills our QQuickWindow (m_view)

QQuickRenderControlPrivate::windowDestroyed has this lovely line:

QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete) 

which is a truly horrible thing to do as it puts kwin in a very bizarre state which I don't think we should even try guarding round.

swapping round render control and window destruction won't help
Deferring the deletion of the QQuickRenderControl probably would
Comment 9 David Edmundson 2018-06-19 15:21:33 UTC
*** Bug 394774 has been marked as a duplicate of this bug. ***
Comment 10 Stefan K. 2018-06-19 20:08:00 UTC
Aah, I see. You are right. kwin only crashes if I use another window decoration than breeze. Colors or "Erscheinungsbild" (just not having the exact english prase at hand) do not matter. I have tested with the bundled plastik and downloaded ark (dark) and forman. To be sure I repeated these tests with an ephemeral fresh user account. The results are the same.
Comment 11 Nowshed H. Imran 2018-06-20 08:34:41 UTC
Definitely theme problem. I switched to breeze and no crash in wayland. Thanks, martin for your time.
Comment 12 David Edmundson 2018-06-20 08:39:48 UTC
Git commit 275b7ee0f456328de870dcdc297871d4eb8cfff2 by David Edmundson.
Committed on 20/06/2018 at 08:39.
Pushed by davidedmundson into branch 'Plasma/5.13'.

Workaround crash in Aurorae destruction

Summary:
Workaround QtBug-68997

Deleting of a RenderControl/render controlled window triggers deletion
of other queued deleted items, putting KWin in a corrupt state. See Qt
bug report.

Deleting this queued means we know we don't have anything else going on
in the stack which should make this somewhat safe.

Test Plan:
Couldn't reproduce original crash. Based purely on the incomplete backtrace and code reading

Set an Aurorae theme. Closed some windows. Things still worked as before

Reviewers: #kwin, #plasma, mart

Reviewed By: #kwin, #plasma, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13614

M  +4    -6    plugins/kdecorations/aurorae/src/aurorae.cpp
M  +5    -1    plugins/kdecorations/aurorae/src/aurorae.h

https://commits.kde.org/kwin/275b7ee0f456328de870dcdc297871d4eb8cfff2
Comment 13 David Edmundson 2018-07-11 21:46:15 UTC
*** Bug 396258 has been marked as a duplicate of this bug. ***
Comment 14 David Edmundson 2018-07-11 21:48:04 UTC
FWIW, my workaround was reverted as it caused another error.
My proper fix in Qt 5.12 still remains.

I'm not sure if it's worth me redoing the workaround concept but at a different level.
Comment 15 David Edmundson 2018-07-11 21:48:59 UTC
*** Bug 392614 has been marked as a duplicate of this bug. ***
Comment 16 David Edmundson 2018-07-20 13:45:38 UTC
*** Bug 396692 has been marked as a duplicate of this bug. ***