Bug 467496 - Various crashes on Windows: update libde265 >= 1.0.11 and libaom >= v3.6.0
Summary: Various crashes on Windows: update libde265 >= 1.0.11 and libaom >= v3.6.0
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-HEIF (other bugs)
Version First Reported In: 7.10.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-17 15:21 UTC by dnovomesky
Modified: 2023-03-27 11:07 UTC (History)
2 users (show)

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


Attachments
First crash (7.32 KB, image/png)
2023-03-17 15:21 UTC, dnovomesky
Details
Second crash (7.74 KB, image/png)
2023-03-17 15:22 UTC, dnovomesky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dnovomesky 2023-03-17 15:21:39 UTC
Created attachment 157363 [details]
First crash

Hello,

I installed digiKam 7.10.0 on Windows but I am getting multiple crashes when digiKam scans files on hard drive.

The first crash I get is from libaom.dll
When I remove kimg_avif.dll (to disable AVIF support), then I get second crash in liblibde265.dll
Comment 1 dnovomesky 2023-03-17 15:22:26 UTC
Created attachment 157364 [details]
Second crash
Comment 2 caulier.gilles 2023-03-17 15:31:58 UTC
Did you have this kind of image containers in your collections (AOM, AVIF, HEIF) ?
Comment 3 dnovomesky 2023-03-17 15:40:31 UTC
I have AVIF and HEIC files.

After further examination I see that majority of HEIC files are working, only some of them trigger the crash.

However, it seems that any AVIF file trigger the crash.
Comment 4 caulier.gilles 2023-03-17 15:46:47 UTC
For HEIF, we have a dedicated loader in digiKam. We can investiguate where is the problem. For the other one, the loaders come from KF5::KImageFormat framework from KDE.

Please share the suspected files using cloud.
Comment 5 dnovomesky 2023-03-17 16:39:05 UTC
I did an experiment.
I replaced libaom.dll - I took file from msys2 project and AVIF files crashing previously started to work.

MSYS2 builds 3.6.0 version, I think digiKam has v3.5.0.
Can you try to upgrade libaom?
Comment 6 Maik Qualmann 2023-03-17 21:41:07 UTC
We need the corresponding images to investigate and fix the problem. If not public, to our e-mail addresses.

Maik
Comment 7 Maik Qualmann 2023-03-19 10:42:31 UTC
Thank you for the sample image. This image does not crash with either digiKam7.10.0 or digiKam-8.0.0 here on Windows10.

@Gilles, is it possible that libraries that are present in the Windows system are loaded instead of the ones in our digiKam program directory? As far as I know, our cross compiled libraries are not binary compatible. Do we possibly need to set a library search path?

Maik
Comment 8 caulier.gilles 2023-03-19 11:08:46 UTC
Due to the non binary compatibility with C++ objects, the OS libraries cannot be loaded instead. I'm sure.

This is not the case for the pure C libraries, more and less, if ABI is compatible.

But there is another case : on other application also cross compiled is installed on the system and used as well...

We have only a qt conf file near the executable :

https://invent.kde.org/graphics/digikam/-/blob/master/project/bundles/mxe/data/qt.conf

That all. If we want to restrict the PATH to use the internal libraries, a batch file must be created to wrap executables. If i remember Firefox do it under Windows.

Look also Krita which wrap executable in LNK files. there are binaries to start application:

https://invent.kde.org/graphics/krita/-/tree/master/packaging/windows

I think LNK files can do the job also.

Gilles
Comment 9 caulier.gilles 2023-03-19 11:30:31 UTC
Maik,

As i can see, last Firefox under Windows to not use a startup wrapper script. It point directly on the application executable.

How Firefox solve the possible issues if mixed libraries from different programs are installed on the system: mysterious...

Gilles
Comment 10 Maik Qualmann 2023-03-20 11:43:03 UTC
The second sample image "crash_me.heic" also crashes here under Linux. Also with other programs that use the libheif. The crash is deep in the libheif library. This issue must be reported directly to the libheif team with the sample image.

https://github.com/strukturag/libheif

Maik
Comment 11 dnovomesky 2023-03-20 12:12:50 UTC
I think crash_me.heic crashes only with old libraries. Upgrade to latest libde265 should help.
Comment 12 caulier.gilles 2023-03-20 15:35:57 UTC
which libde265 ? the rolling-release code from git or a specific release version of the lib ?
Comment 13 dnovomesky 2023-03-20 16:02:34 UTC
libde265 v1.0.11
Comment 14 caulier.gilles 2023-03-21 03:47:42 UTC
ok, i will plan to update the libde265 to this version in all bundles asap...

Gilles
Comment 15 caulier.gilles 2023-03-25 09:49:07 UTC
Git commit 318709dfd65bd745ca5e3336f8ab21dd72ddc106 by Gilles Caulier.
Committed on 25/03/2023 at 09:48.
Pushed by cgilles into branch 'master'.

update libde265 to 1.0.11

M  +4    -4    project/bundles/3rdparty/ext_libde265/CMakeLists.txt
M  +10   -7    project/bundles/3rdparty/ext_libde265/libde265-lib-only.patch

https://invent.kde.org/graphics/digikam/commit/318709dfd65bd745ca5e3336f8ab21dd72ddc106
Comment 16 caulier.gilles 2023-03-25 12:37:27 UTC
Git commit a09a70153335c06e86e2d984ed9f70d5223e6778 by Gilles Caulier.
Committed on 25/03/2023 at 12:35.
Pushed by cgilles into branch 'master'.

build Windows installer with KDE framework 5.104 and release service 22.12.3

M  +2    -2    project/bundles/mxe/config.sh

https://invent.kde.org/graphics/digikam/commit/a09a70153335c06e86e2d984ed9f70d5223e6778
Comment 17 caulier.gilles 2023-03-25 17:17:49 UTC
Hi  dnovomesky,

I rebuild the whole MXE cross compiler on the Continuous Deployment computer. libde265 have been updated as the KF5 framework to tha last 5.104, to update the KImageFormats component including extra Qt image codecs.

The Windows installer version 8.0.0 is uploaded at usual place:

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

Please test and report if problem is fixed...

Best regards

Gilles Caulier
Comment 18 Maik Qualmann 2023-03-25 19:55:40 UTC
Hi Gilles,

There is no longer a crash in the Windows version with this special HEIC image and it is also displayed "correctly". In addition to the HEIC image, dnovomesky also sent me a screenshot of an image viewer under Windows. Great.

Maik
Comment 19 dnovomesky 2023-03-25 20:25:47 UTC
I tried the digiKam-8.0.0-20230325T124404-Win64.exe but I still have the problem with that AVIF file.

I saw one case when digiKam loaded that file but I get crashes majority of time.

Do you want to try upgrading the libaom to v3.6.0?
Comment 20 caulier.gilles 2023-03-25 20:55:11 UTC
of course, i will do it
Comment 21 caulier.gilles 2023-03-26 08:41:42 UTC
Git commit e58bc7ab40fe0c562d924343fa1e62c84edf5629 by Gilles Caulier.
Committed on 26/03/2023 at 08:41.
Pushed by cgilles into branch 'master'.

update Libaom version to 3.6.0 under Windows

M  +3    -3    project/bundles/3rdparty/ext_libaom/CMakeLists.txt

https://invent.kde.org/graphics/digikam/commit/e58bc7ab40fe0c562d924343fa1e62c84edf5629
Comment 22 caulier.gilles 2023-03-26 14:20:32 UTC
Windows installer is now updated at usual place :

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

Please test and report.

Gilles Caulier
Comment 23 dnovomesky 2023-03-27 09:14:48 UTC
Good news!

I installed digiKam-8.0.0-20230326T140515-Win64.exe and the AVIF works well.

The most important problems are solved. Thanks!

My suggestion is to upgrade the libheif too when it is convenient for you. (you may look at my PR: https://invent.kde.org/graphics/digikam/-/merge_requests/206 ). One option changed in libheif and there are some new options.

In the past, I was able to trigger an assert when providing corrupted HEIC file. Fixed already in libheif (info in https://github.com/strukturag/libheif/issues/781 )
Comment 24 caulier.gilles 2023-03-27 11:07:09 UTC
Ok, great. I close this file as original problem is solved.

For the libheif rolling release usage in the bundle, please open a new remember file in bugzilla.

Best

Gilles