Created attachment 182530 [details] File that can crash Krita SUMMARY Enabling gradient overlay seems to crash Krita when there is no gradient preset selected. I have attached a file where this might be reproducible. STEPS TO REPRODUCE 1. Open layer styles for "Clone Layer 3" 2. Click on the checkbox to enable "Gradient Overlay" OBSERVED RESULT Krita crashes after a moment. EXPECTED RESULT No crashing. SOFTWARE/OS VERSIONS I'm on Linux Mint. ADDITIONAL INFORMATION Selecting Gradient Overlay without enabling it doesn't crash Krita. It seems the box to select a preset doesn't have a gradient selected. If you select a gradient first and then enable the gradient overlay, Krita won't crash. In other words, somehow the preset selected by default is invalid, and instead of falling back to some fallback gradient Krita just crashes. I'm not sure what controls which gradient is selected by default when you open the dialog. If it's a global setting per user, then the file won't help reproduce the bug and you'll have to somehow make the default invalid to trigger the bug. I don't know why my default is empty. I tried setting the overlay on both 5.2.2 and 5.2.9, it crashes in both versions.
Hello Noel, I tried replicating this on Windows 10 Pro and I could not reproduce it, not even with your attached project file. For me there seems to be a gradient selcted by default. Can you maybe add a screenshot that shows how the gradient window looks by default when you open it? Might be a Linux specific issue.
Created attachment 182559 [details] Video of Krita crashing after selecting gradient overlay
I see, thanks for adding the video. Someone with the appropriate Linux build needs to verify this, as on my Windows it looks completely different and has a preselected gradient. Changing the status to reported again.
Created attachment 182567 [details] Gradient gone on Krita's toolbar (In reply to Lukas from comment #3) > I see, thanks for adding the video. Someone with the appropriate Linux build > needs to verify this, as on my Windows it looks completely different and has > a preselected gradient. Changing the status to reported again. I tried switching to a different user on my system and opening the file. It had a preselected gradient. I believe this means there is some sort of user setting or some data saved per user that is used to compute the fallback/default preset. The only possibility I can imagine is if it falls back to the last preset the user selected, but I'm pretty sure I had selected one before while I using the gradient layer style. I did some testing and I think I figured out another piece of the puzzle. The "fallback" gradient is the gradient selected on the toolbar. In the "different user" I had the default FG to BG gradient, so that's what appeared in the preset. In the user that triggers the crash the toolbar isn't showing any preset, so I think it's undefined somehow. In other words, if you manage to make the toolbar gradient become "blank" then the gradient overlay will crash because it doesn't handle the toolbar gradient being invalid. I'm not sure how I managed to make it become blank. I didn't even notice it was that way until now.
I managed to figure out how to make the gradient button blank. It's been reported as a separate bug: https://bugs.kde.org/show_bug.cgi?id=506769 Simply create a custom gradient, tag it with a custom tag, select the tag and the gradient, reload Krita, then try to add the gradient overlay and Krita crashes. I crashed it with nightly this time so I got the line. embeddedResources.last().data() in /builds/graphics/krita/libs/image/kis_asl_layer_style_serializer.cpp, line 756