Bug 465034 - digikam crashes when trying to recognize faces
Summary: digikam crashes when trying to recognize faces
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Workflow (other bugs)
Version First Reported In: 7.9.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-30 10:24 UTC by Max
Modified: 2023-01-30 18:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 7.10.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max 2023-01-30 10:24:57 UTC
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
***

Whenever digikam tries to update its knowledge about faces, it crashes with the following console output:
/usr/include/c++/12.2.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
fish: Job 1, 'digikam' terminated by signal SIGABRT (Abort)

"Whenever it tries to update its knowledge" comprises the following situations (and maybe more):
- I manually label a face in a picture with Ctrl+Mouse. As soon as i hit enter after having typed the name of the person, the program crashes.
- I right click on a collection or subcollection and in the context menu, click on "Scan for faces'


STEPS TO REPRODUCE
1. Open digikam
2. Right-click any collection or sub-collection from your "Albums" tab.
3. In the context menu, click on "Scan for faces"

OBSERVED RESULT
The program crashes


EXPECTED RESULT
It scans for faces without crashing


SOFTWARE/OS VERSIONS
Arch Linux
gcc v12.2.1
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2023-01-30 10:52:38 UTC
The cause is a bug in the release version of OpenCV-4.7.0. The problem has already been fixed in the current master version of OpenCV. We added a workaround for digiKam-7.10.0 to bypass the bug in OpenCV-4.7.0.

https://invent.kde.org/graphics/digikam/-/commit/f2f86c3c6719e4ea0bc7de95ce1ae33e8c45495e

Maik
Comment 2 caulier.gilles 2023-01-30 10:56:09 UTC
This evening, i will rebuild all bundles including last Maik changes

Gilles
Comment 3 Max 2023-01-30 11:13:41 UTC
(In reply to Maik Qualmann from comment #1)
> The cause is a bug in the release version of OpenCV-4.7.0. The problem has
> already been fixed in the current master version of OpenCV. We added a
> workaround for digiKam-7.10.0 to bypass the bug in OpenCV-4.7.0.
> 
> https://invent.kde.org/graphics/digikam/-/commit/
> f2f86c3c6719e4ea0bc7de95ce1ae33e8c45495e
> 
> Maik

Thanks for your quick reply, looking forward to the new build!
Comment 4 Maik Qualmann 2023-01-30 11:36:46 UTC
Again, for the avoidance of doubt: Gilles creates a new AppImage, but it is not affected since we are still using OpenCV-4.6.0. Here Archlinux would have to create a new patched version.

Maik
Comment 5 Max 2023-01-30 11:45:39 UTC
(In reply to Maik Qualmann from comment #4)
> Again, for the avoidance of doubt: Gilles creates a new AppImage, but it is
> not affected since we are still using OpenCV-4.6.0. Here Archlinux would
> have to create a new patched version.
> 
> Maik

Ah okay, thanks for clarifying! So i'll wait for the patch to the arch opencv package.
Comment 6 Thijs 2023-01-30 18:33:53 UTC
*** Bug 465038 has been marked as a duplicate of this bug. ***