Bug 517942 - Qt assertion failure due to integer overflow in facepipeline.
Summary: Qt assertion failure due to integer overflow in facepipeline.
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Detection (other bugs)
Version First Reported In: 8.8.0
Platform: Manjaro Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-21 10:03 UTC by Peta
Modified: 2026-03-21 12:14 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peta 2026-03-21 10:03:27 UTC
SUMMARY

when I click on "scan for faces" when digikam starts, it crashes after several seconds with this log:

STEPS TO REPRODUCE
1. aFAsaEzQqM found a way to reproduce the crash, see https://discuss.kde.org/t/digikam-crashes-when-starting-to-scan-faces-with-qt6-error/43970/2?u=peta
2. "I just now created a new screenshot with the dimensions 1273:23 pixels and put that in a new empty album. Trying to view that album or scanning its faces also caused the same crash."

OBSERVED RESULT

ASSERT failure in constexpr QtPrivate::QCheckedIntegers::QCheckedInt<int> QtPrivate::QCheckedIntegers::operator-(QCheckedInt<int>, QCheckedInt<int>): "Overflow in operator-", file /usr/include/qt6/QtCore/qcheckedint_impl.h, line 69
[1]    6076 IOT instruction (core dumped)  digikam

EXPECTED RESULT

well, should not crash :-D

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro Linux x86_64
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.2

ADDITIONAL INFORMATION

britiger suggested a fix:

diff --git a/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp b/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp
index 43d6ba65d1..3d54c14f1b 100644
--- a/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp
+++ b/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp
@@ -415,6 +415,10 @@ bool FacePipelineDetectRecognize::extractor()
                 int width   = static_cast<int>(detectionResults.at<float>(i, 2));
                 int height  = static_cast<int>(detectionResults.at<float>(i, 3));
 
+                if(qMin(X, Y) == std::numeric_limits<int>::min() || qMin(width, height) == std::numeric_limits<int>::min()) {
+                    qCWarning(DIGIKAM_FACESENGINE_LOG) << "Invalid detectionResults rect (INT_MIN) for image" << package->info.filePath();
+                    continue;
+                }
                 // Add the rect to result list.
 
                 faceFRects << QRectF(qreal(X)      / qreal(cvUResizedImage.cols),

see https://discuss.kde.org/t/digikam-crashes-when-starting-to-scan-faces-with-qt6-error/43970/4?u=peta
Comment 1 caulier.gilles 2026-03-21 12:13:02 UTC
Git commit 00d2dfc31eb90c392e11d77d1d35c91dff4df3e8 by Gilles Caulier.
Committed on 21/03/2026 at 12:10.
Pushed by cgilles into branch 'master'.

Add patch to prevent crash overflow in face pipeline when values returned by OpenCV raise INT_MIN limit.
FIXED-IN: 9.1.0

M  +20   -0    core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp

https://invent.kde.org/graphics/digikam/-/commit/00d2dfc31eb90c392e11d77d1d35c91dff4df3e8