Bug 293987 - Clicking "Delete" key while using the perspective assistant crashed Krita
Summary: Clicking "Delete" key while using the perspective assistant crashed Krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Chakra Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-13 11:46 UTC by Kubuntiac
Modified: 2019-03-19 15:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kubuntiac 2012-02-13 11:46:43 UTC
Application: krita (2.4 Beta 7)
KDE Platform Version: 4.8.00 (4.8.0
Qt Version: 4.8.0
Operating System: Linux 3.2-CHAKRA x86_64
Distribution: "Chakra Linux"

-- Information about the crash:
I was using the perspective assistant tool, in the "Perspective" mode. I'd drawn the first corner in the wrong place and wanted to cancel before drawing the second. I pushed the "Delete" key and Krita crashed.

The crash can be reproduced some of the time.

-- Backtrace:
Application: Krita (kdeinit4), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f51249a7760 (LWP 31070))]

Thread 10 (Thread 0x7f50ffac0700 (LWP 31071)):
#0  0x00007f5123214b54 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f51234a212b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f512349df64 in QSemaphore::acquire(int) () from /usr/lib/libQtCore.so.4
#3  0x00007f510f7bc27e in KisTileDataPooler::waitForWork (this=0xda6f90) at /home/user/Apps/calligra/calligra-src/krita/image/tiles3/kis_tile_data_pooler.cc:162
#4  0x00007f510f7bc964 in KisTileDataPooler::run (this=0xda6f90) at /home/user/Apps/calligra/calligra-src/krita/image/tiles3/kis_tile_data_pooler.cc:184
#5  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#6  0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#7  0x00007f5121f8a39d in clone () from /lib/libc.so.6
#8  0x0000000000000000 in ?? ()

Thread 9 (Thread 0x7f50ff2bf700 (LWP 31072)):
#0  0x00007f5123214ecb in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f51234a08d8 in ?? () from /usr/lib/libQtCore.so.4
#2  0x00007f51234a10c0 in QThread::msleep(unsigned long) () from /usr/lib/libQtCore.so.4
#3  0x00007f510f7dd51a in KisTileDataSwapper::run (this=0xda6fc8) at /home/user/Apps/calligra/calligra-src/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:97
#4  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#5  0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#6  0x00007f5121f8a39d in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7f50f4f9f700 (LWP 31081)):
#0  0x00007f5121f96ee2 in ?? () from /lib/libc.so.6
#1  0x00007f5121f841c5 in select () from /lib/libc.so.6
#2  0x00007f51235cbe96 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib/libQtCore.so.4
#3  0x00007f51235d131d in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /usr/lib/libQtCore.so.4
#4  0x00007f51235d1803 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f512359ee22 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f512359f077 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0x00007f512349ebf7 in QThread::exec() () from /usr/lib/libQtCore.so.4
#8  0x00007f512357ec9f in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#11 0x00007f5121f8a39d in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7f50ed725700 (LWP 31105)):
#0  0x00007f5123214b54 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f51234a212b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f5122c14bf4 in ?? () from /usr/lib/libQtGui.so.4
#3  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f5121f8a39d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f50edf26700 (LWP 31106)):
#0  0x00007f5121f96eef in ?? () from /lib/libc.so.6
#1  0x00007f5121f841c5 in select () from /lib/libc.so.6
#2  0x00007f51235cbe96 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib/libQtCore.so.4
#3  0x00007f51235d131d in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /usr/lib/libQtCore.so.4
#4  0x00007f51235d1803 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f512359ee22 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f512359f077 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0x00007f512349ebf7 in QThread::exec() () from /usr/lib/libQtCore.so.4
#8  0x00007f512357ec9f in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#11 0x00007f5121f8a39d in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f50ecf24700 (LWP 32677)):
#0  0x00007f5123214b54 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f51234a212b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f5122c14bf4 in ?? () from /usr/lib/libQtGui.so.4
#3  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f5121f8a39d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f50e6249700 (LWP 32678)):
#0  0x00007f5121f841d3 in select () from /lib/libc.so.6
#1  0x00007f51235cbe96 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib/libQtCore.so.4
#2  0x00007f51235d131d in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /usr/lib/libQtCore.so.4
#3  0x00007f51235d1803 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f512359ee22 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f512359f077 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f512349ebf7 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f512357ec9f in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#10 0x00007f5121f8a39d in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f50e12f9700 (LWP 6216)):
#0  0x00007f5123214b54 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f51234a212b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f5122c14bf4 in ?? () from /usr/lib/libQtGui.so.4
#3  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f5121f8a39d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f50e0af8700 (LWP 6217)):
#0  0x00007f5121f841d3 in select () from /lib/libc.so.6
#1  0x00007f51235cbe96 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib/libQtCore.so.4
#2  0x00007f51235d131d in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /usr/lib/libQtCore.so.4
#3  0x00007f51235d1803 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f512359ee22 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f512359f077 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f512349ebf7 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f512357ec9f in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f51234a1c1b in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f5123210df0 in start_thread () from /lib/libpthread.so.0
#10 0x00007f5121f8a39d in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f51249a7760 (LWP 31070)):
[KCrash Handler]
#6  multiply (b=0 '\000', a=) at /home/user/Apps/calligra/calligra-src/libs/pigment/KoColorSpaceMaths.h:451
#7  applyInverseAlphaU8Mask (nPixels=<optimized out>, alpha=0x7f50d16a1e80 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., pixels=0x7f5101202560 <Address 0x7f5101202560 out of bounds>) at /home/user/Apps/calligra/calligra-src/libs/pigment/KoColorSpaceTraits.h:178
#8  KoColorSpaceAbstract<KoRgbU8Traits>::applyInverseAlphaU8Mask (this=<optimized out>, pixels=<optimized out>, alpha=<optimized out>, nPixels=<optimized out>) at /home/user/Apps/calligra/calligra-src/libs/pigment/KoColorSpaceAbstract.h:130
#9  0x00007f510f87d96c in KisPaintDevice::clearSelection (this=0x8b792b0, selection=<optimized out>) at /home/user/Apps/calligra/calligra-src/krita/image/kis_paint_device.cc:986
#10 0x00007f510fdc030b in KisTool::deleteSelection (this=0x3b5fc00) at /home/user/Apps/calligra/calligra-src/krita/ui/tool/kis_tool.cc:569
#11 0x00007f510fd5a101 in KisSelectionManager::clear (this=0x33d0760) at /home/user/Apps/calligra/calligra-src/krita/ui/kis_selection_manager.cc:545
#12 0x00007f51235b3dc1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#13 0x00007f512270a272 in QAction::triggered(bool) () from /usr/lib/libQtGui.so.4
#14 0x00007f512270a45f in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQtGui.so.4
#15 0x00007f512270a5cf in QAction::event(QEvent*) () from /usr/lib/libQtGui.so.4
#16 0x00007f512429f8ea in KAction::event(QEvent*) () from /usr/lib/libkdeui.so.5
#17 0x00007f5122710724 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0x00007f51227155a3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x00007f51243874f6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#20 0x00007f51235a003c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#21 0x00007f5122742559 in ?? () from /usr/lib/libQtGui.so.4
#22 0x00007f5122743a4d in ?? () from /usr/lib/libQtGui.so.4
#23 0x00007f51227171d9 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#24 0x00007f51243874f6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#25 0x00007f51235a003c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#26 0x00007f51227af839 in ?? () from /usr/lib/libQtGui.so.4
#27 0x00007f51227afc7b in ?? () from /usr/lib/libQtGui.so.4
#28 0x00007f512278c1c4 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#29 0x00007f51227b463a in ?? () from /usr/lib/libQtGui.so.4
#30 0x00007f512359ee22 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#31 0x00007f512359f077 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#32 0x00007f51235a3bd5 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#33 0x00007f511028c71d in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/user/Apps/calligra/calligra-src/krita/main.cc:72
#34 0x00000000004087df in _start ()

Reported using DrKonqi
Comment 1 Sven Langkamp 2012-02-15 00:28:17 UTC
Can't reproduce here. Looks like it's not related to the perspective tool. Can you try to simply select something and delete that?
Comment 2 Kubuntiac 2012-02-15 03:54:49 UTC
I can select both shapes and areas of paint layers and delete them with the del key without crashing. I can't seem to replicate this either (with the perspective assistant), so not too sure what to do about it.
Comment 3 Dmitry Kazakov 2012-02-25 06:28:07 UTC
I cannot reproduce it either
Comment 4 Halla Rempt 2012-02-29 10:56:47 UTC
It looks to me as if selectedExactRect was wrong for some reason...
Comment 5 Halla Rempt 2012-05-07 13:16:36 UTC
I think I'll have to close this bug. There's no doubt something weird happens here, but the only thing I can think of is to intersect the selection's rect with the device's rect in KisPaintDevice::clearSelection:

diff --git a/krita/image/kis_paint_device.cc b/krita/image/kis_paint_device.cc
index cf597fd..607b687 100644
--- a/krita/image/kis_paint_device.cc
+++ b/krita/image/kis_paint_device.cc
@@ -855,7 +855,7 @@ KisRandomSubAccessorSP KisPaintDevice::createRandomSubAccessor() const
 
 void KisPaintDevice::clearSelection(KisSelectionSP selection)
 {
-    QRect r = selection->selectedExactRect();
+    QRect r = selection->selectedExactRect() & m_d->defaultBounds->bounds();
 
     if (r.isValid()) {
 
lines 1-13/13 (END)
Comment 6 Halla Rempt 2012-05-08 08:27:49 UTC
Git commit 009df0ec78ccddb6a11272833316d53a4b01e9ff by Boudewijn Rempt.
Committed on 07/05/2012 at 15:30.
Pushed by rempt into branch 'master'.

Only clear pixels inside a paint device

On clearing pixels, only clear the pixels that actually have content, so
use the paint device's default bounds object to get the intersection
between the selection and the paint device.

M  +1    -1    krita/image/kis_paint_device.cc

http://commits.kde.org/calligra/009df0ec78ccddb6a11272833316d53a4b01e9ff
Comment 7 Dmitry Kazakov 2019-03-19 15:02:16 UTC
Git commit 823e916c2e6cc424658fe891f203e7584d05b751 by Dmitry Kazakov.
Committed on 19/03/2019 at 15:01.
Pushed by dkazakov into branch 'master'.

Recover clearing of selection that is placed outside canvas

For some reason it was disable when fixing assistant tools, but
I don't see how it could be related.

M  +1    -1    libs/image/kis_paint_device.cc

https://commits.kde.org/krita/823e916c2e6cc424658fe891f203e7584d05b751