Bug 502826 - System monitor crashes in QtPrivate::QModelIndexWrapper::QModelIndexWrapper() after doing stuff in KSysGuard::ProcessDataModel::setEnabledAttributes()
Summary: System monitor crashes in QtPrivate::QModelIndexWrapper::QModelIndexWrapper()...
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (other bugs)
Version First Reported In: 6.3.4
Platform: Arch Linux Linux
: HI crash
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords: drkonqi
: 490012 500534 502081 502861 503899 503980 504756 504818 505035 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-04-15 10:19 UTC by sergi
Modified: 2025-06-04 21:53 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.4.0
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/163373/events/0fc55154cdc74c2284bde7e2bb023388/


Attachments
New crash information added by DrKonqi (120.03 KB, text/plain)
2025-04-15 10:19 UTC, sergi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sergi 2025-04-15 10:19:07 UTC
Application: plasma-systemmonitor (6.3.4)

ApplicationNotResponding [ANR]: false
Qt Version: 6.9.0
Frameworks Version: 6.12.0
Operating System: Linux 6.14.2-arch1-1 x86_64
Windowing System: Wayland
Distribution: Arch Linux
DrKonqi: 6.3.4 [CoredumpBackend]

-- Information about the crash:
System monitor randomly crashed two times after a time in the processes tab. Can't find a specifc patter to reproduce.

The crash can be reproduced sometimes.

-- Backtrace (Reduced):
#5  0x000072c6291ad312 in QtPrivate::QModelIndexWrapper::QModelIndexWrapper (this=<optimized out>, i=..., this=<optimized out>, i=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qabstractitemmodel_p.h:45
#6  QSortFilterProxyModelPrivate::index_to_iterator (this=<optimized out>, proxy_index=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qsortfilterproxymodel.cpp:276
#7  QSortFilterProxyModel::parent (this=0x648940356b00, child=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qsortfilterproxymodel.cpp:2139
#8  0x000072c6228c947d in QModelIndex::parent (this=<optimized out>) at /usr/include/qt6/QtCore/qabstractitemmodel.h:506
#9  QQmlTreeModelToTableModel::modelDataChanged (this=0x64894034da30, topLeft=..., bottomRight=..., roles=...) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qmlmodels/qqmltreemodeltotablemodel.cpp:652


Reported using DrKonqi
Comment 1 sergi 2025-04-15 10:19:08 UTC
Created attachment 180281 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 TraceyC 2025-04-15 18:30:12 UTC
Searchable backtrace


Thread 1 (Thread 0x72c62482fa00 (LWP 11904)):
[KCrash Handler]
#5  0x000072c6291ad312 in QtPrivate::QModelIndexWrapper::QModelIndexWrapper (this=<optimized out>, i=..., this=<optimized out>, i=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qabstractitemmodel_p.h:45
#6  QSortFilterProxyModelPrivate::index_to_iterator (this=<optimized out>, proxy_index=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qsortfilterproxymodel.cpp:276
#7  QSortFilterProxyModel::parent (this=0x648940356b00, child=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qsortfilterproxymodel.cpp:2139
#8  0x000072c6228c947d in QModelIndex::parent (this=<optimized out>) at /usr/include/qt6/QtCore/qabstractitemmodel.h:506
#9  QQmlTreeModelToTableModel::modelDataChanged (this=0x64894034da30, topLeft=..., bottomRight=..., roles=...) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qmlmodels/qqmltreemodeltotablemodel.cpp:652
#10 0x000072c628fb6cc9 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
#11 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4138
#12 0x000072c62916e5d1 in QMetaObject::activate<void, QModelIndex, QModelIndex, QList<int> > (sender=<optimized out>, mo=<optimized out>, local_signal_index=0, ret=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:306
#13 QAbstractItemModel::dataChanged (this=<optimized out>, _t1=..., _t2=..., _t3=...) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qabstractitemmodel.cpp:658
#14 0x000072c6291ac503 in QSortFilterProxyModelPrivate::_q_sourceDataChanged (this=0x72c590009530, source_top_left=..., source_bottom_right=..., roles=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qsortfilterproxymodel.cpp:1523
#15 0x000072c628fb6cc9 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
#16 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4138
#17 0x000072c62919e641 in QMetaObject::activate<void, QModelIndex, QModelIndex, QList<int> > (sender=0x648940358a20, mo=<optimized out>, local_signal_index=0, ret=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:306
#18 QAbstractItemModel::dataChanged (this=0x648940358a20, _t1=..., _t2=..., _t3=...) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qabstractitemmodel.cpp:658
#19 QIdentityProxyModelPrivate::sourceDataChanged (this=<optimized out>, topLeft=..., bottomRight=..., roles=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qidentityproxymodel.cpp:487
#20 0x000072c628fb6cc9 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
#21 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4138
#22 0x000072c62919e641 in QMetaObject::activate<void, QModelIndex, QModelIndex, QList<int> > (sender=0x648940359380, mo=<optimized out>, local_signal_index=0, ret=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:306
#23 QAbstractItemModel::dataChanged (this=0x648940359380, _t1=..., _t2=..., _t3=...) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qabstractitemmodel.cpp:658
#24 QIdentityProxyModelPrivate::sourceDataChanged (this=<optimized out>, topLeft=..., bottomRight=..., roles=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/itemmodels/qidentityproxymodel.cpp:487
#25 0x000072c628fb6cc9 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
#26 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4138
#27 0x000072c62916e5d1 in QMetaObject::activate<void, QModelIndex, QModelIndex, QList<int> > (sender=0x6489403573b0, mo=<optimized out>, local_signal_index=0, ret=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:306
#28 QAbstractItemModel::dataChanged (this=this@entry=0x6489403573b0, _t1=..., _t2=..., _t3=...) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qabstractitemmodel.cpp:658
#29 0x000072c5d41d82d6 in operator() (__closure=<optimized out>, process=0x64893f4c8000) at /usr/src/debug/libksysguard/libksysguard-6.3.4/processcore/process_data_model.cpp:214
#30 operator() (__closure=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:141
#31 QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KSysGuard::Process*>, void, KSysGuard::ProcessDataModel::setEnabledAttributes(const QStringList&)::<lambda(KSysGuard::Process*)> >::call(KSysGuard::ProcessDataModel::setEnabledAttributes(const QStringList&)::<lambda(KSysGuard::Process*)>&, void**)::<lambda()> > (args=<optimized out>, fn=...) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:65
#32 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KSysGuard::Process*>, void, KSysGuard::ProcessDataModel::setEnabledAttributes(const QStringList&)::<lambda(KSysGuard::Process*)> >::call (f=..., arg=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:140
#33 QtPrivate::FunctorCallable<KSysGuard::ProcessDataModel::setEnabledAttributes(const QStringList&)::<lambda(KSysGuard::Process*)>, KSysGuard::Process*>::call<QtPrivate::List<KSysGuard::Process*>, void> (f=..., arg=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:362
#34 QtPrivate::QCallableObject<KSysGuard::ProcessDataModel::setEnabledAttributes(const QStringList&)::<lambda(KSysGuard::Process*)>, QtPrivate::List<KSysGuard::Process*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:572
#35 0x000072c628fb6cc9 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
#36 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4138
#37 0x000072c5d419e2b2 in KSysGuard::ProcessAttribute::dataChanged (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/libksysguard/build/processcore/processcore_autogen/EWIEGA46WW/moc_process_attribute.cpp:159
#38 0x000072c628fb6cc9 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
#39 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4138
#40 0x000072c5d419e467 in KSysGuard::Processes::processChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at /usr/src/debug/libksysguard/build/processcore/processcore_autogen/EWIEGA46WW/moc_processes.cpp:280
#41 0x000072c628fa54aa in QObject::event (this=0x64893efedca0, e=0x72c590005130) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1431
#42 0x000072c62a8fed9e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x64893efedca0, e=0x72c590005130) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3301
#43 0x000072c628f5a018 in QCoreApplication::notifyInternal2 (receiver=0x64893efedca0, event=event@entry=0x72c590005130) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1106
#44 0x000072c628f5a3f2 in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x72c590005130) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1546
#45 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x64893d8b6e10) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1879
#46 0x000072c6291cfea8 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1733
#47 postEventSourceDispatch (s=s@entry=0x64893d8b9f00) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#48 0x000072c6285cc1e4 in g_main_dispatch (context=0x72c61c000f00) at ../glib/glib/gmain.c:3398
#49 0x000072c62862fe97 in g_main_context_dispatch_unlocked (context=0x72c61c000f00) at ../glib/glib/gmain.c:4249
#50 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x72c61c000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#51 0x000072c6285cb615 in g_main_context_iteration (context=0x72c61c000f00, may_block=1) at ../glib/glib/gmain.c:4379
#52 0x000072c6291cd59d in QEventDispatcherGlib::processEvents (this=0x64893d8babb0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#53 0x000072c628f65376 in QEventLoop::processEvents (this=0x7ffceb86d420, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:104
#54 QEventLoop::exec (this=0x7ffceb86d420, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:186
#55 0x000072c628f5d159 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:77
#56 0x000072c62a8fb14a in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2568
#57 0x00006489343602d2 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/plasma-systemmonitor/plasma-systemmonitor-6.3.4/src/main.cpp:124
Comment 3 TraceyC 2025-04-15 18:36:26 UTC
This is the only event in Sentry so far, no other bugs with this backtrace. It looks to be mostly in Qt
Comment 4 Arjen Hiemstra 2025-04-16 08:53:54 UTC
*** Bug 502861 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2025-05-08 14:53:11 UTC
*** Bug 503899 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2025-05-08 14:56:20 UTC
*** Bug 502081 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2025-05-08 14:58:23 UTC
*** Bug 500534 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2025-05-08 15:06:25 UTC
*** Bug 490012 has been marked as a duplicate of this bug. ***
Comment 9 TraceyC 2025-05-09 23:08:26 UTC
*** Bug 503980 has been marked as a duplicate of this bug. ***
Comment 10 TraceyC 2025-05-09 23:10:14 UTC
I accidentally reproduced this today, my report had this attached
https://crash-reports.kde.org/organizations/kde/issues/177346/events/cf3233e3d35543849df51e4e78f043b9/

I had started System Monitor from kickoff. After the window appeared, it had ghost fat borders.
I tried to resize the window with Meta+right mouse button and it crashed
After launching it again, the borders were normal and I was able to resize the window as usual.
Comment 11 Arjen Hiemstra 2025-05-27 13:34:15 UTC
*** Bug 504756 has been marked as a duplicate of this bug. ***
Comment 12 Arjen Hiemstra 2025-05-27 13:34:45 UTC
*** Bug 504818 has been marked as a duplicate of this bug. ***
Comment 13 Bug Janitor Service 2025-05-27 13:37:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/419
Comment 14 Arjen Hiemstra 2025-06-02 17:49:42 UTC
Git commit eff50b6e1fe89dd72bacd47a8907a2225525cae0 by Arjen Hiemstra.
Committed on 02/06/2025 at 16:29.
Pushed by ahiemstra into branch 'master'.

processcore: Batch changes to processes in ProcessDataModel

We are currently emitting a single data change signal for every change
in a process, even if it is a change to different columns of the same
row. This is rather inefficient and can cause multiple updates of a view
without that being necessary.

Instead, rather than directly emitting dataChanged when a process
changes, record that the process changed and process all changes after
processes have been updated. This allows us to go through all the
changes and figure out what the range is of changed rows and columns and
emit a single dataChanged for that entire range.

This hopefully also fixes a crash in TreeView that can rarely happen
when ProcessDataModel emits dataChanged

M  +74   -15   processcore/process_data_model.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/eff50b6e1fe89dd72bacd47a8907a2225525cae0
Comment 15 Bug Janitor Service 2025-06-03 08:21:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/426
Comment 16 Arjen Hiemstra 2025-06-03 08:23:52 UTC
Git commit b18c42b57a51a0d02284989535e28a69c323063c by Arjen Hiemstra.
Committed on 03/06/2025 at 08:21.
Pushed by ahiemstra into branch 'Plasma/6.4'.

processcore: Batch changes to processes in ProcessDataModel

We are currently emitting a single data change signal for every change
in a process, even if it is a change to different columns of the same
row. This is rather inefficient and can cause multiple updates of a view
without that being necessary.

Instead, rather than directly emitting dataChanged when a process
changes, record that the process changed and process all changes after
processes have been updated. This allows us to go through all the
changes and figure out what the range is of changed rows and columns and
emit a single dataChanged for that entire range.

This hopefully also fixes a crash in TreeView that can rarely happen
when ProcessDataModel emits dataChanged


(cherry picked from commit eff50b6e1fe89dd72bacd47a8907a2225525cae0)

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

M  +74   -15   processcore/process_data_model.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/b18c42b57a51a0d02284989535e28a69c323063c
Comment 17 Nate Graham 2025-06-03 22:09:15 UTC
*** Bug 505035 has been marked as a duplicate of this bug. ***
Comment 18 Nate Graham 2025-06-04 21:53:58 UTC
We think that's fixed the issue. Marking as RESOLVED for now, but will re-open if we get any new reports of the same backtrace from people using Plasma 6.4.0 or later.