Bug 433305 - Krita crashes when performing a copy of empty layers or groups
Summary: Krita crashes when performing a copy of empty layers or groups
Status: RESOLVED DUPLICATE of bug 431865
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 4.4.2
Platform: Manjaro Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-20 09:02 UTC by Udopus
Modified: 2021-02-20 10:19 UTC (History)
1 user (show)

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


Attachments
GDB backtrace "thread apply all bt full" (Please let me know if this is correct method or not) (44.06 KB, text/x-log)
2021-02-20 09:02 UTC, Udopus
Details
GDB backtrace "thread apply all bt" (30.80 KB, text/x-log)
2021-02-20 09:03 UTC, Udopus
Details
Terminal output of command up until failure (5.72 KB, text/x-log)
2021-02-20 09:05 UTC, Udopus
Details
Krita's System Information Tab (2.40 KB, text/plain)
2021-02-20 09:06 UTC, Udopus
Details
Krita's log containing many instances of deliberate empty copy crashes (5.71 KB, text/x-log)
2021-02-20 09:16 UTC, Udopus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Udopus 2021-02-20 09:02:37 UTC
Created attachment 135946 [details]
GDB backtrace "thread apply all bt full" (Please let me know if this is correct method or not)

SUMMARY
Since update to Krita 4.4.2 on my Manjaro Linux (KDE Plasma 5.20.5) machine, I get an immediate, non-graceful segmentation fault every time I perform copy operation on the following:
A.) 100% empty layers 
B.) Groups which have all content within it either empty or have the visibility attribute set to false. 

In other words: as long as the component being copied in the Layers menu has an empty thumbnail, copying it will cause Krita to crash. Interestingly, a non-empty layer with its visibility attribute toggled off still has a thumbnail, and does NOT cause a crash. Groups appear to be subtly different in that they evaluate their thumbnail based on the layers/subgroups within them. 

After consistently reproducing this issue, I down-graded Krita back down to 4.4.1, and I do not encounter this issue. I promptly built Krita 4.4.2-2 from source with debug symbols enabled and recorded some GDB backtraces of the event which I will attach here. I will also attach some logs of console output + additional system information promptly.

Scenarios that crash (that I have observed so far):
1. Copy an empty layer (Layer with alpha channel, with nothing drawn on it).
2. Copy an empty group (With no contents at all).
3. Copy an occupied group, with all layers/groups within it being empty or non-visible.

STEPS TO REPRODUCE
1. New Document
2. Attempt to "Control-C" or "Edit > Copy" on the first selected empty layer.
3. Observe immediate Segmentation Fault and exit.

OBSERVED RESULT
Krita crashes and closes silently.

EXPECTED RESULT
I would expect the behavior of the previous versions, which I believe was:
1. Copies of actual nothingness are handled gracefully, preferably ignored.
2. Copies of empty layers copy the empty layer as is.
3. Copies of groups with non-visible/empty sub-components get copied recursively and retain underlying structure + attributes.

SOFTWARE/OS VERSIONS
Windows: Not tested
macOS: Not Tested
Linux/KDE Plasma: 5.9.16-1-MANJARO #1 SMP PREEMPT Mon Dec 21 22:00:46 UTC 2020 x86_64 GNU/Linux
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
- Breaking Version: 4.4.2 (git 97238e2)
- Last Stable Version: 4.4.1-7
- All versions listed above were installed from the Arch User Repository (AUR): https://archlinux.org/packages/extra/x86_64/krita/
- Breaks on Cut (Control-X) as well
Comment 1 Udopus 2021-02-20 09:03:50 UTC
Created attachment 135947 [details]
GDB backtrace "thread apply all bt"
Comment 2 Udopus 2021-02-20 09:05:10 UTC
Created attachment 135948 [details]
Terminal output of command up until failure
Comment 3 Udopus 2021-02-20 09:06:04 UTC
Created attachment 135949 [details]
Krita's System Information Tab
Comment 4 Udopus 2021-02-20 09:16:36 UTC
Created attachment 135950 [details]
Krita's log containing many instances of deliberate empty copy crashes
Comment 5 Halla Rempt 2021-02-20 10:19:49 UTC

*** This bug has been marked as a duplicate of bug 431865 ***