Created attachment 162916 [details]
crash report from drkonqui
Crash when sorting items by date/time in thumbnail view. Reproducible with the same dataset and with another database and different data. Does not crash when the items are already sorted.
STEPS TO REPRODUCE
1. Have some out of order images/videos in the thumbnail view
2. Select these items
3. Select from the menu: "View" ... "Sort Selected by Date & Time"
Display items in sorted order. No crash.
openSuse Leap 15.5
KPA git master v5.11.0-171-g314e3ca7
KDE Frameworks 5.103.0
A) The bug must be introduced quite recently as I did a lot of sorting in the last few days and had quite a few recent versions installed
B) The terminal says:
ASSERT failure in QList::insert: "The specified iterator argument 'before' is invalid", file /usr/include/qt5/QtCore/qlist.h, line 541
KCrash: Application 'kphotoalbum' crashing...
C) see attachment
see also: https://bugs.kde.org/show_bug.cgi?id=476561
Easier way to reproduce:
1. kphotoalbum --demo
2. thumbnail view
This is strange:
I tried a git bisect going back until 5.9.something from January 2023 and it still crashes while sorting the demo database.
I cannot reproduce the crash on a different machine ... m-(
On a second PC with slightly older/smaller hardware but the same OS/patchlevel the crash never happens.
I am building with the exact same build script from the very same folder (on NFS) on both systems. On the other PC the crash does not happen. On this one it is reproducible.
I checked/compared all the files mentioned in the kcrash file - they differ only in access time but otherwise they are the same bit for bit.
The .gitconfig files are the same on both machines and before each build I clean out the build folder.
But ... but: the .config/kphotoalbumrc files differ !!!
With the file on my machine KPA crashes, with the file from the other it does not crash.
I can exchange the two *rc files and the crash follows the defective one.
Now, what on earth could cause the config file to crash the application?
Created attachment 162933 [details]
tar file with two kphotoalbumrc files
The file kphotoalbumrc5 causes the crash when sorting, the other one is OK
OK ... (sigh!) ... I edited the offending rc-file line by line and this is the offending line in the section [Thumbnails]:
When I remove only this line, sorting does not crash anymore.
Adding this line should trigger the crash.
Completely removing the rc-file and starting from scratch solves this problem as well but then you have to re-do all your settings.
My verdict: settings in the rc-file should not crash the application.
Git commit eb3e2fe95ab48f984d79125e36562c5955ceae7c by Johannes Zarl-Zierl.
Committed on 07/11/2023 at 23:29.
Pushed by johanneszarl into branch 'master'.
Fix crash when sorting selected images newest first
If the display order is newest first, selecting all images and sorting
the selected images resulted in a out of bounds iterator.
M +2 -1 DB/ImageInfoList.cpp
Thanks for the detailed report.
For the record: The steps to reproduce this bug using the GUI only:
1. Open KPhotoAlbum
2. Select View | Show Newest First
3. Go To Thumbnail View
4. Select all images
5. Select View | Sort selected by Date & Time
Apparently nobody ever tried sorting the images while the display order was newest first...
with the latest update things work for me independent of sort order. So, check, problem solved!
I must have switched the sort order inadvertently.