Bug 481594 - Crashing when dragging Favorite Plugins to Available Plugins in "Search > Plasma Search"
Summary: Crashing when dragging Favorite Plugins to Available Plugins in "Search > Pla...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: generic-crash (show other bugs)
Version: 5.93.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-20 20:51 UTC by Brandow
Modified: 2024-02-21 14:59 UTC (History)
1 user (show)

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


Attachments
bug reprodution example (1.37 MB, video/webm)
2024-02-20 20:51 UTC, Brandow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brandow 2024-02-20 20:51:26 UTC
Created attachment 165961 [details]
bug reprodution example

SUMMARY
***
Crashing when dragging your Favorite Plugins to Available Plugins in "Search > Plasma Search" (look the video attachment). Here is the terminal output I get:

qml: Page SubCategoryPage_QMLTYPE_114(0x58ad0ffc37d0) is already in the PageRow
qml: Pushed pages do not conform to the rules. Please check the documentation.
push (file:///usr/lib/qt6/qml/org/kde/kirigami/PageRow.qml:223)
onActiveSubCategoryRowChanged (qrc:/qt/qml/org/kde/systemsettings/SubCategoryPage.qml:175)
expression for onClicked (qrc:/qt/qml/org/kde/systemsettings/SubCategoryPage.qml:197)
Segmentation fault (core dumped)
***


STEPS TO REPRODUCE
1. Open systemsettings
2. Go to "Search > Plasma Search"
3. Try to drag your Favorite Plugin down to the Available Plugins category 

OBSERVED RESULT
3 seconds hang and then crash

EXPECTED RESULT
to don't crash

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2024-02-21 12:42:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2062
Comment 2 Nicolas Fella 2024-02-21 13:28:18 UTC
Git commit 79070f0646c47554f126b8c3aee55570d2c61dd0 by Nicolas Fella, on behalf of Harald Sitter.
Committed on 21/02/2024 at 13:21.
Pushed by nicolasfella into branch 'master'.

kcms/plasmasearch: don't crash on dragging favorties to the end

snap it back to the end instead.

this happens because the pluginselector doodad is a singular list view
with sections. when the user drags an item from the favorites section to
the available section, to reorder an item at the bottom, the new drop
index is inside the model but not inside the m_favoriteMetaDataList.
i.e. its index is model-bound not m_favoriteMetaDataList-bound. we
therefore need to clamp the index at the upper bounds of
m_favoriteMetaDataList manually so as to not work with invalid indexes

M  +6    -1    kcms/runners/plasmasearch/kcm.cpp
M  +1    -1    kcms/runners/plasmasearch/kcm.h

https://invent.kde.org/plasma/plasma-desktop/-/commit/79070f0646c47554f126b8c3aee55570d2c61dd0
Comment 3 Nicolas Fella 2024-02-21 13:29:08 UTC
Git commit 1c9e01b22aefc13d97f066ae3e60faa9b2e80b52 by Nicolas Fella, on behalf of Harald Sitter.
Committed on 21/02/2024 at 13:28.
Pushed by nicolasfella into branch 'Plasma/6.0'.

kcms/plasmasearch: don't crash on dragging favorties to the end

snap it back to the end instead.

this happens because the pluginselector doodad is a singular list view
with sections. when the user drags an item from the favorites section to
the available section, to reorder an item at the bottom, the new drop
index is inside the model but not inside the m_favoriteMetaDataList.
i.e. its index is model-bound not m_favoriteMetaDataList-bound. we
therefore need to clamp the index at the upper bounds of
m_favoriteMetaDataList manually so as to not work with invalid indexes
(cherry picked from commit 79070f0646c47554f126b8c3aee55570d2c61dd0)

M  +6    -1    kcms/runners/plasmasearch/kcm.cpp
M  +1    -1    kcms/runners/plasmasearch/kcm.h

https://invent.kde.org/plasma/plasma-desktop/-/commit/1c9e01b22aefc13d97f066ae3e60faa9b2e80b52