Bug 444381

Summary: KWin sometimes crashes in KWin::EffectQuickView::update() when entering overview
Product: [Plasma] kwin Reporter: tgnff242
Component: effects-overviewAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: nate, nishant.119, travneff
Priority: NOR    
Version: 5.23.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.23.5
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 446753    
Attachments: backtrace
supportInformation

Description tgnff242 2021-10-25 19:43:43 UTC
Created attachment 142866 [details]
backtrace

SUMMARY

I have verified the crash on archlinux and Neon. I've got a backtrace with symbols from the latter.

STEPS TO REPRODUCE
1. Enable the new overview effect.
2. Enter overview. -- Entering and exiting overview rapidly will certainly cause a crash sooner or later. You can use either the shortcut or a hot corner, but I used a hot corner to get the backtrace.


SOFTWARE/OS VERSIONS
Linux: Archlinux and Neon
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2 (+KDE patches)
Comment 1 tgnff242 2021-10-25 19:50:00 UTC
Created attachment 142867 [details]
supportInformation
Comment 2 Nate Graham 2021-10-25 23:07:43 UTC
Pasting inline:


Thread 1 (Thread 0x7fcee58cf080 (LWP 3159)):
[KCrash Handler]
#4  0x00007fceea5e29f3 in QSGOpenGLAtlasTexture::AtlasBase::bind (this=0x55fc5c92b010, filtering=QSGTexture::Linear) at scenegraph/util/qsgopenglatlastexture.cpp:229
#5  0x00007fceea5dead4 in QSGOpaqueTextureMaterialShader::updateState (this=0x55fc5e1d05a0, state=..., newEffect=<optimized out>, oldEffect=0x55fc5e0381d8) at scenegraph/util/qsgtexturematerial.cpp:112
#6  0x00007fceea5c2179 in QSGBatchRenderer::Renderer::renderMergedBatch (this=0x55fc5e1a9ba0, batch=0x55fc5e1c0ed0) at ../../include/QtQuick/5.15.3/QtQuick/private/../../../../../src/quick/scenegraph/coreapi/qsgrenderer_p.h:197
#7  0x00007fceea5c7cd5 in QSGBatchRenderer::Renderer::renderBatches (this=this@entry=0x55fc5e1a9ba0) at scenegraph/coreapi/qsgbatchrenderer.cpp:4066
#8  0x00007fceea5c822a in QSGBatchRenderer::Renderer::render (this=<optimized out>) at scenegraph/coreapi/qsgbatchrenderer.cpp:4363
#9  0x00007fceea5abde4 in QSGRenderer::renderScene (bindable=..., this=0x55fc5e1a9ba0) at scenegraph/coreapi/qsgrenderer.cpp:264
#10 QSGRenderer::renderScene (this=0x55fc5e1a9ba0, bindable=...) at scenegraph/coreapi/qsgrenderer.cpp:220
#11 0x00007fceea5ac29b in QSGRenderer::renderScene (fboId=<optimized out>, this=<optimized out>) at scenegraph/coreapi/qsgrenderer.cpp:205
#12 QSGRenderer::renderScene (this=<optimized out>, fboId=<optimized out>) at scenegraph/coreapi/qsgrenderer.cpp:192
#13 0x00007fceea61b047 in QSGDefaultRenderContext::renderNextFrame (this=0x55fc5e15ef40, renderer=0x55fc5e1a9ba0, fboId=<optimized out>) at scenegraph/qsgdefaultrendercontext.cpp:228
#14 0x00007fceea688999 in QQuickWindowPrivate::renderSceneGraph (this=this@entry=0x55fc5e0adc80, size=..., surfaceSize=...) at items/qquickwindow.cpp:617
#15 0x00007fceea712abd in QQuickRenderControl::render (this=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsize.h:125
#16 0x00007fceeb3cd623 in KWin::EffectQuickView::update (this=0x7fcee000c6c0) at ./src/libkwineffects/kwineffectquickview.cpp:238
#17 KWin::EffectQuickView::update (this=0x7fcee000c6c0) at ./src/libkwineffects/kwineffectquickview.cpp:205
#18 0x00007fceec41c919 in QObject::event (this=0x7fcee000c6c0, e=0x55fc5e1c6da0) at kernel/qobject.cpp:1314
#19 0x00007fceeba41dc3 in QApplicationPrivate::notify_helper (this=this@entry=0x55fc5c1585b0, receiver=receiver@entry=0x7fcee000c6c0, e=e@entry=0x55fc5e1c6da0) at kernel/qapplication.cpp:3632
#20 0x00007fceeba4abb8 in QApplication::notify (this=0x7fff621e2aa0, receiver=0x7fcee000c6c0, e=0x55fc5e1c6da0) at kernel/qapplication.cpp:3156
#21 0x00007fceec3eed7a in QCoreApplication::notifyInternal2 (receiver=0x7fcee000c6c0, event=0x55fc5e1c6da0) at ../../include/QtCore/5.15.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#22 0x00007fceec3f1681 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55fc5c1333f0) at kernel/qcoreapplication.cpp:1821
#23 0x00007fceec44696e in QEventDispatcherUNIX::processEvents (this=0x55fc5c21cc60, flags=...) at kernel/qeventdispatcher_unix.cpp:468
#24 0x00007fcee55ec262 in QXcbUnixEventDispatcher::processEvents (this=0x55fc5c21cc60, flags=...) at qxcbeventdispatcher.cpp:60
#25 0x00007fceec3ed87b in QEventLoop::exec (this=this@entry=0x7fff621e29b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#26 0x00007fceec3f5a34 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#27 0x000055fc5b398ae3 in main (argc=<optimized out>, argv=0x7fff621e2c58) at ./src/main_x11.cpp:483
[Inferior 1 (process 3159) detached]
Comment 3 Vlad Zahorodnii 2021-10-26 06:00:22 UTC
We've got a few bug reports about crashing in EffectQuickView. I'm not sure how kwin could cause that crash, unless it's a bug in the batch renderer itself.
Comment 4 Nate Graham 2021-11-23 21:45:48 UTC
*** Bug 445677 has been marked as a duplicate of this bug. ***
Comment 5 Bug Janitor Service 2021-12-13 10:57:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1791
Comment 6 Vlad Zahorodnii 2021-12-13 13:49:03 UTC
Git commit 64f2cdf9ed290a1fb7c2bf41753613078eb023c4 by Vlad Zahorodnii.
Committed on 13/12/2021 at 13:29.
Pushed by vladz into branch 'master'.

Fix memory leak in some plasma components

A few plasma components cache QSGTexture. Those components rely on
texture references going away with QSGNode users. However, with the
current tear down logic, OffscreenQuickView won't destroy any paint
nodes.

Destroy QQuickRenderControl before QQuickWindow to ensure that are no
paint nodes left alive after OffscreenQuickView.
Related: bug 444429, bug 444077, bug 444306

M  +7    -4    src/libkwineffects/kwinoffscreenquickview.cpp

https://invent.kde.org/plasma/kwin/commit/64f2cdf9ed290a1fb7c2bf41753613078eb023c4
Comment 7 Vlad Zahorodnii 2021-12-13 15:36:56 UTC
Git commit 8accc777a5b3ab1e53341f1838ed636652dc1221 by Vlad Zahorodnii.
Committed on 13/12/2021 at 14:04.
Pushed by vladz into branch 'Plasma/5.23'.

Fix memory leak in some plasma components

A few plasma components cache QSGTexture. Those components rely on
texture references going away with QSGNode users. However, with the
current tear down logic, OffscreenQuickView won't destroy any paint
nodes.

Destroy QQuickRenderControl before QQuickWindow to ensure that are no
paint nodes left alive after OffscreenQuickView.
Related: bug 444429, bug 444077, bug 444306
(cherry picked from commit 64f2cdf9ed290a1fb7c2bf41753613078eb023c4)

M  +7    -5    src/libkwineffects/kwineffectquickview.cpp

https://invent.kde.org/plasma/kwin/commit/8accc777a5b3ab1e53341f1838ed636652dc1221
Comment 8 Andrew 2022-01-09 15:13:25 UTC
I had same, maybe. Happened while just using Firefox browser with no additional actions with windows, I think.
KDE installed from Fedora 35 repos
Might be related:  bug# 446606


Application: kwin_x11 (5.23.4)

Qt Version: 5.15.2
Frameworks Version: 5.89.0
Operating System: Linux 5.15.12-200.fc35.x86_64+debug x86_64
Windowing System: X11
Distribution: "Fedora release 35 (Thirty Five)"
DrKonqi: 5.23.4 [KCrashBackend]

-- Backtrace:
Application: KWin (kwin_x11), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  0x0000561c42b9b100 in  ()
#7  0x00007efdf177d460 in QSGOpenGLAtlasTexture::AtlasBase::bind(QSGTexture::Filtering) (filtering=QSGTexture::Linear, this=0x561c4334fcb0) at scenegraph/util/qsgopenglatlastexture.cpp:263
#8  QSGOpenGLAtlasTexture::TextureBase::bind() (this=<optimized out>) at scenegraph/util/qsgopenglatlastexture.cpp:521
#9  0x00007efdf177ccb4 in QSGOpaqueTextureMaterialShader::updateState(QSGMaterialShader::RenderState const&, QSGMaterial*, QSGMaterial*) (this=0x561c4387cd10, state=..., newEffect=<optimized out>, oldEffect=0x561c436f88c0) at scenegraph/util/qsgtexturematerial.cpp:112
#10 0x00007efdf17656e9 in QSGBatchRenderer::Renderer::renderMergedBatch(QSGBatchRenderer::Batch const*) (batch=<optimized out>, this=0x561c4389cf40) at scenegraph/coreapi/qsgbatchrenderer.cpp:3097
#11 QSGBatchRenderer::Renderer::renderMergedBatch(QSGBatchRenderer::Batch const*) (this=0x561c4389cf40, batch=<optimized out>) at scenegraph/coreapi/qsgbatchrenderer.cpp:3026
#12 0x00007efdf1768ba5 in QSGBatchRenderer::Renderer::renderBatches() (this=this@entry=0x561c4389cf40) at scenegraph/coreapi/qsgbatchrenderer.cpp:4066
#13 0x00007efdf1769112 in QSGBatchRenderer::Renderer::render() (this=<optimized out>) at scenegraph/coreapi/qsgbatchrenderer.cpp:4363
#14 0x00007efdf17557e4 in QSGRenderer::renderScene(QSGBindable const&) (bindable=<optimized out>, this=0x561c4389cf40) at scenegraph/coreapi/qsgrenderer.cpp:264
#15 QSGRenderer::renderScene(QSGBindable const&) (this=0x561c4389cf40, bindable=<optimized out>) at scenegraph/coreapi/qsgrenderer.cpp:220
#16 0x00007efdf1755c6b in QSGRenderer::renderScene(unsigned int) (fboId=<optimized out>, this=<optimized out>) at scenegraph/coreapi/qsgrenderer.cpp:205
#17 QSGRenderer::renderScene(unsigned int) (this=<optimized out>, fboId=<optimized out>) at scenegraph/coreapi/qsgrenderer.cpp:192
#18 0x00007efdf17aeb45 in QSGDefaultRenderContext::renderNextFrame(QSGRenderer*, unsigned int) (this=0x561c43813340, renderer=0x561c4389cf40, fboId=<optimized out>) at scenegraph/qsgdefaultrendercontext.cpp:228
#19 0x00007efdf1809629 in QQuickWindowPrivate::renderSceneGraph(QSize const&, QSize const&) (this=0x7efdd8044310, size=<optimized out>, surfaceSize=<optimized out>) at items/qquickwindow.cpp:617
#20 0x00007efdf189714b in QQuickRenderControl::render() (this=<optimized out>) at items/qquickrendercontrol.cpp:355
#21 0x00007efdf2255127 in KWin::EffectQuickView::update() (this=0x561c42a300a0) at /usr/src/debug/kwin-5.23.4-1.fc35.x86_64/src/libkwineffects/kwineffectquickview.cpp:238
#22 KWin::EffectQuickView::update() (this=0x561c42a300a0) at /usr/src/debug/kwin-5.23.4-1.fc35.x86_64/src/libkwineffects/kwineffectquickview.cpp:205
#23 0x00007efdf33053e9 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffeceddbd30, r=<optimized out>, this=0x561c419cbef0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#24 doActivate<false>(QObject*, int, void**) (sender=0x561c42d700d0, signal_index=3, argv=0x7ffeceddbd30) at kernel/qobject.cpp:3886
#25 0x00007efdf3300367 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7efdf35aa5a0 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffeceddbd30) at kernel/qobject.cpp:3946
#26 0x00007efdf330868e in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
#27 0x00007efdf32fbedf in QObject::event(QEvent*) (this=0x561c42d700d0, e=0x7ffeceddbe90) at kernel/qobject.cpp:1336
#28 0x00007efdf2941443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x561c42d700d0, e=0x7ffeceddbe90) at kernel/qapplication.cpp:3632
#29 0x00007efdf32d17d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x561c42d700d0, event=0x7ffeceddbe90) at kernel/qcoreapplication.cpp:1064
#30 0x00007efdf3321ea3 in QTimerInfoList::activateTimers() (this=this@entry=0x561c40191e18) at kernel/qtimerinfo_unix.cpp:643
#31 0x00007efdf331f660 in QEventDispatcherUNIXPrivate::activateTimers() (this=this@entry=0x561c40191d90) at kernel/qeventdispatcher_unix.cpp:249
#32 0x00007efdf3320470 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x561c402618d0, flags=...) at kernel/qeventdispatcher_unix.cpp:516
#33 0x00007efddf50d4f2 in QXcbUnixEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x561c402618d0, flags=...) at qxcbeventdispatcher.cpp:60
#34 0x00007efdf32d01e2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffeceddc010, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#35 0x00007efdf32d8724 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#36 0x0000561c3fddebad in main(int, char**) (argc=<optimized out>, argv=0x7ffeceddc2f8) at /usr/src/debug/kwin-5.23.4-1.fc35.x86_64/src/main_x11.cpp:483
[Inferior 1 (process 2067) detached]

Possible duplicates by query: bug 446606, bug 445980, bug 445677, bug 444429, bug 444381.
Comment 9 Vlad Zahorodnii 2022-01-10 08:50:07 UTC
@Andrew the crash should be fixed in 5.23.5