Bug 511565

Summary: Segfault during startup scanning.
Product: [Applications] digikam Reporter: mail
Component: Database-ScanAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.7.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 9.0.0
Sentry Crash Report:
Attachments: Meshroom depthmap EXR file crashing digikam scanning

Description mail 2025-11-03 09:47:15 UTC
SUMMARY
digikam crashes consistently on a range of exr files created by Meshroom (unknown version, files created 2023). exiftool (unknown version, ships with openSuse Tumbleweed) can read the EXIF data without problems. The crash happens when scanning for new items after startup.
As a workaround I chmod -x the respective folder in my collection.

STEPS TO REPRODUCE
1.  place the exr file in the media folder
2.  start digikam and let it scan for new items
3. segfault with cannot load metadata (exr file type not known but scanned?)
4. try exiftool, it can reads the metadata of the file

OBSERVED RESULT

prime-run digikam &
GBM is not supported with the current configuration. Fallback to Vulkan rendering in Chromium.
Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.
Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.
qt.multimedia.ffmpeg: Using Qt multimedia with FFmpeg version 7.1.1 nonfree and unredistributable
libva error: /usr/lib64/dri/vdpau_drv_video.so init failed
kf.xmlgui: Unhandled container to remove :  Digikam::DigikamApp
digikam.metaengine: Cannot load metadata from file with Exiv2 backend: /media/Bilder5/Bilder/3D/Moos/Meshroom/MeshroomCache/DepthMap/1fe3453e2ad123fd5b582486796d6d4bff459947/1075361187_depthMap.exr  (Error # 12 :  "/media/Bilder5/Bilder/3D/Moos/Meshroom/MeshroomCache/DepthMap/1fe3453e2ad123fd5b582486796d6d4bff459947/1075361187_depthMap.exr: The file contains data of an unknown image type"
/usr/bin/prime-run: line 2: 4043989 Segmentation fault         (core dumped) __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"

EXPECTED RESULT
either gracefully ignore the file or handle it properly


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSuse Tumbleweed
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2025-11-03 09:55:48 UTC
It crashes in the NVIDIA driver, why are you using the "prime-run" program with digiKam?

Maik
Comment 2 caulier.gilles 2025-11-03 10:01:00 UTC
The crash has probably nothing to do with the EXR file. I suspect a problem with the NVIDIA card when the Chromium based Qt component is initialized about the OpenGL support.

Best 

Gilles Caulier
Comment 3 mail 2025-11-03 10:02:14 UTC
Created attachment 186453 [details]
Meshroom depthmap EXR file crashing digikam scanning

Unfortunately all my exr files are >>4MB. The file behind the link https://oc.advico.de/index.php/s/RsYPw9cCKo6P2e6 was originally named 1075361187_depthMap.exr and has 38791750 bytes. exiftool info shows some possibly problematic float values?:
Exif Focal Plane X Resolution   : 5991.72
Exif Focal Plane Y Resolution   : 6002.07
Data Window                     : 0 0 4343 2895
Display Window                  : 0 0 4343 2895
Image Width                     : 4344
Image Height                    : 2896
Image Size                      : 4344x2896
Comment 4 mail 2025-11-03 10:06:30 UTC
(In reply to Maik Qualmann from comment #1)
> It crashes in the NVIDIA driver, why are you using the "prime-run" program
> with digiKam?
> 
> Maik

just in case digikam would utilize the GPU for some of it's work (does it? Fingerprinting might be a good candidate, it takes very long). Should not be related to the crash, just showing the complete output after starting it
Comment 5 Maik Qualmann 2025-11-03 11:26:47 UTC
No problems with the sample EXR image using my digiKam-8.9.0 developer version under openSUSE Tumbleweed here.

Maik
Comment 6 Maik Qualmann 2025-11-03 11:34:46 UTC
Git commit 6a75c0f0ca872c5b3f738a10f64f854f1a7a3549 by Maik Qualmann.
Committed on 03/11/2025 at 11:33.
Pushed by mqualmann into branch 'master'.

let ExifTool copy image-specific metadata
This gives us virtual Exif/Iptc/Xmp metadata,
similar to FITS or video files.

M  +5    -2    core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp

https://invent.kde.org/graphics/digikam/-/commit/6a75c0f0ca872c5b3f738a10f64f854f1a7a3549
Comment 7 Maik Qualmann 2025-11-03 11:38:37 UTC
The crash is therefore not related to Exiv2 or a digiKam image loader. Fingerprint creation does not use the GPU. Please test it without running prime-run.

Maik
Comment 8 mail 2025-11-03 11:57:17 UTC
I confirm that the weekly build appimage 8.9.0 does not crash :) 
BTW, thanks a lot for this unvaluable tool!
Comment 9 mail 2025-11-03 12:07:36 UTC
In the logs I still see issues with all the Meshroom images, but it doesn't kill the program anymore:

- unknown: QSvgHandler: Image filename is empty   (several times, source files are unknown, maybe missing read permissions?)

- Digikam::MetaEngine::Private::printExiv2ExceptionError: Cannot load metadata from file with Exiv2 backend: /media/Bilder5/Bilder/3D/Moos/Meshroom/MeshroomCache/DepthMap/1fe3453e2ad123fd5b582486796d6d4bff459947/1075361187_depthMap.exr  (Error # 12 :  "/media/Bilder5/Bilder/3D/Moos/Meshroom/MeshroomCache/DepthMap/1fe3453e2ad123fd5b582486796d6d4bff459947/1075361187_depthMap.exr: The file contains data of an unknown image type"

- Digikam::MetaEngine::Private::printExiv2ExceptionError: Cannot load metadata from file with Exiv2 backend: /media/Bilder5/Bilder/3D/Moos/Meshroom/MeshroomCache/DepthMapFilter/3d34852deb25a1f7b6d963141f199cec8abfb5b4/1115300506_nmodMap.png  (Error # 4 :  "This does not look like a TIFF image"
--> Nope, this is indeed a PNG and not a TIFF as also reported by "file" and "exiftool". Exiftool does report this warning, though:
"Warning                         : [minor] Text/EXIF chunk(s) found after PNG IDAT (may be ignored by some readers)"
Do you want a sample file for this as well? (I don't have time to check if Meshroom might have fixed something and I don't really care for these particular files)
Comment 10 Maik Qualmann 2025-11-03 12:14:30 UTC
The error messages are normal; Exiv2 does not support this file type. Requests for EXR support must be submitted to the Exiv2 on GitHub repository. If a digiKam version with my latest modification is available, at least Exif and XMP metadata will be displayed (virtually). Note that these EXR images do not contain Exif metadata.

Maik
Comment 11 Maik Qualmann 2025-11-04 07:20:31 UTC
Do not use prime-run with Qt programs; Qt itself uses the GPU required to accelerate graphics operations. We are also aware of problems under Windows where users attempt to assign a specific GPU, which does not work. I am closing this bug report.

Maik