Bug 354486 - MagicLampEffect triggers empty subquad assert from makeGrid -> makeSubQuad
Summary: MagicLampEffect triggers empty subquad assert from makeGrid -> makeSubQuad
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: 5.4.2
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2015-10-28 06:35 UTC by Serhiy Zahoriya
Modified: 2018-06-05 04:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serhiy Zahoriya 2015-10-28 06:35:41 UTC
Application: kwin_x11 (5.4.2)

Qt Version: 5.5.1
Operating System: Linux 4.2.0-16-generic x86_64
Distribution: Ubuntu 15.10

-- Information about the crash:
- What I was doing when the application crashed:
Tried to minimize Konsole window after changing animation speed in settings. I also have some issues with Intel video drivers. Will add a Launchpad link on request if traceback doesn't indicate some internal problem.
- Unusual behavior I noticed:
Windows didn't lose decoration right away as it happened before when kwin was crashing.

The crash can be reproduced every time.

-- Backtrace:
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 0x7fa22ba2d840 (LWP 1526))]

Thread 5 (Thread 0x7fa210e89700 (LWP 1529)):
#0  0x00007fa22b51b743 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fa229b3ab7f in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timespec const*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fa229b3c67e in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timespec*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007fa229b3cbae in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fa229ae650a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fa229902ac4 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fa22446ac35 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007fa229907a6e in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fa22ab5f6aa in start_thread (arg=0x7fa210e89700) at pthread_create.c:333
#9  0x00007fa22b524eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7fa2021c4700 (LWP 1531)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fa228a94194 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#2  0x00007fa228a941d9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#3  0x00007fa22ab5f6aa in start_thread (arg=0x7fa2021c4700) at pthread_create.c:333
#4  0x00007fa22b524eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fa2029c5700 (LWP 1563)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x00007fa229908c46 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fa2299046f3 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007fa229907a6e in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fa22ab5f6aa in start_thread (arg=0x7fa2029c5700) at pthread_create.c:333
#5  0x00007fa22b524eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fa211c9e700 (LWP 1564)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x00007fa229908c46 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fa2299046f3 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007fa229907a6e in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fa22ab5f6aa in start_thread (arg=0x7fa211c9e700) at pthread_create.c:333
#5  0x00007fa22b524eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7fa22ba2d840 (LWP 1526)):
[KCrash Handler]
#6  0x00007fa22b453267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#7  0x00007fa22b454eca in __GI_abort () at abort.c:89
#8  0x00007fa22b44c03d in __assert_fail_base (fmt=0x7fa2111d35f5 "%s%s%s:%u: %s%s\320\235\320\265 \320\277\321\200\320\276\320\271\320\264\320\265\320\275\320\276 \320\277\320\265\321\200\320\265\320\262\321\226\321\200\320\272\321\203 \302\253%s\302\273.\n%n", assertion=assertion@entry=0x7fa2290b30d0 "x1 < x2 && y1 < y2 && x1 >= left() && x2 <= right() && y1 >= top() && y2 <= bottom()", file=file@entry=0x7fa2290b30a8 "../../libkwineffects/kwineffects.cpp", line=line@entry=905, function=function@entry=0x7fa2290b35a0 <KWin::WindowQuad::makeSubQuad(double, double, double, double) const::__PRETTY_FUNCTION__> "KWin::WindowQuad KWin::WindowQuad::makeSubQuad(double, double, double, double) const") at assert.c:92
#9  0x00007fa22b44c0f2 in __GI___assert_fail (assertion=assertion@entry=0x7fa2290b30d0 "x1 < x2 && y1 < y2 && x1 >= left() && x2 <= right() && y1 >= top() && y2 <= bottom()", file=file@entry=0x7fa2290b30a8 "../../libkwineffects/kwineffects.cpp", line=line@entry=905, function=function@entry=0x7fa2290b35a0 <KWin::WindowQuad::makeSubQuad(double, double, double, double) const::__PRETTY_FUNCTION__> "KWin::WindowQuad KWin::WindowQuad::makeSubQuad(double, double, double, double) const") at assert.c:101
#10 0x00007fa2290a10ec in KWin::WindowQuad::makeSubQuad (this=this@entry=0x26117c0, x1=<optimized out>, y1=y1@entry=-2, x2=<optimized out>, y2=y2@entry=38) at ../../libkwineffects/kwineffects.cpp:905
#11 0x00007fa2290a3847 in KWin::WindowQuadList::makeGrid (this=this@entry=0x7ffe84fc7538, maxQuadSize=maxQuadSize@entry=40) at ../../libkwineffects/kwineffects.cpp:1096
#12 0x00007fa228bfacbd in KWin::MagicLampEffect::prePaintWindow (this=<optimized out>, w=0x25ef3c0, data=..., time=1) at ../../effects/magiclamp/magiclamp.cpp:106
#13 0x00007fa22b0fb441 in KWin::EffectsHandlerImpl::prePaintWindow (this=0x2187b70, w=<optimized out>, data=..., time=time@entry=1) at ../effects.cpp:446
#14 0x00007fa22b0c40e9 in KWin::Scene::paintGenericScreen (this=this@entry=0x21ef4f0, orig_mask=orig_mask@entry=32) at ../scene.cpp:227
#15 0x00007fa22b0d8a04 in KWin::SceneOpenGL2::paintGenericScreen (this=this@entry=0x21ef4f0, mask=mask@entry=32, data=...) at ../scene_opengl.cpp:1110
#16 0x00007fa22b0c1a4d in KWin::Scene::finalPaintScreen (this=0x21ef4f0, mask=mask@entry=32, region=..., data=...) at ../scene.cpp:199
#17 0x00007fa22b0fb2af in KWin::EffectsHandlerImpl::paintScreen (this=0x2187b70, mask=mask@entry=32, region=..., data=...) at ../effects.cpp:415
#18 0x00007fa22909d57f in KWin::Effect::paintScreen (this=this@entry=0x262f7d0, mask=mask@entry=32, region=..., data=...) at ../../libkwineffects/kwineffects.cpp:535
#19 0x00007fa22b0fb25a in KWin::EffectsHandlerImpl::paintScreen (this=0x2187b70, mask=mask@entry=32, region=..., data=...) at ../effects.cpp:412
#20 0x00007fa22909d57f in KWin::Effect::paintScreen (this=this@entry=0x25dfeb0, mask=mask@entry=32, region=..., data=...) at ../../libkwineffects/kwineffects.cpp:535
#21 0x00007fa22b0fb25a in KWin::EffectsHandlerImpl::paintScreen (this=0x2187b70, mask=32, region=..., data=...) at ../effects.cpp:412
#22 0x00007fa22b0c167a in KWin::Scene::paintScreen (this=this@entry=0x21ef4f0, mask=mask@entry=0x7ffe84fc79f0, damage=..., repaint=..., updateRegion=updateRegion@entry=0x7ffe84fc79c0, validRegion=validRegion@entry=0x7ffe84fc79d0) at ../scene.cpp:151
#23 0x00007fa22b0ddd08 in KWin::SceneOpenGL::paint (this=0x21ef4f0, damage=..., toplevels=...) at ../scene_opengl.cpp:740
#24 0x00007fa22b0b95e3 in KWin::Compositor::performCompositing (this=0x1e32850) at ../composite.cpp:712
#25 0x00007fa229b18763 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007fa22a3dd9dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007fa22a3e2ea6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007fa229ae8d7b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007fa229b3e30d in QTimerInfoList::activateTimers() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007fa229b3cb26 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007fa21529da1d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#32 0x00007fa229ae650a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007fa229aee5ec in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007fa22b7ed4d4 in kdemain (argc=1, argv=0x7ffe84fc81a8) at ../main_x11.cpp:303
#35 0x00007fa22b43ea40 in __libc_start_main (main=0x4007a0 <main(int, char**)>, argc=1, argv=0x7ffe84fc81a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe84fc8198) at libc-start.c:289
#36 0x00000000004007d9 in _start ()

Possible duplicates by query: bug 349219, bug 347734, bug 346854, bug 344371, bug 341645.

Reported using DrKonqi
Comment 1 Thomas Lübking 2015-10-28 08:06:49 UTC
Likely similar to https://git.reviewboard.kde.org/r/125131/ - just another grid creating function....
Comment 2 Thomas Lübking 2015-10-28 22:45:17 UTC
I wasn't able to cause this (the reason would likely be an empty quad in the list, what should not happen itfp) - can you test a patch?

diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp
index 33e295c..57cdf8a 100644
--- a/libkwineffects/kwineffects.cpp
+++ b/libkwineffects/kwineffects.cpp
@@ -1082,6 +1082,10 @@ WindowQuadList WindowQuadList::makeGrid(int maxQuadSize) const
         const double quadRight  = quad.right();
         const double quadTop    = quad.top();
         const double quadBottom = quad.bottom();
+        if (quadTop >= quadBottom || quadLeft >= quadRight) {
+            qDebug() << "D'OHHHH!" << quadTop << quadLeft << quadBottom << quadRight;
+            continue;
+        }
 
         // Compute the top-left corner of the first intersecting grid cell
         const double xBegin = left + qFloor((quadLeft - left) / maxQuadSize) * maxQuadSize;



------

This should prevent the assert bug get you some D'OHHHH line(s).
Comment 3 Serhiy Zahoriya 2015-10-30 05:06:30 UTC
I can't reproduce it on another machine either (Having this problem on a laptop with intel video, can't reproduce on desktop with nvidia, both nouveau and official drivers). I've tried to compile KDE from sources, but anongit.kde.org is down right now and there is also a warning that it might not work in Kubuntu. Also the compiling wiki page is outdated at least for Kubuntu. WIll try again later.
Comment 4 Vlad Zahorodnii 2018-06-04 22:16:37 UTC
Martin, is this bug still relevant?

I think https://phabricator.kde.org/D11015 fixed this bug too.
Comment 5 Martin Flöser 2018-06-05 04:31:03 UTC
Let's assume it's fixed.