Bug 503099 - Plasma can crash in LegendModel::update() when displaying a notification that does *not* include a chart in it
Summary: Plasma can crash in LegendModel::update() when displaying a notification that...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (other bugs)
Version First Reported In: 6.3.90
Platform: Other Linux
: HI crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 504322 505276 505966 505994 506006 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-04-21 11:01 UTC by Nate Graham
Modified: 2025-06-24 18:30 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/201624/?project=9&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D&stream_index=1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2025-04-21 11:01:17 UTC
I managed to get Plasma to crash while displaying a notification from Spectacle today. The backtrace is in KQuickCharts code despite the notification not displaying a file transfer progress chart, leading me to think that that part is being loaded unnecessarily.

Backtrace:

Thread 1 (Thread 0x7f33a4e21dc0 (LWP 59413)):
[KCrash Handler]
#5  QJSEngine::handle (this=0x0) at /usr/src/debug/qt6-qtdeclarative-6.8.2-1.fc41.x86_64/src/qml/jsapi/qjsengine.h:298
#6  QQmlListModel::engine (this=this@entry=0x12eb0660) at /usr/src/debug/qt6-qtdeclarative-6.8.2-1.fc41.x86_64/src/qmlmodels/qqmllistmodel.cpp:2119
#7  0x00007f33ac75f6ca in QQmlListModel::data (this=0x12eb0660, index=<optimized out>, role=0) at /usr/src/debug/qt6-qtdeclarative-6.8.2-1.fc41.x86_64/src/qmlmodels/qqmllistmodel.cpp:2310
#8  0x00007f33ac75fbb4 in QQmlListModel::data (this=<optimized out>, index=<optimized out>, role=<optimized out>) at /usr/include/qt6/QtCore/qabstractitemmodel.h:130
#9  0x00007f33170ca2d3 in ModelSource::item (this=0x16bb51a0, index=0) at /home/nate/kde/src/kquickcharts/src/datasource/ModelSource.cpp:93
#10 0x00007f33170c64ec in ChartDataSource::first (this=<optimized out>) at /home/nate/kde/src/kquickcharts/src/datasource/ChartDataSource.cpp:20
#11 0x00007f3317070282 in LegendModel::getValueForItem (this=this@entry=0x174252b0, item=item@entry=0) at /home/nate/kde/src/kquickcharts/controls/LegendModel.cpp:258
#12 0x00007f3317070ea2 in LegendModel::update (this=<optimized out>) at /home/nate/kde/src/kquickcharts/controls/LegendModel.cpp:163
#13 0x00007f33aa74b9a2 in QObject::event (this=0x174252b0, e=0x1697cd60) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/kernel/qobject.cpp:1418
#14 0x00007f33ad43d9b8 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x174252b0, e=0x1697cd60) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/widgets/kernel/qapplication.cpp:3296
#15 0x00007f33aa6f3590 in QCoreApplication::notifyInternal2 (receiver=0x174252b0, event=0x1697cd60) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1172
#16 0x00007f33aa6f37ed in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1612
#17 0x00007f33aa6f6f51 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x1133e1c0) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1946
#18 0x00007f33aa6f71fd in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1800
#19 0x00007f33aa9efb5f in postEventSourceDispatch (s=0x11396b90) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#20 0x00007f33a9d8d28c in g_main_dispatch (context=0x7f3390000f00) at ../glib/gmain.c:3357
#21 g_main_context_dispatch_unlocked (context=0x7f3390000f00) at ../glib/gmain.c:4208
#22 0x00007f33a9ded8b8 in g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7f3390000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4273
#23 0x00007f33a9d8e783 in g_main_context_iteration (context=0x7f3390000f00, may_block=1) at ../glib/gmain.c:4338
#24 0x00007f33aa9ef2b3 in QEventDispatcherGlib::processEvents (this=0x11344270, flags=...) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#25 0x00007f33aa700993 in QEventLoop::exec (this=this@entry=0x7ffcc44d5a20, flags=..., flags@entry=...) at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/global/qflags.h:34
#26 0x00007f33aa6fbf6e in QCoreApplication::exec () at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/corelib/global/qflags.h:74
#27 0x00007f33ab2d7d3d in QGuiApplication::exec () at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/gui/kernel/qguiapplication.cpp:1975
#28 0x00007f33ad43d929 in QApplication::exec () at /usr/src/debug/qt6-qtbase-6.8.2-3.fc41.x86_64/src/widgets/kernel/qapplication.cpp:2564
#29 0x0000000000407c76 in main (argc=<optimized out>, argv=<optimized out>) at /home/nate/kde/src/plasma-workspace/shell/main.cpp:191
Comment 1 Nate Graham 2025-06-06 15:58:26 UTC
*** Bug 505276 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2025-06-10 14:35:23 UTC
*** Bug 504322 has been marked as a duplicate of this bug. ***
Comment 3 Arjen Hiemstra 2025-06-10 15:02:06 UTC
Git commit fed717c4c52fc4b06b027130b39e9fc9d61a2760 by Arjen Hiemstra.
Committed on 10/06/2025 at 15:02.
Pushed by ahiemstra into branch 'master'.

controls: Handle Chart::destroyed() in LegendModel

* controls: Handle Chart::destroyed() in LegendModel

Otherwise we risk trying to access objects that no longer exist.

M  +15   -2    controls/LegendModel.cpp
M  +1    -0    controls/LegendModel.h

https://invent.kde.org/frameworks/kquickcharts/-/commit/fed717c4c52fc4b06b027130b39e9fc9d61a2760
Comment 4 Nate Graham 2025-06-10 15:04:14 UTC
We think that may fix the issue. Please test/verify with Frameworks 6.15 or later. Thanks folks!
Comment 5 Nate Graham 2025-06-20 20:36:15 UTC
Unfortunately this crash doesn't seem to be fixed by that commit. On today's git master, I just got a crash with the same backtrace when I clicked on the Notifications icon in my system tray.

[KCrash Handler]
#4  0x00007fafa0144985 in QJSEngine::handle (this=0x0) at /usr/src/debug/qt6-qtdeclarative-6.9.1-1.fc42.x86_64/src/qml/jsapi/qjsengine.h:298
#5  QQmlListModel::engine (this=this@entry=0x1f25eaa0) at /usr/src/debug/qt6-qtdeclarative-6.9.1-1.fc42.x86_64/src/qmlmodels/qqmllistmodel.cpp:2128
#6  0x00007fafa0145c46 in QQmlListModel::data (this=0x1f25eaa0, index=<optimized out>, role=0) at /usr/src/debug/qt6-qtdeclarative-6.9.1-1.fc42.x86_64/src/qmlmodels/qqmllistmodel.cpp:2319
#7  0x00007fafa01461f4 in QQmlListModel::data (this=<optimized out>, index=..., role=<optimized out>) at /usr/include/qt6/QtCore/qabstractitemmodel.h:130
#8  0x00007faeed9b6643 in ModelSource::item (this=0x19845790, index=0) at /home/nate/kde/src/kquickcharts/src/datasource/ModelSource.cpp:93
#9  0x00007faeed9b251c in ChartDataSource::first (this=<optimized out>) at /home/nate/kde/src/kquickcharts/src/datasource/ChartDataSource.cpp:20
#10 0x00007faeed9638f7 in LegendModel::getValueForItem (this=this@entry=0x1e543530, item=item@entry=0) at /home/nate/kde/src/kquickcharts/controls/LegendModel.cpp:263
#11 0x00007faeed964620 in LegendModel::update (this=0x1e543530) at /home/nate/kde/src/kquickcharts/controls/LegendModel.cpp:164
Comment 6 Antonio Rojas 2025-06-22 18:42:18 UTC
*** Bug 505994 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2025-06-24 16:55:23 UTC
*** Bug 505966 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2025-06-24 18:30:00 UTC
*** Bug 506006 has been marked as a duplicate of this bug. ***