Bug 435192

Summary: Certain System Monitor widget display styles crash Plasmashell in KSysGuard::SensorFace>::~QQmlElement() when selecting another display style
Product: [Plasma] plasmashell Reporter: logicalwillow <roblokazyt>
Component: System MonitorAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: ahiemstra, bugseforuns, ByteEnable, dontarius, emaster987, feichong.zgbl, kde, kdebugs, matheus.scattolinanselmo, msdobrescu, nate, notmart, postix
Priority: NOR    
Version: 5.21.3   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.21.5
Attachments: New crash information added by DrKonqi

Description logicalwillow 2021-03-31 17:01:37 UTC
SUMMARY
When you select the Applications Table or Process Table in a System Monitor widget on your desktop (I haven't tried panels yet, but it probably does the same thing) and then select another type, it crashes Plasma Shell.

STEPS TO REPRODUCE
1. Add a System Monitor widget to your desktop
2. Edit the widget, and set the display style to Applications Table or Process Table
3. Select another display style that isn't Applications Table or Process Table
4. Plasma Shell crashes

OBSERVED RESULT
Plasma Shell crashes when you do these steps.

EXPECTED RESULT
It's supposed to change the display style normally, without crashing.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kernel 5.4
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80
Qt Version: 5.15.2
Comment 1 David Redondo 2021-04-01 07:46:01 UTC
Changing ApplciationTable to LineChart:
#0  0x000055555a8ccb30 in  ()
#1  0x00007ffff01fe7e4 in QQuickDialogButtonBoxPrivate::getContentWidth() const (this=0x55555a105aa0) at qquickdialogbuttonbox.cpp:325
#2  0x00007ffff01f4238 in QQuickControlPrivate::updateImplicitContentWidth() (this=0x55555a105aa0) at qquickcontrol.cpp:462
#3  0x00007ffff01fe9d5 in QQuickDialogButtonBoxPrivate::itemImplicitWidthChanged(QQuickItem*) (this=0x55555a105aa0, item=0x555555938c70) at qquickdialogbuttonbox.cpp:202
#4  0x00007ffff766720d in QQuickItemPrivate::implicitWidthChanged() (this=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qarraydata.h:236
#5  0x00007ffff76603b6 in QQuickItem::setImplicitSize(double, double) (this=this@entry=0x555555938c70, w=w@entry=0, h=h@entry=0) at items/qquickitem.cpp:6935
#6  0x00007fffe04aa802 in QQuickLayoutPrivate::applySizeHints() const (this=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsize.h:315
#7  0x00007fffe04aa84b in QQuickLayout::ensureLayoutItemsUpdated() const (this=<optimized out>) at qquicklayout.cpp:854
#8  0x00007fffe04adcfe in QQuickGridLayoutBase::itemCount() const (this=<optimized out>) at qquicklinearlayout.cpp:432
#9  0x00007fffe04a9a88 in QQuickLayout::deactivateRecur() (this=this@entry=0x555555938c70) at qquicklayout.cpp:916
#10 0x00007fffe04adc62 in QQuickGridLayoutBase::~QQuickGridLayoutBase() (this=0x555555938c70, __in_chrg=<optimized out>) at qquicklinearlayout.cpp:313
#11 0x00007fffe04b51d5 in QQuickLinearLayout::~QQuickLinearLayout() (this=0x555555938c70, __in_chrg=<optimized out>) at ./qquicklinearlayout_p.h:228
#12 QQuickRowLayout::~QQuickRowLayout() (this=0x555555938c70, __in_chrg=<optimized out>) at ./qquicklinearlayout_p.h:228
#13 QQmlPrivate::QQmlElement<QQuickRowLayout>::~QQmlElement() (this=0x555555938c70, __in_chrg=<optimized out>) at ../../../include/QtQml/../../src/qml/qml/qqmlprivate.h:144
#14 QQmlPrivate::QQmlElement<QQuickRowLayout>::~QQmlElement() (this=0x555555938c70, __in_chrg=<optimized out>) at ../../../include/QtQml/../../src/qml/qml/qqmlprivate.h:144
#15 0x00007ffff5bdfcfe in QObjectPrivate::deleteChildren() (this=0x55555a105aa0) at kernel/qobject.cpp:2104
#16 0x00007ffff5bea726 in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1082
#17 0x00007ffff766dc2a in QQuickItem::~QQuickItem() (this=0x55555a1059e0, __in_chrg=<optimized out>) at items/qquickitem.cpp:2364
#18 0x00007fffe0d04659 in  () at /usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Templates.2/libqtquicktemplates2plugin.so
#19 0x00007ffff5bdfcfe in QObjectPrivate::deleteChildren() (this=0x555559f80090) at kernel/qobject.cpp:2104
#20 0x00007ffff5bea726 in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1082
#21 0x00007fffe0d027d2 in  () at /usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Templates.2/libqtquicktemplates2plugin.so
#22 0x00007ffff5bdfcfe in QObjectPrivate::deleteChildren() (this=0x555555ab3200) at kernel/qobject.cpp:2104
#23 0x00007ffff5bea726 in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1082
#24 0x00007ffff766dc2a in QQuickItem::~QQuickItem() (this=0x555559710c20, __in_chrg=<optimized out>) at items/qquickitem.cpp:2364
#25 0x00007fffe0116a49 in QQmlPrivate::QQmlElement<KSysGuard::SensorFace>::~QQmlElement() (this=0x555559710c20, __in_chrg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtQml/qqmlprivate.h:142
#26 QQmlPrivate::QQmlElement<KSysGuard::SensorFace>::~QQmlElement() (this=0x555559710c20, __in_chrg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtQml/qqmlprivate.h:144
#27 0x00007ffff5be3013 in QObject::event(QEvent*) (this=this@entry=0x555559710c20, e=e@entry=0x55555ca07d40) at kernel/qobject.cpp:1301
#28 0x00007ffff766f7e9 in QQuickItem::event(QEvent*) (this=0x555559710c20, ev=0x55555ca07d40) at items/qquickitem.cpp:8202
#29 0x00007ffff68b2dc3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x5555556211d0, receiver=receiver@entry=0x555559710c20, e=e@entry=0x55555ca07d40)
    at kernel/qapplication.cpp:3632
#30 0x00007ffff68bbbb8 in QApplication::notify(QObject*, QEvent*) (this=0x7fffffffdaa0, receiver=0x555559710c20, e=0x55555ca07d40) at kernel/qapplication.cpp:3156
#31 0x00007ffff5bb56da in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x555559710c20, event=0x55555ca07d40)
    at ../../include/QtCore/5.15.2/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#32 0x00007ffff5bb7fe1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x5555556161b0) at kernel/qcoreapplication.cpp:1817
#33 0x00007ffff5c10987 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x555555736c60) at kernel/qeventdispatcher_glib.cpp:277
#34 0x00007ffff3ead17d in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007ffff3ead400 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00007ffff3ead4a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007ffff5c0ffe2 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x555555742a80, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#38 0x00007ffff5bb41eb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffd950, flags=..., flags@entry=...)
    at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#39 0x00007ffff5bbc394 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#40 0x0000555555579ebe in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ./shell/main.cpp:251
Comment 2 Marco Martin 2021-04-01 13:52:42 UTC
looking at the code seems to be an upstream qt bug. What seems to happen is that in the destructor of that dialog, void QQuickContainerPrivate::cleanup() gets called, and *after* that, QQuickDialogButtonBoxPrivate::getContentWidth() gets called (QQuickDialogButtonBoxPrivate is a QQuickContainerPrivate instance)
trying to call contentModel->count() where contentModel was deleted in QQuickContainerPrivate::cleanup()
Comment 3 Marco Martin 2021-04-01 13:58:00 UTC
*** Bug 435053 has been marked as a duplicate of this bug. ***
Comment 4 Arjen Hiemstra 2021-04-06 10:16:38 UTC
*** Bug 435304 has been marked as a duplicate of this bug. ***
Comment 5 Arjen Hiemstra 2021-04-09 09:19:06 UTC
*** Bug 435515 has been marked as a duplicate of this bug. ***
Comment 6 Arjen Hiemstra 2021-04-16 13:00:10 UTC
*** Bug 435813 has been marked as a duplicate of this bug. ***
Comment 7 Arjen Hiemstra 2021-04-16 16:04:46 UTC
Git commit 79d284374ed9544b5b9f938cc9cd9a5bf4335bde by Arjen Hiemstra.
Committed on 16/04/2021 at 16:04.
Pushed by ahiemstra into branch 'master'.

Remove RowLayout from KillDialog DialogButtonBox

RowLayout does something which will trigger a crash when the
dialogbuttonbox gets destroyed. So instead use the normal layout,
calculate the fill width for the checkbox manually. Also remove the
workaround for QTBUG-81796 since that was fixed in the meantime.

M  +11   -24   src/table/KillDialog.qml

https://invent.kde.org/plasma/plasma-systemmonitor/commit/79d284374ed9544b5b9f938cc9cd9a5bf4335bde
Comment 8 Arjen Hiemstra 2021-04-16 16:06:35 UTC
Git commit 5d0c9551ab7e0a5b2f1e97f1453871e970e3bb3a by Arjen Hiemstra.
Committed on 16/04/2021 at 16:06.
Pushed by ahiemstra into branch 'Plasma/5.21'.

Remove RowLayout from KillDialog DialogButtonBox

RowLayout does something which will trigger a crash when the
dialogbuttonbox gets destroyed. So instead use the normal layout,
calculate the fill width for the checkbox manually. Also remove the
workaround for QTBUG-81796 since that was fixed in the meantime.


(cherry picked from commit 79d284374ed9544b5b9f938cc9cd9a5bf4335bde)

M  +11   -24   src/table/KillDialog.qml

https://invent.kde.org/plasma/plasma-systemmonitor/commit/5d0c9551ab7e0a5b2f1e97f1453871e970e3bb3a
Comment 9 David Redondo 2021-04-22 07:05:58 UTC
*** Bug 436010 has been marked as a duplicate of this bug. ***
Comment 10 David Redondo 2021-04-23 07:43:33 UTC
*** Bug 436055 has been marked as a duplicate of this bug. ***
Comment 11 Arjen Hiemstra 2021-05-05 08:45:57 UTC
*** Bug 436609 has been marked as a duplicate of this bug. ***
Comment 12 Emanuele Spirito 2021-05-26 10:26:27 UTC
Created attachment 138800 [details]
New crash information added by DrKonqi

plasma-systemmonitor (5.21.5) using Qt 5.15.2

- What I was doing when the application crashed:
Editing System-monitor pages
- Unusual behavior I noticed:
No unusual behavior
- Custom settings of the application:
No custom settings

-- Backtrace (Reduced):
#4  0x00007fdd15f5806f in QQuickItem::setVisible(bool) () from /lib64/libQt5Quick.so.5
#5  0x00007fdd0cb9d86a in ToolBarLayoutDelegate::ensureItemVisibility() () from /usr/lib64/qt5/qml/org/kde/kirigami.2/libkirigamiplugin.so
#6  0x00007fdd288884b0 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#7  0x00007fdd15f5a8cb in QQuickItemPrivate::setEffectiveVisibleRecur(bool) () from /lib64/libQt5Quick.so.5
#8  0x00007fdd15f5e119 in QQuickItem::setParentItem(QQuickItem*) () from /lib64/libQt5Quick.so.5
Comment 13 David Redondo 2021-07-01 14:48:48 UTC
*** Bug 439314 has been marked as a duplicate of this bug. ***