Bug 445700 - Model crash in KSysGuard::ProcessDataModel::Private::getQModelIndex() when process is deleted
Summary: Model crash in KSysGuard::ProcessDataModel::Private::getQModelIndex() when pr...
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 447443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-11-18 14:50 UTC by David Redondo
Modified: 2024-06-15 04:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Redondo 2021-11-18 14:50:56 UTC
#3  KSysGuard::Process::pid (this=0x7000700060007) at ./processcore/process.cpp:238
#4  0x00007fc624286da1 in KSysGuard::ProcessDataModel::Private::getQModelIndex (this=0x56253196ca90, process=<optimized out>, column=0) at ./processcore/process_data_model.cpp:351
#5  0x00007fc624286e85 in KSysGuard::ProcessDataModel::parent (this=<optimized out>, index=...) at ./processcore/process_data_model.cpp:166
#6  0x00007fc63ac376f4 in QModelIndex::parent (this=0x7ffc0d9bece0) at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:443
#7  QIdentityProxyModel::parent (this=0x562531961570, child=...) at itemmodels/qidentityproxymodel.cpp:290
#8  0x00007fc63ac376f4 in QModelIndex::parent (this=0x7ffc0d9bed40) at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:443
#9  QIdentityProxyModel::parent (this=0x562531960f40, child=...) at itemmodels/qidentityproxymodel.cpp:290
#10 0x00007fc63ac15372 in QModelIndex::parent (this=0x7ffc0d9bede0) at itemmodels/qabstractitemmodel.h:443
#11 QAbstractItemModelPrivate::rowsAboutToBeRemoved (this=0x562531961000, parent=..., first=40, last=40) at itemmodels/qabstractitemmodel.cpp:823
#12 0x00007fc63ac18fbd in QAbstractItemModel::beginRemoveRows (this=this@entry=0x562531960f40, parent=..., first=first@entry=40, last=last@entry=40) at itemmodels/qabstractitemmodel.cpp:2819
#13 0x00007fc63ac39719 in QIdentityProxyModelPrivate::_q_sourceRowsAboutToBeRemoved (end=40, start=40, parent=..., this=<optimized out>) at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:383
#14 QIdentityProxyModel::qt_static_metacall (_c=QMetaObject::InvokeMetaMethod, _a=<optimized out>, _id=<optimized out>, _o=<optimized out>) at .moc/moc_qidentityproxymodel.cpp:154
#15 QIdentityProxyModel::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at .moc/moc_qidentityproxymodel.cpp:146
#16 0x00007fc63aca570f in doActivate<true> (sender=0x562531961570, signal_index=14, argv=0x7ffc0d9bf000) at kernel/qobject_p.h:176
#17 0x00007fc63ac9f1a5 in QMetaObject::activate (sender=sender@entry=0x562531961570, m=m@entry=0x7fc63af09020 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=11, argv=argv@entry=0x7ffc0d9bf000) at kernel/qobject.cpp:3944
#18 0x00007fc63ac10d62 in QAbstractItemModel::rowsAboutToBeRemoved (this=this@entry=0x562531961570, _t1=..., _t2=<optimized out>, _t2@entry=40, _t3=<optimized out>, _t3@entry=40, _t4=...) at .moc/moc_qabstractitemmodel.cpp:599
#19 0x00007fc63ac18fac in QAbstractItemModel::beginRemoveRows (this=this@entry=0x562531961570, parent=..., first=first@entry=40, last=last@entry=40) at itemmodels/qabstractitemmodel.cpp:2818
#20 0x00007fc63ac39719 in QIdentityProxyModelPrivate::_q_sourceRowsAboutToBeRemoved (end=40, start=40, parent=..., this=<optimized out>) at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:383
#21 QIdentityProxyModel::qt_static_metacall (_c=QMetaObject::InvokeMetaMethod, _a=<optimized out>, _id=<optimized out>, _o=<optimized out>) at .moc/moc_qidentityproxymodel.cpp:154
#22 QIdentityProxyModel::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at .moc/moc_qidentityproxymodel.cpp:146
#23 0x00007fc63aca570f in doActivate<true> (sender=0x56253196c950, signal_index=14, argv=0x7ffc0d9bf1e0) at kernel/qobject_p.h:176
#24 0x00007fc63ac9f1a5 in QMetaObject::activate (sender=sender@entry=0x56253196c950, m=m@entry=0x7fc63af09020 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=11, argv=argv@entry=0x7ffc0d9bf1e0) at kernel/qobject.cpp:3944
#25 0x00007fc63ac10d62 in QAbstractItemModel::rowsAboutToBeRemoved (this=this@entry=0x56253196c950, _t1=..., _t2=<optimized out>, _t2@entry=40, _t3=<optimized out>, _t3@entry=40, _t4=...) at .moc/moc_qabstractitemmodel.cpp:599
#26 0x00007fc63ac18fac in QAbstractItemModel::beginRemoveRows (this=this@entry=0x56253196c950, parent=..., first=first@entry=40, last=last@entry=40) at itemmodels/qabstractitemmodel.cpp:2818
#27 0x00007fc62428720f in KSysGuard::ProcessDataModel::Private::beginRemoveRow (this=0x56253196ca90, process=<optimized out>) at ./processcore/process_data_model.cpp:328
#28 0x00007fc63aca56a6 in QtPrivate::QSlotObjectBase::call (a=0x7ffc0d9bf3d0, r=0x56253196c950, this=0x562531409530) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#29 doActivate<true> (sender=0x562530333a70, signal_index=6, argv=0x7ffc0d9bf3d0) at kernel/qobject.cpp:3886
#30 0x00007fc63ac9f1a5 in QMetaObject::activate (sender=sender@entry=0x562530333a70, m=m@entry=0x7fc624298f20 <KSysGuard::Processes::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffc0d9bf3d0) at kernel/qobject.cpp:3944
#31 0x00007fc624261696 in KSysGuard::Processes::beginRemoveProcess (this=this@entry=0x562530333a70, _t1=<optimized out>) at ./obj-x86_64-linux-gnu/processcore/processcore_autogen/EWIEGA46WW/moc_processes.cpp:267
#32 0x00007fc624274701 in KSysGuard::Processes::deleteProcess (pid=<optimized out>, this=0x562530333a70) at ./processcore/processes.cpp:398
#33 KSysGuard::Processes::processesUpdated (this=0x562530333a70) at ./processcore/processes.cpp:319

KDE Plasma Version: master 
KDE Frameworks Version: master
Qt Version: kde patch collection
Comment 1 Nate Graham 2022-01-11 23:53:54 UTC
*** Bug 447443 has been marked as a duplicate of this bug. ***
Comment 2 Bug Janitor Service 2024-06-07 12:36:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/354
Comment 3 Arjen Hiemstra 2024-06-11 14:16:57 UTC
Git commit 560d8dad2671c9d8bbd877cd6d796516c9e5ae96 by Arjen Hiemstra.
Committed on 11/06/2024 at 12:01.
Pushed by ahiemstra into branch 'master'.

processcore: Properly check if process exists before dereferencing

Q_ASSERT will only trigger in debug builds. In release builds we can
therefore still dereference a potential null pointer, so do a proper
check instead since there are places where we pass a process' parent
without checking if that parent exists.

M  +1    -2    processcore/process_data_model.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/560d8dad2671c9d8bbd877cd6d796516c9e5ae96
Comment 4 Arjen Hiemstra 2024-06-11 14:19:02 UTC
Git commit 32bb10e38eeafed1c11288e3c416fb586300a7a2 by Arjen Hiemstra.
Committed on 11/06/2024 at 14:17.
Pushed by ahiemstra into branch 'Plasma/6.1'.

processcore: Properly check if process exists before dereferencing

Q_ASSERT will only trigger in debug builds. In release builds we can
therefore still dereference a potential null pointer, so do a proper
check instead since there are places where we pass a process' parent
without checking if that parent exists.


(cherry picked from commit 560d8dad2671c9d8bbd877cd6d796516c9e5ae96)

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

M  +1    -2    processcore/process_data_model.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/32bb10e38eeafed1c11288e3c416fb586300a7a2