Bug 501974 - digikam crash when tag face from unknown faces
Summary: digikam crash when tag face from unknown faces
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Engine (show other bugs)
Version: 8.7.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-25 11:52 UTC by Petr Schonmann
Modified: 2025-04-05 04:20 UTC (History)
2 users (show)

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


Attachments
full backtrace (69.65 KB, text/plain)
2025-03-25 11:53 UTC, Petr Schonmann
Details
clinfo (16.18 KB, text/plain)
2025-03-25 21:13 UTC, Petr Schonmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Schonmann 2025-03-25 11:52:17 UTC
SUMMARY
Crash with backtrace

STEPS TO REPRODUCE
1. Go to unknown faces
2. Find face you want to tag
3. Assign tag, kaboom

OBSERVED RESULT

Thread 32 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff9b400640 (LWP 30936)]
0x00007fffc6f3290d in llvm::AnalysisManager<llvm::Module>::getResultImpl(llvm::AnalysisKey*, llvm::Module&) () from /opt/amdgpu/lib/x86_64-linux-gnu/libLLVM.so.18.1
(gdb) bt
#0  0x00007fffc6f3290d in llvm::AnalysisManager<llvm::Module>::getResultImpl(llvm::AnalysisKey*, llvm::Module&) () from /opt/amdgpu/lib/x86_64-linux-gnu/libLLVM.so.18.1
#1  0x00007fffc6f32800 in llvm::AnalysisManager<llvm::Module>::getResultImpl(llvm::AnalysisKey*, llvm::Module&) () from /opt/amdgpu/lib/x86_64-linux-gnu/libLLVM.so.18.1
#2  0x00007fffc6f78d00 in llvm::VerifierPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) () from /opt/amdgpu/lib/x86_64-linux-gnu/libLLVM.so.18.1
#3  0x00007fffc8ba1e96 in ?? () from /opt/amdgpu/lib/x86_64-linux-gnu/libLLVM.so.18.1
#4  0x00007fff21275129 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) () from /lib/x86_64-linux-gnu/libLLVM-15.so.1
#5  0x00007fff81d29c8d in (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile> >&) ()
   from /lib/x86_64-linux-gnu/libclang-cpp.so.15
#6  0x00007fff81d22617 in clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) () from /lib/x86_64-linux-gnu/libclang-cpp.so.15
#7  0x00007fff820828b1 in clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) () from /lib/x86_64-linux-gnu/libclang-cpp.so.15
#8  0x00007fff80e8ce9b in clang::ParseAST(clang::Sema&, bool, bool) () from /lib/x86_64-linux-gnu/libclang-cpp.so.15
#9  0x00007fff8207e925 in clang::CodeGenAction::ExecuteAction() () from /lib/x86_64-linux-gnu/libclang-cpp.so.15
#10 0x00007fff82ab4ea7 in clang::FrontendAction::Execute() () from /lib/x86_64-linux-gnu/libclang-cpp.so.15
#11 0x00007fff82a27fb6 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) () from /lib/x86_64-linux-gnu/libclang-cpp.so.15
#12 0x00007fff8e7cc54b in ?? () from /lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#13 0x00007fff8e7ceebf in ?? () from /lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#14 0x00007fff8e6a8d8a in ?? () from /lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#15 0x00007fff8e6862e7 in ?? () from /lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#16 0x00007fffe6d8c32d in ?? () from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_core.so.411
#17 0x00007fffe6d9bcd3 in ?? () from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_core.so.411
#18 0x00007fffe6da9648 in ?? () from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_core.so.411
#19 0x00007fffe6daa2ec in cv::ocl::Program::create(cv::ocl::ProgramSource const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) () from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_core.so.411
#20 0x00007fffe6daa705 in cv::ocl::Context::Impl::getProg(cv::ocl::ProgramSource const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) ()
   from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_core.so.411
#21 0x00007fffe6daa8ea in cv::ocl::Context::getProg(cv::ocl::ProgramSource const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) () from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_core.so.411
#22 0x00007fffe6daa9b4 in cv::ocl::Kernel::create(char const*, cv::ocl::ProgramSource const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) ()
   from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_core.so.411
#23 0x00007fffe71f19cc in cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int) () from /tmp/.mount_digiKaOJM2w5/usr/lib/libopencv_imgproc.so.411
#24 0x00007ffff77f8fbc in Digikam::DNNSFaceExtractor::getFaceEmbedding (this=this@entry=0x7fff9b3feee0, faceImage=...) at ././/include/opencv4/opencv2/core/mat.inl.hpp:92
#25 0x00007ffff7b8c512 in Digikam::FacePipelineBase::commonFaceThumbnailExtractor (this=0x7ffff7ef4560 <QGlobalStatic<QtGlobalStatic::Holder<Digikam::(anonymous namespace)::Q_QGS_facePipelineEditCreator> >::instance()::holder>, pipelineName=..., stagePriority=stagePriority@entry=QThread::NormalPriority, 
    thisStage=<optimized out>, thisStage@entry=Digikam::MLPipelineFoundation::Extractor, nextStage=nextStage@entry=Digikam::MLPipelineFoundation::Writer, trainingQualityCheck=trainingQualityCheck@entry=true) at /dktemp/digikam-master/core/utilities/facemanagement/pipelines/facepipelinebase.cpp:389
#26 0x00007ffff7b921e7 in Digikam::FacePipelineEdit::extractor (this=<optimized out>) at /dktemp/digikam-master/core/utilities/facemanagement/pipelines/edit/facepipelineedit.cpp:263
#27 0x00007ffff636a1f6 in std::__invoke_impl<bool, bool (Digikam::MLPipelineFoundation::*&)(), Digikam::MLPipelineFoundation*&> (__f=<synthetic pointer>: <optimized out>, __t=<synthetic pointer>: <optimized out>, __f=<synthetic pointer>: <optimized out>, __t=<synthetic pointer>: <optimized out>)
    at ././/include/c++/11/bits/invoke.h:74
#28 std::__invoke<bool (Digikam::MLPipelineFoundation::*&)(), Digikam::MLPipelineFoundation*&> (__fn=<synthetic pointer>: <optimized out>) at ././/include/c++/11/bits/invoke.h:96
#29 std::invoke<bool (Digikam::MLPipelineFoundation::*&)(), Digikam::MLPipelineFoundation*&> (__fn=<synthetic pointer>: <optimized out>) at ././/include/c++/11/functional:97
#30 QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*)#1}::operator()(bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*) const (
    args#0=<optimized out>, function=<optimized out>, __closure=<synthetic pointer>) at ././/include/QtConcurrent/qtconcurrentstoredfunctioncall.h:116
#31 std::__invoke_impl<bool, QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>(std::__invoke_other, QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, bool (Digikam::MLPipelineFoundation::*&&)(), Digikam::MLPipelineFoundation*&&) (__f=<synthetic pointer>...) at ././/include/c++/11/bits/invoke.h:61
#32 std::__invoke<QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>(QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, bool (Digikam::MLPipelineFoundation::*&&)(), Digikam::MLPipelineFoundation*&&) (__fn=<synthetic pointer>...)
    at ././/include/c++/11/bits/invoke.h:96
#33 std::__apply_impl<QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, std::tuple<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>, 0ul, 1ul>(QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, std::tuple<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>&&, std::integer_sequence<unsigned long, 0ul, 1ul>) (__t=..., __f=<synthetic pointer>...) at ././/include/c++/11/tuple:1854
#34 std::apply<QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, std::tuple<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*> >(QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor()::{lambda(bool (Digikam::MLPipelineFoundation::* const&)(), Digikam::MLPipelineFoundation*)#1}, std::tuple<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>&&) (
    __t=..., __f=<synthetic pointer>...) at ././/include/c++/11/tuple:1865
#35 QtConcurrent::StoredFunctionCall<bool (Digikam::MLPipelineFoundation::*)(), Digikam::MLPipelineFoundation*>::runFunctor (this=0x5555576302b0) at ././/include/QtConcurrent/qtconcurrentstoredfunctioncall.h:122
#36 QtConcurrent::RunFunctionTaskBase<bool>::run (this=0x5555576302b0) at ././/include/QtConcurrent/qtconcurrentrunbase.h:83
#37 0x00007ffff412a12b in ?? () from /tmp/.mount_digiKaOJM2w5/usr/lib/libQt6Core.so.6
#38 0x00007ffff41211f9 in ?? () from /tmp/.mount_digiKaOJM2w5/usr/lib/libQt6Core.so.6
#39 0x00007ffff3694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#40 0x00007ffff3726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Mint 21.3 - runs as appimage.

Complete backtrace in attachement
Comment 1 Petr Schonmann 2025-03-25 11:53:25 UTC
Created attachment 179718 [details]
full backtrace
Comment 2 Maik Qualmann 2025-03-25 12:02:12 UTC
You need to disable OpenCL in the digiKam settings under Miscellaneous -> System (restart digiKam). It crashes when using AMD GPU hardware acceleration.

Maik
Comment 3 caulier.gilles 2025-03-25 12:06:41 UTC
Maik,  Perhaps it miss something to enable in OpenCV to have the AMD GPU support ?

https://invent.kde.org/graphics/digikam/-/blob/master/project/bundles/3rdparty/ext_opencv/CMakeLists.txt?ref_type=heads#L82

See the reference here :

https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html

Gilles
Comment 4 caulier.gilles 2025-03-25 12:45:47 UTC
It crash in the OpenCL part of OpenCV library.

Go to the DK/Setup/Misc/system and disable the OpenCL hardware acceleration.

https://docs.digikam.org/en/setup_application/miscs_settings.html#system-settings
Comment 5 Maik Qualmann 2025-03-25 13:03:13 UTC
Due to a Kernel/Mesa bug, I currently have no graphics acceleration at all under openSUSE Tumbleweed with Radeon/AMD. It's still somewhat tolerable under X, but under Wayland, the mouse pointer jumps 5 cm. Once it's working again here, I can try using AMD hardware acceleration and OpenCV.

Maik
Comment 6 caulier.gilles 2025-03-25 13:06:14 UTC
No AMD device here to test, only Intel/NVidia
Comment 7 Petr Schonmann 2025-03-25 14:39:36 UTC
Does this setting affect speed of face recognition / detection ? Or it just some setting for gui rendering ?
Confirm that uncheck of this option fixed the problem.
Comment 8 caulier.gilles 2025-03-25 15:31:52 UTC
From the online doc :

"Use the OpenCL hardware acceleration: this option will enable the GPU hardware accelerations with the face management, image quality scanning, and auto-tags features. This option affects the OpenCV engine used in the background for intensive computation on images. To see the details about OpenCV hardware support, go to the Help ‣ Components Information menu item, and look at the OpenCV section in the dialog."

Gilles Caulier
Comment 9 Petr Schonmann 2025-03-25 21:13:07 UTC
Im using this hardware from clinfo
Comment 10 Petr Schonmann 2025-03-25 21:13:29 UTC
Created attachment 179734 [details]
clinfo
Comment 11 Petr Schonmann 2025-03-26 16:14:01 UTC
Maybe something related from log
2025-03-26 17:11:14.793062 MESA-LOADER: failed to open radeonsi: ././/lib/dri/radeonsi_dri.so: sdílený objektový soubor nelze otevřít: Adresář nebo soubor neexistuje (search paths ././/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:././/lib/dri, suffix _dri)
2025-03-26 17:11:14.793336 MESA-LOADER: failed to open zink: ././/lib/dri/zink_dri.so: sdílený objektový soubor nelze otevřít: Adresář nebo soubor neexistuje (search paths ././/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:././/lib/dri, suffix _dri)
2025-03-26 17:11:14.793599 MESA-LOADER: failed to open kms_swrast: ././/lib/dri/kms_swrast_dri.so: sdílený objektový soubor nelze otevřít: Adresář nebo soubor neexistuje (search paths ././/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:././/lib/dri, suffix _dri)
2025-03-26 17:11:14.793874 MESA-LOADER: failed to open swrast: ././/lib/dri/swrast_dri.so: sdílený objektový soubor nelze otevřít: Adresář nebo soubor neexistuje (search paths ././/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:././/lib/dri, suffix _dri)
Comment 12 caulier.gilles 2025-03-26 16:58:55 UTC
yes it's clear, the RADEON is AMD device and MESA the OPenGL software interface under Linux.
Comment 13 Petr Schonmann 2025-03-27 10:06:29 UTC
Ok, let me clarify my latest comment

Something wrong i meant bad path... Probably digikam is trying to search in path with single dots, but expecting double dots notation. I have some files there. See below.

pschonmann@E495:/tmp/.mount_digiKaB46bsa$ ls ../..//lib/x86_64-linux-gnu/dri
crocus_dri.so  d3d12_drv_video.so  i965_dri.so        iris_dri.so        kms_swrast_dri.so~  nouveau_drv_video.so  r200_dri.so  r600_dri.so   r600_drv_video.so   radeon_dri.so    radeonsi_dri.so~       radeonsi_drv_video.so~  swrast_dri.so~     virtio_gpu_dri.so~       virtio_gpu_drv_video.so~  vmwgfx_dri.so~
d3d12_dri.so   i915_dri.so         i965_drv_video.so  kms_swrast_dri.so  nouveau_dri.so      nouveau_vieux_dri.so  r300_dri.so  r600_dri.so~  r600_drv_video.so~  radeonsi_dri.so  radeonsi_drv_video.so  swrast_dri.so           virtio_gpu_dri.so  virtio_gpu_drv_video.so  vmwgfx_dri.so             zink_dri.so

instead of one dot in path

pschonmann@E495:/tmp/.mount_digiKaB46bsa$ ls ././/lib/x86_64-linux-gnu/dri
ls: nelze přistoupit k '././/lib/x86_64-linux-gnu/dri': Adresář nebo soubor neexistuje
Comment 14 caulier.gilles 2025-04-05 04:20:31 UTC
Hi Petr,

The new AppImage bundle 8.7.0 pre-release for Linux based on Qt 6.8.3 and OpenCV 4.11.0 is online at usual place :

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

Let's me here if the problem remain.

Best regards

Gilles Caulier