Created attachment 143517 [details] Backtrace of this crash, missing many symbols. SUMMARY *** NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** When I run System Monitor, type a process name filter, and close a large number of processes matching the filter, switching to tree view produces QML errors and sometimes segfaults. STEPS TO REPRODUCE 1. Open plasma-systemmonitor to the Processes tab. 2. Optionally switch to tree view. 3. Type bash into the search bar. 4. Open a Konsole tab, open Bash if you're using a different shell, and run `for i in {1..200}; do bash & done`. 5. Once the 200 bash processes show up in plasma-systemmonitor, close the Konsole tab, and wait for the processes to disappear. 6. Switch to tree view if you're not already in it. Warnings will not appear unless/until you're in tree view. Without a search query open, I don't get instability (fixed in Bug 437862). If you run a different child process (like perl), you can encounter this bug by searching for perl instead of bash. And if you start out in list view and later switch to tree view, you can *only* reproduce the bug by searching for perl (not the parent process bash). OBSERVED RESULT ``` TableView::forceLayout(): Cannot do an immediate re-layout during an ongoing layout! Model size of -1 is less than 0 Model size of -1 is less than 0 Model size of -1 is less than 0 ... file:///usr/lib/qt/qml/org/kde/ksysguard/table/TreeDecoration.qml:49: TypeError: Value is undefined and could not be converted to an object file:///usr/lib/qt/qml/org/kde/ksysguard/table/FirstCellDelegate.qml:57:42: Unable to assign [undefined] to bool file:///usr/lib/qt/qml/org/kde/ksysguard/table/FirstCellDelegate.qml:56:44: Unable to assign [undefined] to bool file:///usr/lib/qt/qml/org/kde/ksysguard/table/FirstCellDelegate.qml:55:39: Unable to assign [undefined] to int file:///usr/lib/qt/qml/org/kde/ksysguard/table/TreeDecoration.qml:49: TypeError: Value is undefined and could not be converted to an object file:///usr/lib/qt/qml/org/kde/ksysguard/table/FirstCellDelegate.qml:57:42: Unable to assign [undefined] to bool file:///usr/lib/qt/qml/org/kde/ksysguard/table/FirstCellDelegate.qml:56:44: Unable to assign [undefined] to bool file:///usr/lib/qt/qml/org/kde/ksysguard/table/FirstCellDelegate.qml:55:39: Unable to assign [undefined] to int ,,, ``` In some rare cases I get a crash as well. For example, when filtering in plasma-systemmonitor, I got a crash "in the wild" a few days ago with a non-symboled backtrace (attached), but it's missing the actual coredump. Since then, I've only been able to replicate this crash in synthetic conditions using non-symboled Arch Linux plasma-systemmonitor in painfully-slow Valgrind (my (!strip debug) builds don't crash). EXPECTED RESULT plasma-systemmonitor doesn't crash and doesn't use invalid object indexes. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.23.3 KDE Frameworks Version: 5.87.0 Qt Version: 5.15.2 Kernel Version: 5.14.16-zen1-1-zen (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor Memory: 15.5 GiB of RAM Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2 ADDITIONAL INFORMATION
Created attachment 143600 [details] Screenshot of plasma-systemmonitor in a bugged state, with many processes missing names. Apparently entering a filter is not necessary for plasma-systemmonitor to bug out. - Open plasma-systemmonitor in a console. - Switch to tree view but don't enter a filter. - Run 200 perl processes. - Scroll down until you see bash and the first 10-20 perl children. - Close the bash tab. nyanpasu64@ryzen ~> plasma-systemmonitor kf.kirigami: Units.devicePixelRatio is deprecated (since 5.86): This returns 1 when using Qt HiDPI scaling. file:///usr/lib/qt/qml/org/kde/ksysguard/table/TableViewHeader.qml:211: ReferenceError: heading is not defined (exception occurred during delayed function evaluation) file:///usr/lib/qt/qml/org/kde/kirigami.2/private/globaltoolbar/ToolBarPageHeader.qml:83:13: QML Binding: Binding loop detected for property "value" file:///usr/lib/qt/qml/org/kde/kirigami.2/private/globaltoolbar/ToolBarPageHeader.qml:88:13: QML Binding: Binding loop detected for property "value" QAbstractItemModel::endRemoveRows: Invalid index ( 198 , 3 ) in model ComponentCacheProxyModel(0x55ef5393eea0) qt.core.qabstractitemmodel.checkindex: Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid) file:///usr/share/ksysguard/sensorfaces/org.kde.ksysguard.processtable/contents/ui/ProcessTableView.qml:163:17: Unable to assign [undefined] to QString Model size of -1 is less than 0 qt.core.qabstractitemmodel.checkindex: Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid) file:///usr/share/ksysguard/sensorfaces/org.kde.ksysguard.processtable/contents/ui/ProcessTableView.qml:163:17: Unable to assign [undefined] to QString Model size of -1 is less than 0 ...
Created attachment 143602 [details] endRemoveRows warnings printed by plasma-systemmonitor Note that this crash occurs inconsistently. I retested where I slowly scrolled through the list of processes, making sure to load all 200 perl processes. Then when I closed the Konsole tab, the entire process list went empty, a few seconds later the terminal filled with "QAbstractItemModel::endRemoveRows: Invalid index ( ### , 3 ) in model ComponentCacheProxyModel(0x5636510d77e0)" warnings (full log attached), then a few seconds later plasma-systemmonitor segfaulted. However I tried a few more times. Sometimes the program seemed to work fine and unload the processes without any visible symptoms. One time it segfaulted anyway, without having printed errors beforehand.
For Plasma 6, we ported away from using KDescendantsProxyModel and use upstream TreeView now. This means the source of this crash is no longer used in System Monitor, so I am going to close this as fixed.