Bug 415643 - digiKam crashes Face detection
Summary: digiKam crashes Face detection
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Detection (show other bugs)
Version: 7.0.0
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-28 14:34 UTC by r4c3
Modified: 2020-08-10 10:18 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments
three times crashed (10.53 KB, application/gzip)
2019-12-28 14:34 UTC, r4c3
Details
run 4 (99.22 KB, text/plain)
2019-12-28 17:13 UTC, r4c3
Details

Note You need to log in before you can comment on or make changes to this bug.
Description r4c3 2019-12-28 14:34:09 UTC
Created attachment 124758 [details]
three times crashed

SUMMARY


STEPS TO REPRODUCE
1. Start Digikam and going to Person and start Face detection at 13 % Digikam freezes
2. Start Digikam and going to Person and start Face detection at 4 % Digikam freezes
3. Start Digikam and going to Person and start Face detection at 0 % Digikam freezes

OBSERVED RESULT
Digikam crashes
The Memory is really full with 6 Gb and the swap needs 47 Mib

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Betriebssystem: Manjaro Linux 
KDE-Plasma-Version: 5.17.4
KDE-Frameworks-Version: 5.64.0
Qt-Version: 5.13.2
Kernel-Version: 4.19.88-1-MANJARO
Art des Betriebssystems: 64-bit
Prozessoren: 4 × Intel® Core™ i5-7200U CPU @ 2.50GHz
Speicher: 7,7 GiB Arbeitsspeicher

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2019-12-28 14:54:55 UTC
Which AppImage version do you use exactly?

Maik
Comment 2 Maik Qualmann 2019-12-28 16:49:07 UTC
It looks like we're still not completely rid of our strange crashes. For statistics, again Intel i5. The 6 GB memory used is clearly too much. Depending on the images that are being processed, I come here to a peak of 1.2GB, but after some time of facial detection it goes back to 0.6GB. Gilles, what is your current memory consumption like?

Maik
Comment 3 caulier.gilles 2019-12-28 16:51:51 UTC
Yes, Which version ? 

Very strange, in last backtrace i seen dshareddata.h. Maik, you don't drop this container use in whole source code ?

Gilles
Comment 4 Maik Qualmann 2019-12-28 16:54:07 UTC
No, it's QSharedData...

Maik
Comment 5 caulier.gilles 2019-12-28 16:55:40 UTC
On my i7 32 Gb of RAM, digiKam allocate between 600 and 800 Mb to process detection. But this stay stable in time (1 hour of computation, 8000 faces detected)

There is no crash here, with simple or multicore.

Gilles
Comment 6 r4c3 2019-12-28 17:11:31 UTC
Digikam 7.0.0 beta 1

After restart 0,6 gb in use

After starting digikam in Debug mode 1,2 GB in use

After starting face detection
* 20 seconds 1,8
* 30 seconds 2,0 GB
* 90 s 2,2 GB 
* 180 s 2,3- 2,4 gb
* 5 minutes 3,7 GB and swap 1,0 MB.  1% of the collection done
* 10 min  3,8 GB and swap 1,8 MB 3%
* 15 min 3,8 GB and swap 3,5 MB 4% and freezing


CPU state always at 100% 
Is tehre something that i can do ?
Comment 7 r4c3 2019-12-28 17:13:18 UTC
Created attachment 124762 [details]
run 4

at 15 mins freeze Logfile
Comment 8 caulier.gilles 2019-12-28 17:19:31 UTC
Did you use one CPU or multicore to process faces detection or recognition ?

Personalty, i never seen this kind of memory allocation here.
Comment 9 Maik Qualmann 2019-12-28 18:26:58 UTC
Git commit f1448085316b16ddf1d3492fefa81aa160779dc9 by Maik Qualmann.
Committed on 28/12/2019 at 18:25.
Pushed by mqualmann into branch 'master'.

remove further static functions in DImg

M  +16   -14   core/libs/dimg/dimg.h
M  +25   -1    core/libs/dimg/dimg_copy.cpp
M  +0    -24   core/libs/dimg/dimg_p.h
M  +2    -2    core/libs/dimg/dimg_scale.cpp

https://invent.kde.org/kde/digikam/commit/f1448085316b16ddf1d3492fefa81aa160779dc9
Comment 10 r4c3 2019-12-29 13:45:44 UTC
Only the Multicore option crashes!

So. I am sorry the multicore option was on, when I turn it of the Face detection runs till 100%.


without multicore option:
* CPU average load is 90-95 % at all cores

- 26 % 3,9 GB Swap 603 MB
- 41 % 4,3 GB Swap 803 MB
- 49 % 4,3 GB Swap 777,3 MB
- 61 % 3,9 GB Swap 2,8 GB
- 70 % 5,5 GB Swap 3,5 GB
- 76 % 3,7 GB Swap 3,2 GB
- 87 % 4,9 GB Swap 3,2
- 99% 6,7 GB Swap 3,5 GB

Now the next Problem:

I tagged manually 200-300 People with Names and run the option face recognition. The face recognition completed but no more faces recognized by the software. 
I scanned the hole Albums and marked all keywords that I set.
100% sensitivity; no multicore


Thank you Maik
Comment 11 r4c3 2019-12-29 13:48:31 UTC
Additional Information

After complete scan the RAM is still full 5 GB and 3 GB Swap


After Closing Digikam with one instance of thunderbird and firefox opened. 900 MB and 400 MB Swap
Comment 12 Maik Qualmann 2019-12-29 18:02:29 UTC
*** Bug 415685 has been marked as a duplicate of this bug. ***
Comment 13 Vitalii Tymchyshyn 2019-12-30 00:22:44 UTC
One more backtrace. Note that I unchecked multi threaded analysis, but it still used all my CPUs and failed
#0  QSharedDataPointer<Digikam::IccProfile::Private>::QSharedDataPointer (o=..., this=0x7fff8bffe980)
    at ././/include/QtCore/qshareddata.h:92
#1  Digikam::IccProfile::IccProfile (this=0x7fff8bffe980, other=...)
    at /b/dktemp/digikam-v7.0.0-beta1/core/libs/dimg/filters/icc/iccprofile.cpp:215
#2  0x00007ffff770b3a3 in QtPrivate::QVariantValueHelper<Digikam::IccProfile>::metaType (v=...)
    at ././/include/QtCore/qvariant.h:728
#3  QtPrivate::MetaTypeInvoker<QtPrivate::QVariantValueHelper<Digikam::IccProfile>, QVariant const&, Digikam::IccProfile>::invoke (a=...) at ././/include/QtCore/qvariant.h:117
#4  qvariant_cast<Digikam::IccProfile> (v=...) at ././/include/QtCore/qvariant.h:865
#5  QVariant::value<Digikam::IccProfile> (this=0x20569f8) at ././/include/QtCore/qvariant.h:364
#6  Digikam::LoadingDescription::PostProcessingParameters::profile (this=this@entry=0x20569f0)
    at /b/dktemp/digikam-v7.0.0-beta1/core/libs/threadimageio/fileio/loadingdescription.cpp:90
#7  0x00007ffff7715d35 in Digikam::SharedLoadingTask::postProcess (this=0x2056850)
    at /b/dktemp/digikam-v7.0.0-beta1/core/libs/threadimageio/fileio/loadsavetask.cpp:325
#8  0x00007ffff76f4684 in Digikam::PreviewLoadingTask::execute (this=0x2056850)
    at /b/dktemp/digikam-v7.0.0-beta1/core/libs/threadimageio/preview/previewtask.cpp:390
#9  0x00007ffff770a2be in Digikam::LoadSaveThread::run (this=0x1dab6d0)
    at /b/dktemp/digikam-v7.0.0-beta1/core/libs/threadimageio/fileio/loadsavethread.cpp:133
#10 0x00007ffff772edee in Digikam::DynamicThread::Private::run (this=0x12b3d70)
    at /b/dktemp/digikam-v7.0.0-beta1/core/libs/threads/dynamicthread.cpp:183
#11 0x00007ffff435fa27 in ?? () from /tmp/.mount_digikaMQBPJL/usr/lib/libQt5Core.so.5
#12 0x00007ffff435bca3 in ?? () from /tmp/.mount_digikaMQBPJL/usr/lib/libQt5Core.so.5
#13 0x00007ffff34ee6db in start_thread (arg=0x7fff8bfff700) at pthread_create.c:463
#14 0x00007ffff321788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Comment 14 Maik Qualmann 2019-12-30 07:14:45 UTC
Git commit 8a91e9d33fd4fdad9fd6f506329f9672d25d6f11 by Maik Qualmann.
Committed on 30/12/2019 at 07:14.
Pushed by mqualmann into branch 'master'.

delete loading task from the todo list

M  +5    -8    core/libs/threadimageio/engine/managedloadsavethread.cpp

https://invent.kde.org/kde/digikam/commit/8a91e9d33fd4fdad9fd6f506329f9672d25d6f11
Comment 15 r4c3 2019-12-31 19:24:45 UTC
Could i do something to help? Or should I stand by at the moment?

Best wishes to the New year.
Comment 16 Maik Qualmann 2019-12-31 19:28:17 UTC
Have you already tested the last new snapshots?

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

Maik
Comment 17 r4c3 2020-01-01 00:10:51 UTC
(In reply to Maik Qualmann from comment #16)
> Have you already tested the last new snapshots?
> 
> https://files.kde.org/digikam/
> 
> Maik

Thank you, now i have tested with the actual beta. The same problem I tagged manually about 100 faces and after recognition with digikam no detection.
Comment 18 caulier.gilles 2020-01-01 06:47:27 UTC
There is no crash anymore ?

Happy new year...

Gilles Caulier
Comment 19 r4c3 2020-01-04 10:40:57 UTC
With the new beta and multicore activated there is no crash anymore =) Thank you everyone =)
Happy new year!


Should I open a new Bug for the following problem?
* scan for faces with digikam
* recognize manually a lot of them
* start the automatically recognition from digikam and there no faces detected in the section unconfirmed faces
Comment 20 caulier.gilles 2020-01-04 10:50:01 UTC
Thanks for the feedback.

>Should I open a new Bug for the following problem?
>* scan for faces with digikam
>* recognize manually a lot of them
>* start the automatically recognition from digikam and there no faces detected >in the section unconfirmed faces

==> yes, but one bugzilla entry by problem. Please do not mix problem in same file, it's the hell to drive.

Also, i'm sure that we have already some entry with the same topic. Please review existing bugzilla entries first to prevent duplicates

Links to bugzilla folders about face management :

 * Detection  : https://bugs.kde.org/buglist.cgi?bug_status=__open__&component=Faces-Detection&list_id=1698953&product=digikam
 * Engine     : https://bugs.kde.org/buglist.cgi?bug_status=__open__&component=Faces-Engine&list_id=1698955&product=digikam
 * Maintenance: https://bugs.kde.org/buglist.cgi?bug_status=__open__&component=Faces-Maintenance&list_id=1698957&product=digikam
 * Recognition: https://bugs.kde.org/buglist.cgi?bug_status=__open__&component=Faces-Recognition&list_id=1698959&product=digikam
 * Workflow   : https://bugs.kde.org/buglist.cgi?bug_status=__open__&component=Faces-Workflow&list_id=1698961&product=digikam

Thanks in advance

Gilles Caulier