Bug 494122

Summary: Krita crashes when merging Vector layer with drawing layer if at least one image is in the reference tool.
Product: [Applications] krita Reporter: DavB <david.boudon>
Component: Tools/Reference ImagesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: ahab.greybeard, dimula73, halla, penguinflyer2222
Priority: NOR    
Version First Reported In: 5.2.6   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: crashlog

Description DavB 2024-10-04 15:28:03 UTC
Created attachment 174422 [details]
crashlog

SUMMARY
Krita crashes when merging Vector layer with drawing layer if at least one image is in the reference tool. Reproducted on two different windows 11, one after reset all krita preferences. 

STEPS TO REPRODUCE
1. Add a image in reference tool
2. Make a vector layer (text for exemple)
3. Merge it down with the base layer on any drawing layer
4. Crash

OBSERVED RESULT
Krita closes

EXPECTED RESULT
Layer should merge

SOFTWARE/OS VERSIONS
Windows: 11

ADDITIONAL INFORMATION
Comment 1 Freya Lupen 2024-10-04 16:22:10 UTC
Confirmed on 5.3.0-prealpha-b03a11fd27 as well as 5.2.2, so it's not a (recent) regression.
Comment 2 Ahab Greybeard 2024-10-04 16:31:13 UTC
I don't have such a crash with the 5.2.6 Linux appimage or the just downloaded installed 5.2.6 on Windows 10.
Could it be just a Windows 11 problem?
Comment 3 Freya Lupen 2024-10-04 18:29:58 UTC
Looking into the cause, it seems that when using the Text Tool or Select->Convert to Shape to create a new layer at the top of the stack (when the selected layer is not a Vector Layer), it gets created above the hidden "Reference images" layer. Krita then crashes attempting to merge this Vector Layer onto the "Reference images" layer.

I wonder if those methods creating the layer at the top of the stack instead of above the selected layer is itself a bug.
Comment 4 Ahab Greybeard 2024-10-04 19:32:54 UTC
I initially added a new a vector layer then used the text tool on it.,
If I use the text tool on a paint layer, it creates a vector layer for the text at the top of the layer stack then I do get a close down crash when doing the Merge down with the 5.2.6 appimage.

If I drag the text/vector layer down to a lower level in a multi-layer document, the Merge down works and there is no crash.