Bug 390953 - kwin crashes moving shaded windows
Summary: kwin crashes moving shaded windows
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.12.2
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D11015
Keywords:
: 391371 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-23 14:24 UTC by luca
Modified: 2018-03-05 18:32 UTC (History)
2 users (show)

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


Attachments
kcrash output (9.39 KB, text/plain)
2018-02-23 14:24 UTC, luca
Details
kcrash after install kwin-common-dbgsym (7.81 KB, text/plain)
2018-02-23 14:49 UTC, luca
Details
with libkwineffects11-dbgsym (7.85 KB, text/plain)
2018-02-23 16:12 UTC, luca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description luca 2018-02-23 14:24:42 UTC
Created attachment 110938 [details]
kcrash output

moving shaded windows, with rendering backend opengl 2 or 3.1, kwin crashes
works with rendering backend xrender
Comment 1 luca 2018-02-23 14:49:46 UTC
Created attachment 110941 [details]
kcrash after install kwin-common-dbgsym
Comment 2 Martin Flöser 2018-02-23 16:02:09 UTC
Application: KWin (kwin_x11), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f429d996f40 (LWP 27189))]

Thread 5 (Thread 0x7f425b98c700 (LWP 27203)):
#0  0x00007f42963e47fd in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007f42996965f4 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#2  0x00007f4299696639 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#3  0x00007f42963de51a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#4  0x00007f429d3183ef in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 4 (Thread 0x7f427739f700 (LWP 27200)):
#0  0x00007f429d30df66 in ppoll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f429a786dc1 in qt_safe_poll(pollfd*, unsigned long, timespec const*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007f429a7884de in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007f429a7302aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f429a54f35a in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f4294ecf0a5 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#6  0x00007f429a55422d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f42963de51a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007f429d3183ef in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 3 (Thread 0x7f427dede700 (LWP 27195)):
#0  0x00007ffdb5959ad5 in clock_gettime ()
#1  0x00007f429d325bd6 in clock_gettime () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f429a78aa21 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007f429a789259 in QTimerInfoList::updateCurrentTime() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f429a789835 in QTimerInfoList::timerWait(timespec&) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f429a7887e4 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f429a7302aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f429a54f35a in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f4293da4e45 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#9  0x00007f429a55422d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007f42963de51a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#11 0x00007f429d3183ef in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 2 (Thread 0x7f4280531700 (LWP 27192)):
#0  0x00007f429d30de6b in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f429c230150 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f429c231ee9 in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f428120e029 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007f429a55422d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f42963de51a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007f429d3183ef in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7f429d996f40 (LWP 27189)):
[KCrash Handler]
#6  0x00007f429d2576a0 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x00007f429d258cf7 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x00007f429d24ffca in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x00007f429d250042 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#10 0x00007f4299f03914 in KWin::WindowQuad::makeSubQuad(double, double, double, double) const () from /usr/lib/x86_64-linux-gnu/libkwineffects.so.11
#11 0x00007f4299f06883 in KWin::WindowQuadList::makeRegularGrid(int, int) const () from /usr/lib/x86_64-linux-gnu/libkwineffects.so.11
#12 0x00007f4299c6ce83 in ?? () from /usr/lib/x86_64-linux-gnu/libkwin4_effect_builtins.so.1
#13 0x00007f429cea4671 in KWin::EffectsHandlerImpl::prePaintWindow (this=0x55865e603380, w=<optimized out>, data=..., time=<optimized out>) at ./effects.cpp:410
#14 0x00007f429cea4671 in KWin::EffectsHandlerImpl::prePaintWindow (this=this@entry=0x55865e603380, w=<optimized out>, data=..., time=time@entry=16) at ./effects.cpp:410
#15 0x00007f429ce952c4 in KWin::Scene::paintSimpleScreen (this=this@entry=0x55865e06f010, orig_mask=orig_mask@entry=8, region=...) at ./scene.cpp:302
#16 0x00007f4275d89112 in KWin::SceneOpenGL2::paintSimpleScreen (this=this@entry=0x55865e06f010, mask=mask@entry=8, region=...) at ./plugins/scenes/opengl/scene_opengl.cpp:1052
#17 0x00007f429ce96157 in KWin::Scene::finalPaintScreen (this=this@entry=0x55865e06f010, mask=mask@entry=8, region=..., data=...) at ./scene.cpp:201
#18 0x00007f429cea44c5 in KWin::EffectsHandlerImpl::paintScreen (this=<optimized out>, mask=8, region=..., data=...) at ./effects.cpp:379
#19 0x00007f4299effe81 in KWin::Effect::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib/x86_64-linux-gnu/libkwineffects.so.11
#20 0x00007f429cea446d in KWin::EffectsHandlerImpl::paintScreen (this=0x55865e603380, mask=8, region=..., data=...) at ./effects.cpp:376
#21 0x00007f4299effe81 in KWin::Effect::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib/x86_64-linux-gnu/libkwineffects.so.11
#22 0x00007f429cea446d in KWin::EffectsHandlerImpl::paintScreen (this=0x55865e603380, mask=8, region=..., data=...) at ./effects.cpp:376
#23 0x00007f4299effe81 in KWin::Effect::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib/x86_64-linux-gnu/libkwineffects.so.11
#24 0x00007f429cea446d in KWin::EffectsHandlerImpl::paintScreen (this=0x55865e603380, mask=8, region=..., data=...) at ./effects.cpp:376
#25 0x00007f4299effe81 in KWin::Effect::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib/x86_64-linux-gnu/libkwineffects.so.11
#26 0x00007f429cea446d in KWin::EffectsHandlerImpl::paintScreen (this=this@entry=0x55865e603380, mask=8, region=..., data=...) at ./effects.cpp:376
#27 0x00007f429ce95e4e in KWin::Scene::paintScreen (this=this@entry=0x55865e06f010, mask=mask@entry=0x7ffdb5915ef0, damage=..., repaint=..., updateRegion=updateRegion@entry=0x7ffdb5915ed8, validRegion=validRegion@entry=0x7ffdb5915ee0, projection=..., outputGeometry=...) at ./scene.cpp:151
#28 0x00007f4275d8e8c1 in KWin::SceneOpenGL::paint (this=this@entry=0x55865e06f010, damage=..., toplevels=...) at ./plugins/scenes/opengl/scene_opengl.cpp:701
#29 0x00007f429ce883d2 in KWin::Compositor::performCompositing (this=0x55865e073860) at ./composite.cpp:747
#30 0x00007f429a76187b in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007f429b44e63c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007f429b455f04 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#33 0x00007f429a732258 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007f429a78a58e in QTimerInfoList::activateTimers() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007f429a788742 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#36 0x00007f42812710ed in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#37 0x00007f429a7302aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#38 0x00007f429a739214 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#39 0x00007f429d5e1dbb in kdemain () from /usr/lib/x86_64-linux-gnu/libkdeinit5_kwin_x11.so
#40 0x00007f429d243f2a in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#41 0x000055865bffc76a in _start ()
Comment 3 Martin Flöser 2018-02-23 16:04:13 UTC
could you try to install also dbgsym for libkwineffects?
Comment 4 luca 2018-02-23 16:12:39 UTC
Created attachment 110943 [details]
with libkwineffects11-dbgsym
Comment 5 luca 2018-02-23 20:34:43 UTC
the culprit is "woobly windows" effect.
it works fine with every windows, but not if shaded
Comment 6 Martin Flöser 2018-02-23 21:08:06 UTC
(In reply to luca from comment #5)
> the culprit is "woobly windows" effect.
> it works fine with every windows, but not if shaded

thanks, that's a really important information. We have a few similar crash reports which I was never able to reproduce. I hope that this combination makes it possible to reproduce now. Given the crashers we have I can imagine that this combination triggers it.
Comment 7 luca 2018-02-23 21:13:21 UTC
I hope it helps.
I noticed this regression after 5.10.2 -> 5.12.0 plasma update
Comment 8 Martin Flöser 2018-02-24 07:28:30 UTC
(In reply to luca from comment #7)
> I hope it helps.
> I noticed this regression after 5.10.2 -> 5.12.0 plasma update

Actually I doubt that this is a regression. More likely is a change in how it gets compiled.
Comment 9 luca 2018-03-02 20:16:23 UTC
I noticed this behaviour with breeze windows decaration, but not with plastik or dark-translucent. It seems breeze related.
Comment 10 luca 2018-03-02 20:17:20 UTC
decaration=decorations
Comment 11 Hugo Pereira Da Costa 2018-03-03 08:11:14 UTC
@Luca
Thanks for reporting the bug.
Now, since breeze code appears nowhere in the bug report, and since breeze devs (myself), have no idea about kwin effects code, (and breeze itself has no control about this code) I doubt that reassigning to breeze will help the bug being fixed. 

I would rather leave it assigned to kwin.

Please put me/keep me in cc, so that I get informed by e.g. kwin devs if there are specific things I should check in the course of investigating/fixing this bug. 

For the record: I use breeze decoration + wobbly window + opengl backgend 2, and cannot reproduce. (not that it proves anything).
Comment 12 luca 2018-03-03 08:24:40 UTC
(In reply to Hugo Pereira Da Costa from comment #11)

> 
> For the record: I use breeze decoration + wobbly window + opengl backgend 2,
> and cannot reproduce. (not that it proves anything).

with nvidia driver?
Comment 13 Martin Flöser 2018-03-03 12:31:09 UTC
We can be pretty sure that:
 * the OpenGL driver is irrelevant for this crash
 * the decoration is irrelevant for this crash
Comment 14 luca 2018-03-03 12:39:49 UTC
(In reply to Martin Flöser from comment #13)

>  * the decoration is irrelevant for this crash

Yes, but shaded woobly windows with breeze decoration triggers it.
Comment 15 Martin Flöser 2018-03-04 08:41:00 UTC
*** Bug 391371 has been marked as a duplicate of this bug. ***
Comment 16 Martin Flöser 2018-03-04 10:21:40 UTC
I was able to reproduce the issue and investigate it. The problem is caused by an invalid sized WindowQuad of the decoration shadow. So the change in shadow size in 5.12 might have triggered it. To make it clear: this is not a bug in breeze! Breeze is just the one who triggers the bug in KWin.
Comment 17 Martin Flöser 2018-03-04 10:30:15 UTC
Patch at: https://phabricator.kde.org/D11015
Comment 18 luca 2018-03-04 19:36:16 UTC
Thanks!
Comment 19 Martin Flöser 2018-03-05 18:32:39 UTC
Git commit e1afef3d4563803249dc25487bc086f753c4e0ea by Martin Flöser.
Committed on 05/03/2018 at 18:31.
Pushed by graesslin into branch 'Plasma/5.12'.

Sanity check WindowQuad before trying to create a grid out of it

Summary:
When one uses:
 * breeze as of 5.12
 * wobbly windows
 * shaded window
 * a distribution building with assert enabled

and starts to move a shaded window, KWin asserts. The root cause for
this is that WindowQuad::makeSubQuad has an assert for y1 being smaller
than y2. With the combination listed above this is not guaranteed. For
the left shadow quad the y1 and y2 are identical and thus trying to
split it, results in the assert condition.

The problem of the shadow quad having an invalid size might be addressed
as well with D10811. Due to that the generation of the quads is not
touched. Instead a sanity check is introduced to not try to split
already invalid sized quads.
FIXED-IN: 5.12.3

Test Plan: Added unit test hit the assert, now doesn't hit it any more

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

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

M  +1    -0    autotests/integration/effects/CMakeLists.txt
A  +197  -0    autotests/integration/effects/wobbly_shade_test.cpp     [License: GPL (v2)]
M  +12   -0    libkwineffects/kwineffects.cpp

https://commits.kde.org/kwin/e1afef3d4563803249dc25487bc086f753c4e0ea