Bug 419121 - Crash on selecting certain color profiles
Summary: Crash on selecting certain color profiles
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Color models (show other bugs)
Version: 4.2.8
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-22 19:53 UTC by Daniel Wein
Modified: 2020-04-02 13:34 UTC (History)
2 users (show)

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


Attachments
Krita backtrace log generated after the crash (68.97 KB, text/plain)
2020-03-23 13:13 UTC, Daniel Wein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Wein 2020-03-22 19:53:47 UTC
SUMMARY
Krita will crash when you select certain color spaces.

STEPS TO REPRODUCE
1. Open Krita.
2. Create a new file.
3. Click the Color Space Browser
4. Select RGB/A 8-Bit integer
5. Click "AnimePalette."

OBSERVED RESULT
Krita will stop responding, prompting Windows to kill it.

EXPECTED RESULT
Krita would select the Animepalette profile and display its information.

SOFTWARE/OS VERSIONS
Windows: Windows 10, running Krita 4.2.8 (Downloaded just minutes before this crash occurred)

ADDITIONAL INFORMATION
This happens on a large portion of the profiles, not just AnimePalette. For example, ColorMatch RGB also crashes.
Comment 1 Rebecca Breu 2020-03-22 21:08:59 UTC
Huh, I neither have AnimePalette nor ColorMatch RGB. Where did you get them from?
Comment 2 Daniel Wein 2020-03-22 22:18:03 UTC
(In reply to Rebecca Breu from comment #1)
> Huh, I neither have AnimePalette nor ColorMatch RGB. Where did you get them
> from?

That's strange; I haven't installed any addons to my Krita. I'm pretty sure I've got release, but I checked again after a complete reinstall (deleted all data folders, temp files, etc.)

I still have AnimePalette, but I did notice something of great note for this bug; selecting AnimePalette from the dropdown before using the Color Space Browser did NOT crash Krita, but Krita DID crash when I then pressed the Color Space Browser button.
Comment 3 Rebecca Breu 2020-03-23 07:41:29 UTC
Ah, it seems that colour profiles are system-wide, the same as fonts are. Apparently, AnimePalette is one that comes with PhotoShop.

Could you get a backtrace for your crash? See here:
https://docs.krita.org/en/reference_manual/dr_minw_debugger.html
Comment 4 Daniel Wein 2020-03-23 13:12:18 UTC
This makes sense; the laptop came pre-installed with Adobe CS6. I hadn't known that color profiles were system-wide. You learn something new everyday, I guess.
I've generated a backtrace using the Krita debug build. I'll attach it shortly after sending this comment.
Comment 5 Daniel Wein 2020-03-23 13:13:14 UTC
Created attachment 126967 [details]
Krita backtrace log generated after the crash
Comment 6 Halla Rempt 2020-03-24 10:43:00 UTC
Hm, that crash happens right inside lcms2, which is the color management library we're using. I have to check whether I can find those icc profiles somewhere... I don't have access to Photoshop myself.
Comment 7 Halla Rempt 2020-03-24 10:49:03 UTC
okay, I've found the palette file, and I do get a crash if I select it in the colorspace browser. From my web search, it seems that it is a malformed or special palette, but Krita (and lcms) shouldn't crash on it.
Comment 8 Halla Rempt 2020-03-24 11:09:24 UTC
Git commit 6e12760c0a2f0c29897d797ceefe593f28c47822 by Boudewijn Rempt.
Committed on 24/03/2020 at 11:07.
Pushed by rempt into branch 'master'.

Do not load link profiles

Photoshop comes with at least two profiles that get installed
globally that cannot be used in Krita. AnimePalette.icc is one
of them. The type of this profile is not cmsSigNamedColorClass
which it probably should be, but cmsSigLinkClass, which I cannot
believe is correct.

A quick google shows that other applications also have trouble
with this broken profile.

M  +2    -1    plugins/color/lcms2engine/colorprofiles/LcmsColorProfileContainer.cpp

https://invent.kde.org/kde/krita/commit/6e12760c0a2f0c29897d797ceefe593f28c47822
Comment 9 Halla Rempt 2020-03-24 11:11:02 UTC
Git commit 45e9530cede94ee30449be4bff474469efad2968 by Boudewijn Rempt.
Committed on 24/03/2020 at 11:10.
Pushed by rempt into branch 'krita/4.2'.

Do not load link profiles

Photoshop comes with at least two profiles that get installed
globally that cannot be used in Krita. AnimePalette.icc is one
of them. The type of this profile is not cmsSigNamedColorClass
which it probably should be, but cmsSigLinkClass, which I cannot
believe is correct.

A quick google shows that other applications also have trouble
with this broken profile.

M  +2    -1    plugins/color/lcms2engine/colorprofiles/LcmsColorProfileContainer.cpp

https://invent.kde.org/kde/krita/commit/45e9530cede94ee30449be4bff474469efad2968
Comment 10 Halla Rempt 2020-04-02 13:34:31 UTC
Git commit bbc6d9a7fd03b80f8235c047503881c5a1a3f5b0 by Boudewijn Rempt.
Committed on 02/04/2020 at 13:09.
Pushed by rempt into branch 'krita/4.3'.

Do not load link profiles

Photoshop comes with at least two profiles that get installed
globally that cannot be used in Krita. AnimePalette.icc is one
of them. The type of this profile is not cmsSigNamedColorClass
which it probably should be, but cmsSigLinkClass, which I cannot
believe is correct.

A quick google shows that other applications also have trouble
with this broken profile.
(cherry picked from commit 6e12760c0a2f0c29897d797ceefe593f28c47822)

M  +2    -1    plugins/color/lcms2engine/colorprofiles/LcmsColorProfileContainer.cpp

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