Bug 454103 - KWin crashes sporadically after switching desktops using slide effect
Summary: KWin crashes sporadically after switching desktops using slide effect
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-05-20 17:59 UTC by Ismael Asensio
Modified: 2022-06-03 22:22 UTC (History)
3 users (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 Ismael Asensio 2022-05-20 17:59:05 UTC
Application: kwin_x11 (5.24.80)
 (Compiled from sources)
Qt Version: 5.15.3
Frameworks Version: 5.95.0
Operating System: Linux 5.15.0-30-generic x86_64
Windowing System: X11
Distribution: Ubuntu 22.04 LTS
DrKonqi: 5.24.80 [KCrashBackend]

-- Information about the crash:
After switching desktops using slide effect, KWin crashes sporadically.

This is not common but has happened several times in the last few days (at least on X11). 
I haven't been able to narrow down what may trigger it, or to reproduce it consistently.

The crash can be reproduced sometimes.

-- Backtrace:
Application: KWin (kwin_x11), signal: Aborted
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = 0x0}
[KCrash Handler]
#5  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140408050842048) at ./nptl/pthread_kill.c:44
#6  __pthread_kill_internal (signo=6, threadid=140408050842048) at ./nptl/pthread_kill.c:78
#7  __GI___pthread_kill (threadid=140408050842048, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#8  0x00007fb350e56476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#9  0x00007fb350e3c7f3 in __GI_abort () at ./stdlib/abort.c:79
#10 0x00007fb3522e1ba3 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007fb3522e0ff0 in qt_assert_x(char const*, char const*, char const*, int) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007fb3537ca923 in KWin::WindowItem::unrefVisible(int) (this=0x560f0c99cae0, reason=4) at /home/isma/kde/src/kwin/src/windowitem.cpp:107
#13 0x00007fb3535ed064 in KWin::EffectWindowImpl::unrefVisible(int) (this=0x7fb34401ae70, reason=4) at /home/isma/kde/src/kwin/src/effects.cpp:1926
#14 0x0000560f0abe7549 in KWin::SlideEffect::finishedSwitching() (this=0x560f0bfbf4d0) at /home/isma/kde/src/kwin/src/effects/slide/slide.cpp:389
#15 0x0000560f0abe6ce6 in KWin::SlideEffect::postPaintScreen() (this=0x560f0bfbf4d0) at /home/isma/kde/src/kwin/src/effects/slide/slide.cpp:307
#16 0x00007fb3535e75a5 in KWin::EffectsHandlerImpl::postPaintScreen() (this=0x560f0b6de960) at /home/isma/kde/src/kwin/src/effects.cpp:387
#17 0x0000560f0abb4fb4 in KWin::DimInactiveEffect::postPaintScreen() (this=0x560f0bfe2d40) at /home/isma/kde/src/kwin/src/effects/diminactive/diminactive.cpp:155
#18 0x00007fb3535e75a5 in KWin::EffectsHandlerImpl::postPaintScreen() (this=0x560f0b6de960) at /home/isma/kde/src/kwin/src/effects.cpp:387
#19 0x00007fb3536d92c6 in KWin::Scene::postPaint() (this=0x560f0b3670f0) at /home/isma/kde/src/kwin/src/scene.cpp:397
#20 0x00007fb3536d7b20 in KWin::SceneDelegate::postPaint() (this=0x560f0b43f930) at /home/isma/kde/src/kwin/src/scene.cpp:121
#21 0x00007fb353580cd4 in KWin::Compositor::postPaintPass(KWin::RenderLayer*) (this=0x560f0b345c40, layer=0x560f0b78d560) at /home/isma/kde/src/kwin/src/composite.cpp:706
#22 0x00007fb353580a7d in KWin::Compositor::composite(KWin::RenderLoop*) (this=0x560f0b345c40, renderLoop=0x560f0b2790c0) at /home/isma/kde/src/kwin/src/composite.cpp:677
#23 0x00007fb353581f65 in KWin::X11Compositor::composite(KWin::RenderLoop*) (this=0x560f0b345c40, renderLoop=0x560f0b2790c0) at /home/isma/kde/src/kwin/src/composite.cpp:921
#24 0x00007fb35358043c in KWin::Compositor::handleFrameRequested(KWin::RenderLoop*) (this=0x560f0b345c40, renderLoop=0x560f0b2790c0) at /home/isma/kde/src/kwin/src/composite.cpp:624
#25 0x00007fb353589639 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KWin::RenderLoop*>, void, void (KWin::Compositor::*)(KWin::RenderLoop*)>::call(void (KWin::Compositor::*)(KWin::RenderLoop*), KWin::Compositor*, void**) (f=(void (KWin::Compositor::*)(class KWin::Compositor * const, class KWin::RenderLoop *)) 0x7fb353580408 <KWin::Compositor::handleFrameRequested(KWin::RenderLoop*)>, o=0x560f0b345c40, arg=0x7ffff15dc250) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152
#26 0x00007fb353589285 in QtPrivate::FunctionPointer<void (KWin::Compositor::*)(KWin::RenderLoop*)>::call<QtPrivate::List<KWin::RenderLoop*>, void>(void (KWin::Compositor::*)(KWin::RenderLoop*), KWin::Compositor*, void**) (f=(void (KWin::Compositor::*)(class KWin::Compositor * const, class KWin::RenderLoop *)) 0x7fb353580408 <KWin::Compositor::handleFrameRequested(KWin::RenderLoop*)>, o=0x560f0b345c40, arg=0x7ffff15dc250) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185
#27 0x00007fb353588a9f in QtPrivate::QSlotObject<void (KWin::Compositor::*)(KWin::RenderLoop*), QtPrivate::List<KWin::RenderLoop*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x560f0b5e7dc0, r=0x560f0b345c40, a=0x7ffff15dc250, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418
#28 0x00007fb352542783 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007fb35351f3c0 in KWin::RenderLoop::frameRequested(KWin::RenderLoop*) (this=0x560f0b2790c0, _t1=0x560f0b2790c0) at /home/isma/kde/build/kwin/src/kwin_autogen/EWIEGA46WW/moc_renderloop.cpp:206
#30 0x00007fb3536be6d3 in KWin::RenderLoopPrivate::dispatch() (this=0x560f0b27bc20) at /home/isma/kde/src/kwin/src/renderloop.cpp:152
#31 0x00007fb3536bde89 in operator()() const (__closure=0x560f0b2786a0) at /home/isma/kde/src/kwin/src/renderloop.cpp:32
#32 0x00007fb3536beddb in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7ffff15dc450) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#33 0x00007fb3536bedad in QtPrivate::Functor<KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffff15dc450) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#34 0x00007fb3536bed7c in QtPrivate::QFunctorSlotObject<KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x560f0b278690, r=0x560f0b2790c0, a=0x7ffff15dc450, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#35 0x00007fb352542783 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#36 0x00007fb3525467ee in QTimer::timeout(QTimer::QPrivateSignal) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#37 0x00007fb35253832f in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#38 0x00007fb351672713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#39 0x0000560f0aba120f in KWin::ApplicationX11::notify(QObject*, QEvent*) (this=0x7ffff15dc890, o=0x560f0b27bc38, e=0x7ffff15dc600) at /home/isma/kde/src/kwin/src/main_x11.cpp:287
#40 0x00007fb35250ae2a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#41 0x00007fb3525633db in QTimerInfoList::activateTimers() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#42 0x00007fb352561897 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#43 0x00007fb34b6a3142 in  () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#44 0x00007fb35250974b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#45 0x00007fb352511ce4 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#46 0x0000560f0aba2af9 in main(int, char**) (argc=3, argv=0x7ffff15dca48) at /home/isma/kde/src/kwin/src/main_x11.cpp:501
[Inferior 1 (process 17351) detached]

Reported using DrKonqi
Comment 1 Nate Graham 2022-05-23 17:01:26 UTC
#12 0x00007fb3537ca923 in KWin::WindowItem::unrefVisible(int) (this=0x560f0c99cae0, reason=4) at /home/isma/kde/src/kwin/src/windowitem.cpp:107
#13 0x00007fb3535ed064 in KWin::EffectWindowImpl::unrefVisible(int) (this=0x7fb34401ae70, reason=4) at /home/isma/kde/src/kwin/src/effects.cpp:1926
#14 0x0000560f0abe7549 in KWin::SlideEffect::finishedSwitching() (this=0x560f0bfbf4d0) at /home/isma/kde/src/kwin/src/effects/slide/slide.cpp:389
#15 0x0000560f0abe6ce6 in KWin::SlideEffect::postPaintScreen() (this=0x560f0bfbf4d0) at /home/isma/kde/src/kwin/src/effects/slide/slide.cpp:307
#16 0x00007fb3535e75a5 in KWin::EffectsHandlerImpl::postPaintScreen() (this=0x560f0b6de960) at /home/isma/kde/src/kwin/src/effects.cpp:387
#17 0x0000560f0abb4fb4 in KWin::DimInactiveEffect::postPaintScreen() (this=0x560f0bfe2d40) at /home/isma/kde/src/kwin/src/effects/diminactive/diminactive.cpp:155
#18 0x00007fb3535e75a5 in KWin::EffectsHandlerImpl::postPaintScreen() (this=0x560f0b6de960) at /home/isma/kde/src/kwin/src/effects.cpp:387
Comment 2 Eric Edlund 2022-05-23 20:52:55 UTC
I'll work on this
Comment 3 Eric Edlund 2022-05-23 22:33:53 UTC
Vlad in def99b1a you replaced isPaintingEnabled() with refVisible(). unrefVisible(PAINT_DISABLED_BY_DESKTOP) is failing 

windowitem.cpp:107 Q_ASSERT(m_forceVisibleByDesktopCount > 0);

after SlideEffect uses it. If I'm reading it right this is a terrible bug and there's no way of telling which effect is calling unrefVisible() when it shouldn't be?
Comment 4 Eric Edlund 2022-05-27 12:42:04 UTC
Are you using any 3rd party effects?
Comment 5 Ismael Asensio 2022-05-27 20:44:45 UTC
(In reply to Eric Edlund from comment #4)
> Are you using any 3rd party effects?

Not that I'm aware of. Just two 3rd-party scripts: "Tile Gaps" and "Sticky Window Snapping"

This are the list of plugins and effects I have currently loaded.

Plugins.LoadedPlugins:
  Arguments: [Variant(QStringList): {"kwin5_plugin_krunner", "kwin5_plugin_nightcolor"}]

Effects.LoadedEffects:
  Arguments: [Variant(QStringList): {"kwin4_effect_dialogparent", "kwin4_effect_fadingpopups", "kwin4_effect_frozenapp", "kwin4_effect_dimscreen", "kwin4_effect_sessionquit", "kwin4_effect_logout", "kwin4_effect_squash", "kwin4_effect_morphingpopups", "kwin4_effect_scale", "kwin4_effect_login", "kwin4_effect_windowaperture", "kwin4_effect_fullscreen", "kwin4_effect_maximize", "colorpicker", "touchpoints", "blendchanges", "screenshot", "screenedge", "zoom", "slidingpopups", "diminactive", "slide", "sheet", "desktopgrid", "highlightwindow", "overview", "windowview", "wobblywindows", "blur", "contrast", "startupfeedback", "kscreen"}]

FWIW, I haven't been able to reproduce the crash for the last few days (with almost daily updates to git master).
Comment 6 Eric Edlund 2022-05-30 22:12:20 UTC
I hadn't read that last part the first time

> FWIW, I haven't been able to reproduce the crash for the last few days (with almost daily updates to git master).

That's good because I'm running out of things to check. 
If/When you're confident it's gone go ahead and mark as resolved.
Comment 7 Ismael Asensio 2022-06-03 22:22:15 UTC
Closing this as I'm not able to longer reproduce it, and it hasn't had any duplicates in the time being, so it might have been caused for some shenanigans in my dev sessions.

Will keep posted if it starts reproducing again.