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: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (other bugs)
Version First Reported In: 6.3.90
Platform: Other Linux
: VHI crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 504322 505276 505966 505994 506006 506843 506922 507204 507536 507783 507805 507861 507973 508051 508100 508649 508783 508931 509246 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-04-21 11:01 UTC by Nate Graham
Modified: 2025-09-16 20:30 UTC (History)
25 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.4.5
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. ***
Comment 9 Nicolas Fella 2025-07-13 14:26:18 UTC
*** Bug 506922 has been marked as a duplicate of this bug. ***
Comment 10 cwo 2025-07-26 14:07:32 UTC
*** Bug 507204 has been marked as a duplicate of this bug. ***
Comment 11 TraceyC 2025-07-31 00:51:13 UTC
*** Bug 507536 has been marked as a duplicate of this bug. ***
Comment 12 Nicolas Fella 2025-08-04 17:02:32 UTC
*** Bug 507783 has been marked as a duplicate of this bug. ***
Comment 13 Nicolas Fella 2025-08-04 17:02:54 UTC
*** Bug 506843 has been marked as a duplicate of this bug. ***
Comment 14 Nicolas Fella 2025-08-04 17:03:13 UTC
*** Bug 507861 has been marked as a duplicate of this bug. ***
Comment 15 Bug Janitor Service 2025-08-06 16:05:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5737
Comment 16 Arjen Hiemstra 2025-08-07 09:03:39 UTC
Git commit 8f81580780253f98210731c8962f33c67de08e98 by Arjen Hiemstra.
Committed on 07/08/2025 at 07:55.
Pushed by ahiemstra into branch 'master'.

applets/notifications: Use a proper component for the speed chart

Children of a Loader are not part of the loader's contents, they're just
children of the loader. To make sure we actually have the chart as
Loader contents, wrap it in an item and set it as sourceComponent. This
ensures we don't try to load the chart when it's not actually visible or
needed.

M  +99   -95   applets/notifications/components/SpeedChart.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/8f81580780253f98210731c8962f33c67de08e98
Comment 17 Bug Janitor Service 2025-08-07 09:05:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5740
Comment 18 Arjen Hiemstra 2025-08-07 09:19:36 UTC
Git commit 810b39163c8c835450d0a8a39d3bc768d3344c39 by Arjen Hiemstra.
Committed on 07/08/2025 at 09:03.
Pushed by ahiemstra into branch 'Plasma/6.4'.

applets/notifications: Use a proper component for the speed chart

Children of a Loader are not part of the loader's contents, they're just
children of the loader. To make sure we actually have the chart as
Loader contents, wrap it in an item and set it as sourceComponent. This
ensures we don't try to load the chart when it's not actually visible or
needed.


(cherry picked from commit 8f81580780253f98210731c8962f33c67de08e98)

Co-authored-by: Arjen Hiemstra <ahiemstra@heimr.nl>

M  +99   -95   applets/notifications/package/contents/ui/components/SpeedChart.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/810b39163c8c835450d0a8a39d3bc768d3344c39
Comment 19 Nicolas Fella 2025-08-07 12:10:39 UTC
*** Bug 507973 has been marked as a duplicate of this bug. ***
Comment 20 Nate Graham 2025-08-07 14:58:30 UTC
That should fix it. We'll re-open if we get any new reports from people using Plasma 6.4.5 or later.
Comment 21 Harald Sitter 2025-08-11 09:55:44 UTC
*** Bug 508100 has been marked as a duplicate of this bug. ***
Comment 22 Nate Graham 2025-08-11 20:08:56 UTC
*** Bug 508051 has been marked as a duplicate of this bug. ***
Comment 23 TraceyC 2025-08-25 19:34:26 UTC
*** Bug 508649 has been marked as a duplicate of this bug. ***
Comment 24 Germano Massullo 2025-09-03 12:31:50 UTC
*** Bug 507805 has been marked as a duplicate of this bug. ***
Comment 25 Nate Graham 2025-09-05 17:02:56 UTC
*** Bug 508931 has been marked as a duplicate of this bug. ***
Comment 26 TraceyC 2025-09-09 15:45:53 UTC
*** Bug 509246 has been marked as a duplicate of this bug. ***
Comment 27 Nate Graham 2025-09-16 20:30:49 UTC
*** Bug 508783 has been marked as a duplicate of this bug. ***