Bug 463113 - Pasting as reference when plain text is in the clipboard causes a crash
Summary: Pasting as reference when plain text is in the clipboard causes a crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Reference Images (show other bugs)
Version: 5.1.4
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 463858 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-12-16 12:52 UTC by paleh
Modified: 2023-01-23 13:19 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paleh 2022-12-16 12:52:52 UTC
SUMMARY

STEPS TO REPRODUCE
1. Copy some plain text into the clipboard, e.g. "123"
2. In Krita switch to reference tool, right click and paste (or press Ctrl+Shift+R)

OBSERVED RESULT
Krita crashes

EXPECTED RESULT
Pasting a non-image has no effect and Krita doesn't crash

SOFTWARE/OS VERSIONS
Linux: Ubuntu 22.04.1 LTS 
Qt Version: 5.12.12

ADDITIONAL INFORMATION
-The issue exists in 5.1.3 as well
-I discovered it when I was working with selections holding my fingers ready to click Ctrl+Shift+A (deselect) and Ctrl+R (rect. selection tool) and accidentally pressed Ctrl+Shift+R, so, despite the nonsensical nature of pasting text as reference, other users are somewhat likely to encounter this crash too
-The last line of the bug report is:

ASSERT (krita): "!qimage.isNull()" in file /home/appimage/workspace/Krita_Release_Appimage_Build/krita/libs/ui/kis_clipboard.cc, line 460
Comment 1 Raghavendra kamath 2022-12-16 14:14:57 UTC
I can confirm this on Fedora 37 with latest nightly build.
I encountered it day before yesterday when I was pasting an image as reference with the short-cut, but I didn't understand what happened now I know why it crashed I was also copy pasting lot of text at the time
Comment 2 paleh 2023-01-05 01:25:07 UTC
This could potentially be related to https://bugs.kde.org/show_bug.cgi?id=463858
Comment 3 Halla Rempt 2023-01-05 09:52:32 UTC
*** Bug 463858 has been marked as a duplicate of this bug. ***
Comment 4 Halla Rempt 2023-01-05 10:20:00 UTC
I cannot reproduce this with my own build from master or with the appimage. It looks like these distributions build Qt and Krita with asserts enabled, which, of course, should never be done for production builds.
Comment 5 Halla Rempt 2023-01-06 11:28:42 UTC
5.15 TEST
Comment 6 wolthera 2023-01-11 20:37:40 UTC
I cannot reproduce either with the Krita Version: 5.2.0-prealpha (git 5c98a72) Appimage with Qt 5.15.7, nor my local KDE Neon based dev build, so I am afraid Halla's correct. Not sure what we can do here...
Comment 7 vanyossi 2023-01-13 02:21:55 UTC
I cannot reproduce this bug in 5.1.5 or 5.2.0-prealpha (git c96fb969f8)

Qt
  Version (compiled): 5.15.7
  Version (loaded): 5.15.7
Comment 8 Dmitry Kazakov 2023-01-23 13:19:35 UTC
I think the bug got fixed in the meantime. I also cannot reproduce it neither on Windows, nor on Linux :)