Bug 443863 - DK crash on rating image
Summary: DK crash on rating image
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Rating (show other bugs)
Version: 7.3.0
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-17 00:39 UTC by K D Murray
Modified: 2022-01-21 16:06 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description K D Murray 2021-10-17 00:39:30 UTC
SUMMARY

Digikam 7.3.0 appimage crashes when rating an image (Ctrl-1 etc) with the following on the terminal

unknown: ASSERT failure in QList<T>::at: "index out of range", file ././/include/QtCore/qlist.h, line 571

I'm running debian sid, with SwayWM (wayland), and running the digikam appimage with the following wrapper script:

export QT_QPA_PLATFORM=xcb
/path/to/digikam/digiKam-7.3.0-x86-64.appimage


STEPS TO REPRODUCE
1. Open digikam, browse to image in thumbnail/preview mode.
2. Rate image with keyboard shortcut or captions side bar + apply button


OBSERVED RESULT

Digikam crashes. It appears the rating in the digikam DB is updated, but the XMP sidecar is not (I have write to XMP sidecars enabled). It also seems that this only happens when changing the rating to non-zero (ctrl-0 or setting rating to zero stars is unaffected). It seems to happen on both CR3 raws and JPEGs.

Updating pick labels and tag metadata works as per normal.

EXPECTED RESULT

No crash, metadata happily written to image file or sidecar as appropriate.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

Using debian sid with appimage bundle and Sway WM on wayland (But digikam via Xwayland and XCB-based QT rendering, see above).

ADDITIONAL INFORMATION
Comment 1 K D Murray 2021-10-17 00:44:06 UTC
I just came across the development snapshot appimages, and I can confirm that the same bug/behaviour appears in 

digiKam-7.4.0-20210905T231405-x86-64-debug.appimage

I'd be happy to test an appimage of current main branch too if one is available.
Comment 2 caulier.gilles 2021-10-17 02:50:09 UTC
It's a crash due to a Qt exception generated by a uses of an empty Qt list. It miss a check before to use this empty container. It's easy to fix if we can see where the test is missing in code.

Run the appimage from a console under GDB with the "debug" argument. When crash appear, enter "bt" to get the bactrace. Note : you need to use the debug version of 7.4.0 devel appimage bundle (file is more heavy and available at the same place than the non debug version)
Comment 3 Maik Qualmann 2021-10-17 09:15:30 UTC
You will have an incorrect entry in the digiKam configuration file for the advanced metadata. In the advanced metadata for the rating settings, do a "Reset to defaults".

Maik
Comment 4 Maik Qualmann 2021-10-17 10:30:35 UTC
Git commit f1296ba9e20ed513663cd20883216dd83eff3c6b by Maik Qualmann.
Committed on 17/10/2021 at 10:29.
Pushed by mqualmann into branch 'master'.

check rating conversion values count

M  +7    -0    core/libs/metadataengine/dmetadata/dmetadata_labels.cpp

https://invent.kde.org/graphics/digikam/commit/f1296ba9e20ed513663cd20883216dd83eff3c6b
Comment 5 Maik Qualmann 2021-10-17 11:44:46 UTC
Git commit 1b5fc98b44930617f3a98ca098b5eb469de10ec1 by Maik Qualmann.
Committed on 17/10/2021 at 11:42.
Pushed by mqualmann into branch 'master'.

check the rating conversion values in the reading function

M  +0    -7    core/libs/metadataengine/dmetadata/dmetadata_labels.cpp
M  +17   -3    core/libs/metadataengine/dmetadata/dmetadatasettingscontainer.cpp

https://invent.kde.org/graphics/digikam/commit/1b5fc98b44930617f3a98ca098b5eb469de10ec1
Comment 6 caulier.gilles 2021-12-14 04:56:05 UTC
Stable digiKam 7.4.0 Windows Installer is published. Please check if problem is
reproducible.

Thanks in advance

Gilles Caulier
Comment 7 caulier.gilles 2022-01-21 16:06:35 UTC
Hi K D Murray,

I cannot reproduce the dysfunction with the AppImage pre-release bundle 7.6.0. I close this file now.

Gilles Caulier