Bug 443902 - Crash on pressing "Create" in File -> New in Clipboard tab when the clipboard is empty
Summary: Crash on pressing "Create" in File -> New in Clipboard tab when the clipboard...
Status: RESOLVED DUPLICATE of bug 443111
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: git master (please specify the git hash!)
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-17 19:06 UTC by Tiar
Modified: 2021-10-21 14:45 UTC (History)
2 users (show)

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


Attachments
Whole crashlog (7.48 KB, text/plain)
2021-10-17 19:06 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2021-10-17 19:06:51 UTC
Created attachment 142536 [details]
Whole crashlog

SUMMARY
Most probably Krita remembered that last time I used File -> New -> From Clipboard tab, so it used this one again. I pressed "Create" without looking. Krita crashed because there was nothing in the clipboard.


STEPS TO REPRODUCE (at least what I imagine them to be, I haven't checked, sorry)
1. I guess maybe copy an image first
2. Use File -> New -> From Clipboard
3. Copy some text or something not image-like
4. Try File -> New -> From Clipboard again

OBSERVED RESULT
Crash

EXPECTED RESULT
Not crash, it shouldn't allow me to do anything

SOFTWARE/OS VERSIONS
Krita

 Version: 5.1.0-prealpha (git ae9a8ff)
 Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.11.1
  Version (loaded): 5.11.1


CRASH LOG
Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
KisView::image (this=this@entry=0x0) at /home/tymon/kritadev/krita/libs/ui/KisView.cpp:440
440	    if (d->document) {
(gdb) bt
#0  0x00007ffff7c98d88 in KisView::image() const (this=this@entry=0x0) at /home/tymon/kritadev/krita/libs/ui/KisView.cpp:440
#1  0x00007ffff7b66d00 in KisClipboardUtil::clipboardHasUrlsAction(KisView*, QMimeData const*) (kisview=0x0, data=<optimized out>) at /home/tymon/kritadev/krita/libs/ui/utils/KisClipboardUtil.cpp:82
#2  0x00007ffff7894e72 in KisClipboard::clip(QRect const&, bool, KisTimeSpan*, KoColorProfile const*) (this=<optimized out>, imageBounds=..., showPopup=<optimized out>, clipRange=<optimized out>, destProfile=0x0)
    at /home/tymon/kritadev/krita/libs/ui/kis_clipboard.cc:272
#3  0x00007ffff7a9f5f0 in KisImageFromClipboard::createImage() (this=0x555565a78940) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qrect.h:60
#4  0x00007ffff5bc06db in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff663c7a2 in QAbstractButton::clicked(bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x00007ffff663c9ba in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00007ffff663dd7f in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007ffff663df55 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007ffff65947d8 in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007ffff65564a1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff655dd28 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007ffff7c33a57 in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x55555c627090, event=0x7fffffffc370) at /home/tymon/kritadev/krita/libs/ui/KisApplication.cpp:687
#13 0x00007ffff5b97499 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff655d029 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
Comment 1 Tiar 2021-10-17 19:44:02 UTC
Marking as regression because I'm fairly sure at some point it disabled the button `Create` so the crash didn't happen.
Comment 2 tomtomtomreportingin 2021-10-18 00:33:28 UTC
I don't recall the button ever being disabled if the clipboard is empty. In beta 2 it just creates an empty document if there's nothing in the clipboard.
Comment 3 Halla Rempt 2021-10-18 08:45:49 UTC
In master you also just get a blank image, so I cannot reproduce this. I checked with 4.4.3, which also didn't crash and created a blank image, and which did not disabled the page either.
Comment 4 Tiar 2021-10-21 14:45:09 UTC
This is not exactly a duplicate but it was fixed by a fix attributed to that other bug report, so it should be resolved now.

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