| Summary: | 8.3.0: Crash when generating fingerprints on Windows 11 | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Thomas Pietrowski <thopiekar> |
| Component: | Maintenance-Similarities | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | caulier.gilles, metzpinguin |
| Priority: | NOR | ||
| Version First Reported In: | 8.3.0 | ||
| Target Milestone: | --- | ||
| Platform: | Microsoft Windows | ||
| OS: | Microsoft Windows | ||
| Latest Commit: | Version Fixed/Implemented In: | 8.4.0 | |
| Sentry Crash Report: | |||
| Attachments: |
Broken JPEG file 1
Broken JPEG file 2 Broken JPEG file 3 |
||
|
Description
Thomas Pietrowski
2024-03-22 11:34:13 UTC
It seems to crash in libjpeg, please install DebugView, enable internal debugging and see which file is loaded last. We would like to have the file to test. https://www.digikam.org/contribute/ Maik Hello Maik, it looks like an old backup of photos I made. I never scanned for broken JPEG files and there are about 3 files that don't get any thumbnails created in Windows' File Explorer. I'm going to drop 2 of them here. Created attachment 168381 [details]
Broken JPEG file 1
Created attachment 168382 [details]
Broken JPEG file 2
However, the two images cannot be the cause; they do not cause a crash under Windows. But this is also because they don't have the magic bytes 0xFF and 0xD8 and so the JPEG loader doesn't even try to load them. Maik I disabled parallel processing and here's another one: [23040] digikam.dimg: "<SOME PATH HERE>/IMG-20210330-WA0004.jpg" : "JPEG" file identified [23040] digikam.dimg.jpeg: Start of Image ( 1 ) [23040] digikam.dimg.jpeg: JFIF APP0 marker: version 1.01, density 1x1 0 ( 1 ) [23040] digikam.dimg.jpeg: Miscellaneous marker 0xe1, length 3785 ( 1 ) [23040] digikam.dimg.jpeg: Miscellaneous marker 0xed, length 64 ( 1 ) [23040] digikam.dimg.jpeg: Define Quantization Table 0 precision 0 ( 1 ) [23040] digikam.dimg.jpeg: Define Quantization Table 1 precision 0 ( 1 ) [23040] digikam.dimg.jpeg: Start Of Frame 0xc2: width=720, height=1600, components=3 ( 1 ) [23040] digikam.dimg.jpeg: Component 1: 2hx2v q=0 ( 1 ) [23040] digikam.dimg.jpeg: Component 2: 1hx1v q=1 ( 1 ) [23040] digikam.dimg.jpeg: Component 3: 1hx1v q=1 ( 1 ) [23040] digikam.dimg.jpeg: Define Huffman Table 0x00 ( 1 ) [23040] digikam.dimg.jpeg: 0 3 1 1 1 1 1 0 ( 2 ) [23040] digikam.dimg.jpeg: 0 0 0 0 0 0 0 0 ( 2 ) [23040] digikam.dimg.jpeg: Define Huffman Table 0x01 ( 1 ) [23040] digikam.dimg.jpeg: 1 1 1 1 1 1 0 0 ( 2 ) [23040] digikam.dimg.jpeg: 0 0 0 0 0 0 0 0 ( 2 ) [23040] digikam.dimg.jpeg: Start Of Scan: 3 components ( 1 ) [23040] digikam.dimg.jpeg: Component 1: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Component 2: dc=1 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Component 3: dc=1 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Ss=0, Se=0, Ah=0, Al=2 ( 1 ) [23040] digikam.dimg.jpeg: Start Of Scan: 3 components ( 1 ) [23040] digikam.dimg.jpeg: Component 1: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Component 2: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Component 3: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Ss=0, Se=0, Ah=2, Al=1 ( 1 ) [23040] digikam.dimg.jpeg: Start Of Scan: 3 components ( 1 ) [23040] digikam.dimg.jpeg: Component 1: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Component 2: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Component 3: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Ss=0, Se=0, Ah=1, Al=0 ( 1 ) [23040] digikam.dimg.jpeg: Define Huffman Table 0x11 ( 1 ) [23040] digikam.dimg.jpeg: 0 1 3 2 4 4 4 4 ( 2 ) [23040] digikam.dimg.jpeg: 5 4 2 3 1 0 0 0 ( 2 ) [23040] digikam.dimg.jpeg: Start Of Scan: 1 components ( 1 ) [23040] digikam.dimg.jpeg: Component 2: dc=0 ac=1 ( 1 ) [23040] digikam.dimg.jpeg: Ss=1, Se=63, Ah=0, Al=0 ( 1 ) [23040] digikam.dimg.jpeg: Define Huffman Table 0x11 ( 1 ) [23040] digikam.dimg.jpeg: 0 2 2 1 1 7 3 2 ( 2 ) [23040] digikam.dimg.jpeg: 4 6 2 3 0 0 0 0 ( 2 ) [23040] digikam.dimg.jpeg: Start Of Scan: 1 components ( 1 ) [23040] digikam.dimg.jpeg: Component 3: dc=0 ac=1 ( 1 ) [23040] digikam.dimg.jpeg: Ss=1, Se=63, Ah=0, Al=0 ( 1 ) [23040] digikam.dimg.jpeg: Define Huffman Table 0x10 ( 1 ) [23040] digikam.dimg.jpeg: 0 1 3 2 4 3 6 3 ( 2 ) [23040] digikam.dimg.jpeg: 5 6 4 6 1 4 2 3 ( 2 ) [23040] digikam.dimg.jpeg: Start Of Scan: 1 components ( 1 ) [23040] digikam.dimg.jpeg: Component 1: dc=0 ac=0 ( 1 ) [23040] digikam.dimg.jpeg: Ss=1, Se=63, Ah=0, Al=2 ( 1 ) [23040] digikam.dimg.jpeg: Corrupt JPEG data: premature end of data segment ( -1 ) [23040] digikam.dimg.jpeg: Start of Image ( 1 ) [23040] digikam.dimg.jpeg: Invalid JPEG file structure: two SOI markers After this digikam seems to have died. Created attachment 168392 [details]
Broken JPEG file 3
Thanks for the sample image, I can reproduce the crash on Windows, but there is no crash on Linux. Maik This is exactly what I noticed here, too. Windows is my secondary system and using Debian primary here. Git commit 0363b5184d0e90a50e23f8ee6e0e99e99024126b by Maik Qualmann. Committed on 11/04/2024 at 20:25. Pushed by mqualmann into branch 'master'. add test debug for the jpeg loader M +2 -1 core/dplugins/dimg/jpeg/dimgjpegloader_load.cpp https://invent.kde.org/graphics/digikam/-/commit/0363b5184d0e90a50e23f8ee6e0e99e99024126b With the last build you can see from the debug output that setjmp does not work in the MSVC build.
I suspect that there are no correct exception conditions set in the compiler flags and MSVC is doing internal handling.
@Gilles, we should try to compile all VCPKG packages with the following flag:
set(VCPKG_C_FLAGS "/EHa ${VCPKG_C_FLAGS}")
set(VCPKG_CXX_FLAGS "/EHa ${VCPKG_C_FLAGS}")
Maik
Git commit b4f090afbe019fb1ac9131f9c0c8ec62968bc315 by Gilles Caulier. Committed on 13/04/2024 at 15:17. Pushed by cgilles into branch 'master'. add more compilation flags for MSVC M +4 -0 project/bundles/vcpkg/01-build-vcpkg.sh https://invent.kde.org/graphics/digikam/-/commit/b4f090afbe019fb1ac9131f9c0c8ec62968bc315 Git commit f07917545b88870575c89eb50ae56d11faa78686 by Maik Qualmann. Committed on 13/04/2024 at 18:52. Pushed by mqualmann into branch 'master'. fix a copy/paste typo M +2 -1 project/bundles/vcpkg/01-build-vcpkg.sh https://invent.kde.org/graphics/digikam/-/commit/f07917545b88870575c89eb50ae56d11faa78686 Git commit dcfaade35f568c6eaeebb30b9a1c9e084cc797f8 by Maik Qualmann. Committed on 13/04/2024 at 18:57. Pushed by mqualmann into branch 'master'. add more compile flags to all build stages M +4 -0 project/bundles/vcpkg/02-build-extralibs.sh M +4 -0 project/bundles/vcpkg/03-build-digikam.sh https://invent.kde.org/graphics/digikam/-/commit/dcfaade35f568c6eaeebb30b9a1c9e084cc797f8 Git commit 7a4f80d2f9a23267f5ff0b49f09cce8bf9ad2f08 by Maik Qualmann. Committed on 14/04/2024 at 09:42. Pushed by mqualmann into branch 'master'. use try/catch for the DImg JPEG loader The Microsoft doc says to prefer try/catch instead of setjmp/longjmp in C++ programs. M +1 -12 core/dplugins/dimg/jpeg/dimgjpegloader.cpp M +0 -9 core/dplugins/dimg/jpeg/dimgjpegloader.h M +361 -371 core/dplugins/dimg/jpeg/dimgjpegloader_load.cpp M +167 -175 core/dplugins/dimg/jpeg/dimgjpegloader_save.cpp M +0 -5 project/bundles/vcpkg/01-build-vcpkg.sh M +0 -4 project/bundles/vcpkg/02-build-extralibs.sh M +0 -4 project/bundles/vcpkg/03-build-digikam.sh https://invent.kde.org/graphics/digikam/-/commit/7a4f80d2f9a23267f5ff0b49f09cce8bf9ad2f08 Hi Maik, I currently recompile digiKam with the flags, not all the VCPKG install. I fear to see the complete install broken due to some defect port. I have the same problem with Macports, where plenty of ports are completly broken (and not relevant of digiKam directly as dependency). I other words, it's complex to see a stable build env. At least for Macports. I hope to see VCPKG more tested and fluent in time... Gilles Git commit c9c46fde6f06cb2fdf6263539e54c98e73b88a31 by Maik Qualmann. Committed on 14/04/2024 at 10:07. Pushed by mqualmann into branch 'master'. use try/catch for the JPEGUtils M +1 -1 core/dplugins/dimg/jpeg/dimgjpegloader_load.cpp M +1 -1 core/dplugins/dimg/jpeg/dimgjpegloader_save.cpp M +347 -364 core/libs/jpegutils/jpegutils.cpp https://invent.kde.org/graphics/digikam/-/commit/c9c46fde6f06cb2fdf6263539e54c98e73b88a31 Hi Gilles, I removed the flags again. We now use try/catch for libjpeg. Krita does it that way too. Please start a recompile of VCPKG again. Best Maik Last MSVC build with try/catch works, digiKam no longer crashes with the broken JPEG image. Maik Downloaded a fresh copy of a nightly build. The crash seems to be resolved now :) |