Bug 408731 - Krita crashes on showing welcome screen if a special tiff file is in Rec. Docs
Summary: Krita crashes on showing welcome screen if a special tiff file is in Rec. Docs
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 4.2.1
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
: 410461 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-06-15 10:34 UTC by Tiar
Modified: 2019-08-02 12:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
File that crashes Krita's welcome screen (1.00 MB, image/tiff)
2019-06-15 10:34 UTC, Tiar
Details
Crash log (13.68 KB, text/plain)
2019-06-15 18:16 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2019-06-15 10:34:39 UTC
Created attachment 120886 [details]
File that crashes Krita's welcome screen

SUMMARY
There is a tiff file (attached) that opens fine in Krita, but crashes it when Krita tries to populate Recent Documents on the welcome screen (aka either when closing all the files after opening this one, or reopening Krita).

STEPS TO REPRODUCE
1. Open attached file.
2. Close the tab.
3. [Crash]
4. Reset Krita configuration.
5. Open attached file.
6. Open another file.
7. Close the attached file.
8. Close the other file.
9. [Crash]
10. Open Krita again.
11. [Crash]
12. Reset configuration.
13. Krita opens fine.

OBSERVED RESULT
There are several crashes along the way.

EXPECTED RESULT
There should be no crashes.

SOFTWARE/OS VERSION:
Linux/KDE Plasma: 
Qt Version: 5.12.3
Krita 4.2.1 appimage

ADDITIONAL INFORMATION
Krita 4.1.7 doesn't crash.
Comment 1 Tiar 2019-06-15 18:16:58 UTC
Created attachment 120897 [details]
Crash log
Comment 2 Ahab Greybeard 2019-06-15 20:58:01 UTC
I can confirm this for the latest current nightly krita-4.3.0-prealpha-bebb0d6-x86_64.appimage
Comment 3 Halla Rempt 2019-06-17 08:03:03 UTC
Gwenview says:

boud@boud-ThinkPad-T470p:~/Downloads$ gwenview *tif
foo: Sorry, can not handle images with 32-bit samples.
Gwenview can only apply color profile on RGB32 or ARGB32 images
QImageReader::read() using format hint "kra" failed: "Unknown error"
QImageReader::read() without format hint failed: "Unsupported image format"

Interestingly, I don't get a crash, just an empty document icon for a thumbnail, and the following message on the terminal:

foo: Sorry, can not handle images with 32-bit samples.
Comment 4 Halla Rempt 2019-06-20 13:27:21 UTC
The crash happens inside the Qt tiff handler, so technically it's an upstream problem. I wonder why it doesn't happen with Qt 5.12.3 as installed on my KDE neon system, and does happen with the 5.12.3 and 5.12.4 we used for our appimages.
Comment 5 Halla Rempt 2019-06-20 13:40:51 UTC
Git commit d03f5ae9fe83682b63451da564477ca242748fda by Boudewijn Rempt.
Committed on 20/06/2019 at 13:40.
Pushed by rempt into branch 'master'.

Patch the Qt tiff gtimageio plugin

This adds support for high bit-depth tiffs

M  +3    -0    3rdparty/ext_qt/CMakeLists.txt
A  +51   -0    3rdparty/ext_qt/tiff.patch

https://invent.kde.org/kde/krita/commit/d03f5ae9fe83682b63451da564477ca242748fda
Comment 6 Halla Rempt 2019-06-21 08:15:03 UTC
Nope, that didn't help. It broke the build. I don't think there's anything we can do... It's either a difference in the way libtiff is built or in the way Qt is built, but it's not a bug in Krita.
Comment 7 Halla Rempt 2019-08-02 10:40:38 UTC
*** Bug 410461 has been marked as a duplicate of this bug. ***
Comment 8 Halla Rempt 2019-08-02 10:44:01 UTC
Oh, we could work around this... Let me see.
Comment 9 Halla Rempt 2019-08-02 11:06:07 UTC
Git commit 08a18cbcb741ce97031ed89a82fd9dcf31ca8a66 by Boudewijn Rempt.
Committed on 02/08/2019 at 11:05.
Pushed by rempt into branch 'master'.

Use our own tiff loader for the recent files thumbnails

M  +16   -0    libs/ui/KisWelcomePageWidget.cpp

https://invent.kde.org/kde/krita/commit/08a18cbcb741ce97031ed89a82fd9dcf31ca8a66
Comment 10 Halla Rempt 2019-08-02 12:13:10 UTC
Git commit d5adb6dab15bb513168010dcbcfb79fd383b5357 by Boudewijn Rempt.
Committed on 02/08/2019 at 12:12.
Pushed by rempt into branch 'krita/4.2'.

Use our own tiff loader for the recent files thumbnails

M  +16   -0    libs/ui/KisWelcomePageWidget.cpp

https://invent.kde.org/kde/krita/commit/d5adb6dab15bb513168010dcbcfb79fd383b5357