Bug 501560 - [Safe Assert] Copy Krita's Content from Its Own Canvas and Paste Cause A Safe Assert Warning or Freeze (5.3.0-be5a553909)
Summary: [Safe Assert] Copy Krita's Content from Its Own Canvas and Paste Cause A Safe...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-16 03:05 UTC by Protoniv
Modified: 2025-03-28 10:32 UTC (History)
0 users

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


Attachments
gdb output from terminal (26.39 KB, text/plain)
2025-03-16 03:05 UTC, Protoniv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Protoniv 2025-03-16 03:05:46 UTC
Created attachment 179442 [details]
gdb output from terminal

SUMMARY

Copy content from a layer and paste, a safe assert warning appears:
```
Krita has encountered an internal error:
SAFE ASSERT (krita): "mimedata" in file /builds/graphics/krita/libs/ui/kis_clipboard.cc, line 320
Please report a bug to developers!
Press Ignore to try to continue.
Press Abort to see developers information (all unsaved data will be lost)
```
Ignore it will not crash or freeze, but after repeating 2 or 3 times (copy -> paste -> ignore warning), krita will freeze.

krita-5.3.0-prealpha-be5a553909-x86_64.appimage (debug build)


STEPS TO REPRODUCE
1. New file, draw something on canvas, and press keyboard Ctrl+C, then Ctrl+V
2. Safe Assert Warning appears
3. Ignore, Ctrl+C, Ctrl+V, Ignore...repeat
4. Krita freeze

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20250313
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.6-1-default (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2025-03-28 10:32:46 UTC
Git commit 70ef3defac6ef3875e8be74d3956080a281a0666 by Halla Rempt.
Committed on 28/03/2025 at 10:32.
Pushed by rempt into branch 'master'.

Replace faulty assert with conditional return

Not having mimedata here is not a coding error or something that
should be fixed when it happens, it's a normal thing to happen
with clipboards.

M  +2    -2    libs/ui/kis_clipboard.cc

https://invent.kde.org/graphics/krita/-/commit/70ef3defac6ef3875e8be74d3956080a281a0666