Bug 464567

Summary: Freeze on thumbnail creation (git 8.0 version)
Product: [Applications] digikam Reporter: maderios <leoutation>
Component: Thumbs-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin, thijsvanulden
Priority: NOR    
Version: 8.0.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 8.0.0
Sentry Crash Report:

Description maderios 2023-01-20 20:56:00 UTC
Arch Linux system, git version
After downloading, setting, face detection then launching maintenance tool or/and update fingerprints, Digikam freezes. I did the test three times. I see nothing about Opencv

[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  [34m0x00007ffff50c5f61[m in [33m__cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*))[m
    (obj=0x7fffa00b36e0, tinfo=0x7ffff740f658 <typeinfo for LibRaw_exceptions>, dest=0x0)
    at [32m/usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc[m:81
#1  [34m0x00007fffc84ee878[m in  () at [32m/usr/lib/libraw.so.23[m
#2  [34m0x00007fffc856e514[m in [33mLibRaw::open_datastream(LibRaw_abstract_datastream*)[m () at [32m/usr/lib/libraw.so.23[m
#3  [34m0x00007fffd0033e86[m in  () at [32m/usr/lib/qt/plugins/imageformats/kimg_raw.so[m
#4  [34m0x00007fffd00340da[m in  () at [32m/usr/lib/qt/plugins/imageformats/kimg_raw.so[m
#5  [34m0x00007ffff5929514[m in  () at [32m/usr/lib/libQt5Gui.so.5[m
#6  [34m0x00007ffff592b236[m in  () at [32m/usr/lib/libQt5Gui.so.5[m
#7  [34m0x00007ffff592c458[m in [33mQImageReader::read(QImage*)[m () at [32m/usr/lib/libQt5Gui.so.5[m
#8  [34m0x00007ffff592d59a[m in [33mQImageReader::read()[m () at [32m/usr/lib/libQt5Gui.so.5[m
#9  [34m0x00007ffff59111a2[m in [33mQImage::fromData(unsigned char const*, int, char const*)[m () at [32m/usr/lib/libQt5Gui.so.5[m
#10 [34m0x00007ffff5911269[m in [33mQImage::loadFromData(unsigned char const*, int, char const*)[m () at [32m/usr/lib/libQt5Gui.so.5[m
#11 [34m0x00007ffff6b00c3a[m in [33mDigikam::MetaEngine::getItemPreview(QImage&) const[m () at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#12 [34m0x00007ffff6bb2102[m in [33mDigikam::ThumbnailCreator::loadImagePreview(Digikam::DMetadata const&) const[m () at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#13 [34m0x00007ffff6bb3cde[m in [33mDigikam::ThumbnailCreator::createThumbnail(Digikam::ThumbnailInfo const&, QRect const&) const[m ()
    at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#14 [34m0x00007ffff6bacfdf[m in [33mDigikam::ThumbnailCreator::load(Digikam::ThumbnailIdentifier const&, QRect const&, bool) const[m ()
    at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#15 [34m0x00007ffff6bad6e0[m in [33mDigikam::ThumbnailCreator::load(Digikam::ThumbnailIdentifier const&) const[m () at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#16 [34m0x00007ffff6bbcd3b[m in  () at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#17 [34m0x00007ffff6bbdd82[m in [33mDigikam::LoadSaveThread::run()[m () at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#18 [34m0x00007ffff6bec62a[m in  () at [32m/usr/lib/libdigikamcore.so.8.0.0[m
#19 [34m0x00007ffff533f251[m in  () at [32m/usr/lib/libQt5Core.so.5[m
#20 [34m0x00007ffff533b32a[m in  () at [32m/usr/lib/libQt5Core.so.5[m
#21 [34m0x00007ffff4e9c8fd[m in  () at [32m/usr/lib/libc.so.6[m
#22 [34m0x00007ffff4f1ed20[m in  () at [32m/usr/lib/libc.so.6[m

Add Comment
	

    Collapse All Comments
    Expand All Comments
Comment 1 Maik Qualmann 2023-01-20 21:02:39 UTC
Your bug report has nothing to do with face detection. When creating thumbnails, the KImageFormats plugins are probably used for RAW files. We need the debug log to see what type of file is being loaded.

Maik
Comment 2 Maik Qualmann 2023-01-20 21:09:24 UTC
The problem occurs when loading a thumbnail from ""Iptc.Application2.Preview" or ""Xmp.digiKam.Preview". Either you have images with broken preview data (then we need the corresponding image) or your KImageFormat plugins are broken.

Maik
Comment 3 maderios 2023-01-21 10:02:23 UTC
Digikam freeze happens when i try to rebuild thumbnails with maintenance tool. 
To know: none of jpeg files have exif  data because i deleted them before  with command 'exiftool  -r -P -overwrite_original' 
Full debug log here
https://www.dropbox.com/s/c0vy4nsf5od4c6d/dk-debug-21-01-22.txt?dl=0
Comment 4 Maik Qualmann 2023-01-21 11:41:12 UTC
Can you send me this image? It must have metadata (IPTC).

/home/oula/IMAGES/BvaF4S-IUAAqQvx.jpg

Maik
Comment 5 Maik Qualmann 2023-01-21 12:15:24 UTC
Git commit 65d161e09b4fa9e83be9f12f0cc6138329106ccb by Maik Qualmann.
Committed on 21/01/2023 at 12:13.
Pushed by mqualmann into branch 'master'.

try to fix and debug the crash in QImageReader

M  +18   -4    core/libs/metadataengine/engine/metaengine_item.cpp

https://invent.kde.org/graphics/digikam/commit/65d161e09b4fa9e83be9f12f0cc6138329106ccb
Comment 6 Maik Qualmann 2023-01-21 12:16:56 UTC
Thanks for the test image, yes no metadata available. Please test the current git version, the debug log from the end if it crashes is enough.

Maik
Comment 7 maderios 2023-01-21 16:58:18 UTC
After rebuilding digikam git, no freeze, no crash when I rebuild thumbnails with maintenance tool
Comment 8 Maik Qualmann 2023-01-21 17:08:27 UTC
Thanks for the feedback. I was pretty sure it was fixed after looking into the KImageFormats plugin for RAW that doesn't check for an empty QByteArray and passes it to libraw that way.

Maik
Comment 9 Maik Qualmann 2023-01-21 17:10:42 UTC
Git commit a7f0ae81e685f13884acecfc33d8dfa8e43b966d by Maik Qualmann.
Committed on 21/01/2023 at 17:09.
Pushed by mqualmann into branch 'master'.

remove test debug
FIXED-IN: 8.0.0

M  +2    -1    NEWS
M  +0    -4    core/libs/metadataengine/engine/metaengine_item.cpp

https://invent.kde.org/graphics/digikam/commit/a7f0ae81e685f13884acecfc33d8dfa8e43b966d
Comment 10 Maik Qualmann 2023-01-21 17:26:03 UTC
Git commit fd5472bef2b00152d1fe5424a8bccd89f6798324 by Maik Qualmann.
Committed on 21/01/2023 at 17:25.
Pushed by mqualmann into branch 'master'.

more checks for empty image data

M  +11   -0    core/libs/metadataengine/engine/metaengine_exif.cpp
M  +1    -1    core/libs/metadataengine/engine/metaengine_previews.cpp

https://invent.kde.org/graphics/digikam/commit/fd5472bef2b00152d1fe5424a8bccd89f6798324
Comment 11 Thijs 2023-01-30 19:13:00 UTC
*** Bug 465044 has been marked as a duplicate of this bug. ***