Bug 464745 - Coredump on face detection or face assignation
Summary: Coredump on face detection or face assignation
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Detection (show other bugs)
Version: 7.9.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-24 15:55 UTC by cinghio
Modified: 2023-02-01 15:40 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.10.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cinghio 2023-01-24 15:55:48 UTC
SUMMARY

STEPS TO REPRODUCE
1. Start digikam
2. Run face detection "scan collection for faces" OR try to assign an already detected face to a tag name

OBSERVED RESULT

Digikam will consume up to 100% of one thread for few second and then it will coredump

EXPECTED RESULT

Not to crash!

SOFTWARE/OS VERSIONS
Archlinux: updated
KDE frameorks: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

coredump (output of coredumpctl gdb):

#0  0x00007f160f4a164c in  () at /usr/lib/libc.so.6
#1  0x00007f160f451938 in raise () at /usr/lib/libc.so.6
#2  0x00007f160f43b53d in abort () at /usr/lib/libc.so.6
#3  0x00007f160f6d30a2 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) (file=<optimized out>, line=<optimized out>, function=<optimized out>, condition=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/debug.cc:60
#4  0x00007f160efdc26d in  () at /usr/lib/libopencv_dnn.so.407
#5  0x00007f160c297a0e in  () at /usr/lib/libopencv_core.so.407
#6  0x00007f160c28ff7b in  () at /usr/lib/libopencv_core.so.407
#7  0x00007f160c2a35c7 in  () at /usr/lib/libopencv_core.so.407
#8  0x00007f15fdfd048b in  () at /usr/lib/libtbb.so.12
#9  0x00007f15fdfd2169 in  () at /usr/lib/libtbb.so.12
#10 0x00007f160f49f8fd in  () at /usr/lib/libc.so.6
#11 0x00007f160f521d20 in  () at /usr/lib/libc.so.6

digikam.rawengine: LibRaw: setup internal DNG SDK
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
munmap(0x7f94663b8000, 63705088)        = 0
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLPRI}, {fd=27, events=POLLIN}, {fd=31, events=POLLIN}, {fd=65, events=POLLIN}, {fd=90, events=POLLIN}, {fd=101, events=POLLIN}, {fd=136, events=POLLIN}, {fd=142, events=POLLIN}, {fd=144, events=POLLIN}, {fd=146, events=POLLIN}, {fd=147, events=POLLIN}, {fd=148, events=POLLIN}], 16, 0) = 1 ([{fd=5, revents=POLLIN}])
read(5, "\2\0\0\0\0\0\0\0", 16)         = 8
write(134, "\1\0\0\0\0\0\0\0", 8)       = 8
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLPRI}, {fd=27, events=POLLIN}, {fd=31, events=POLLIN}, {fd=65, events=POLLIN}, {fd=90, events=POLLIN}, {fd=101, events=POLLIN}, {fd=136, events=POLLIN}, {fd=142, events=POLLIN}, {fd=144, events=POLLIN}, {fd=146, events=POLLIN}, {fd=147, events=POLLIN}, {fd=148, events=POLLIN}], 16, 530/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.
/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.
/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.
 <unfinished ...>) = ?
+++ killed by SIGABRT (core dumped) +++
Comment 1 caulier.gilles 2023-01-24 16:01:24 UTC
Which openCV version did you use? 4.7.0 is bugous. Use the Linux appImage bundle instead, where we hosts openCV 4.6.0. File is available here :

https://files.kde.org/digikam/

To use appimage is very simple :

https://docs.digikam.org/en/getting_started/installation.html#digikam-on-linux

Gilles Caulier
Comment 2 cinghio 2023-01-24 17:03:17 UTC
Thanks for the fast reply.

As you mention, I have OpenCV 4.7.0 installed.

Just got the digikam appimage and I'm unable to run it.
As I run it, the app seems to start but no window is created except the splash and the notification that the collection has been scanned.
On the terminal I read the following (maybe related to wayland?):

-- digiKam Linux AppImage Bundle
-- Use 'help' as CLI argument to know all available options for digiKam application.
-- Notes: to integrate this bundle to your desktop, use AppImageLauncher.
--        to enable all debug messages on the console, use 'export QT_LOGGING_RULES="digikam*=true"'.
--        to extract the bundle contents locally, use option '--appimage-extract' on the command line.
-- Detected host Linux arch-64-"rolling"
-- AppImage mounted directory: /tmp/.mount_digiKaKplFMx
Check library libudev.so.0
Check library libxcb-dri3.so.0
Check library libcrypto.so.1.1
Check library libssl.so.1.1
Check library libnss3.so
Check library libnssutil3.so
Check library libsmime3.so
Check library libgmodule-2.0.so.0
-- Preloading shared libs: :/tmp/.mount_digiKaKplFMx/usr/lib/libavif.so.13:/usr/lib64/libxcb-dri3.so.0:/usr/lib64/libnss3.so:/usr/lib64/libnssutil3.so:/usr/lib64/libsmime3.so:/usr/lib64/libgmodule-2.0.so.0
unknown: EGL not available
[0124/175619.483822:WARNING:resource_bundle_qt.cpp(119)] locale_file_path.empty() for locale
[0124/175619.670714:WARNING:resource_bundle_qt.cpp(119)] locale_file_path.empty() for locale
[0124/175619.713942:WARNING:resource_bundle_qt.cpp(119)] locale_file_path.empty() for locale
QtAV 1.13.0(Jan 23 2023, 11:31:11)
Multimedia framework base on Qt and FFmpeg.

[0124/175622.757923:WARNING:resource_bundle_qt.cpp(119)] locale_file_path.empty() for locale
unknown: Unhandled container to remove :  Digikam::DigikamApp
unknown: composeAndFlush: QOpenGLContext creation failed
unknown: composeAndFlush: makeCurrent() failed
unknown: composeAndFlush: makeCurrent() failed
unknown: composeAndFlush: makeCurrent() failed
unknown: composeAndFlush: makeCurrent() failed
unknown: composeAndFlush: makeCurrent() failed
unknown: composeAndFlush: makeCurrent() failed
unknown: composeAndFlush: makeCurrent() failed
Comment 3 Maik Qualmann 2023-01-24 18:40:50 UTC

*** This bug has been marked as a duplicate of bug 464646 ***
Comment 4 Maik Qualmann 2023-01-29 20:32:13 UTC
Git commit f2f86c3c6719e4ea0bc7de95ce1ae33e8c45495e by Maik Qualmann.
Committed on 29/01/2023 at 20:30.
Pushed by mqualmann into branch 'qt5-maintenance'.

fix crash with the release version of OpenCV-4.7.0
The problem is already fixed with the master version of OpenCV.
Related: bug 464646
FIXED-IN: 7.10.0

M  +3    -1    NEWS
M  +6    -0    core/libs/facesengine/detection/opencv-dnn/dnnfacedetectorssd.cpp
M  +7    -0    core/libs/facesengine/detection/opencv-dnn/dnnfacedetectoryolo.cpp
M  +6    -0    core/libs/facesengine/recognition/opencv-dnn/dnnfaceextractor.cpp

https://invent.kde.org/graphics/digikam/commit/f2f86c3c6719e4ea0bc7de95ce1ae33e8c45495e
Comment 5 abstract.wolf@gmail.com 2023-02-01 06:09:09 UTC
Crashing for me with OpenCV 4.7.1 with same steps to reproduce: http://ix.io/4mKZ
Comment 6 caulier.gilles 2023-02-01 06:27:14 UTC
To comment #5 : did you use last code from git including last changes from Maik ?

Gilles Caulier
Comment 7 Maik Qualmann 2023-02-01 07:00:30 UTC
I don't see that OpenCV-4.7.1 is published on https://github.com/opencv/opencv
Our workaround is only applied to version 4.7.0 and is only included in digiKam-7.10.0. All OpenCV versions > 4.7.0 must contain the fix. I'll look for the bug reports on OpenCV later.

Maik
Comment 8 abstract.wolf@gmail.com 2023-02-01 15:40:38 UTC
(In reply to Maik Qualmann from comment #7)
> I don't see that OpenCV-4.7.1 is published on
> https://github.com/opencv/opencv
> Our workaround is only applied to version 4.7.0 and is only included in
> digiKam-7.10.0. All OpenCV versions > 4.7.0 must contain the fix. I'll look
> for the bug reports on OpenCV later.
> 
> Maik

Oops sorry that's my mistake. It's actually 4.7.0-1. I'm using the opencv-cuda package from pacman on Arch.