Bug 315476

Summary: Krita crashes after using selection tool and then clicking outside the image area
Product: [Applications] krita Reporter: svenssonsven8
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: halla, sven.langkamp
Priority: NOR    
Version: 2.6.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Video of Krita crashing after a selection and a click outside of selection

Description svenssonsven8 2013-02-19 21:22:29 UTC
Application: krita (2.6.0)
KDE Platform Version: 4.10.00
Qt Version: 4.8.3
Operating System: Linux 3.5.0-23-generic x86_64
Distribution: Ubuntu 12.10

-- Information about the crash:
- What I was doing when the application crashed:

I opened an image in Krita and wanted to select a rectangle area from it and cut and paste it into a new image. I used a rectangular selection tool for the selection. After having selected the area, I wasn't satisfied and wanted to try again. To do this, I clicked outside the image (into the gray layer area) to deselect the selection. As soon as I did this, Krita crashed with the error I am reporting. This is the second time in last 3 days I am experiencing the same error.

-- Backtrace:
Application: Krita (krita), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f79abdc67c0 (LWP 29810))]

Thread 7 (Thread 0x7f798abb7700 (LWP 29811)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f79a924b04b in wait (time=18446744073709551615, this=0x217c1b0) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x217c160, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f79a9246f67 in QSemaphore::acquire (this=0x217beb0, n=1) at thread/qsemaphore.cpp:144
#4  0x00007f7992bcc55e in ?? () from /usr/lib/libkritaimage.so.11
#5  0x00007f7992bcccab in ?? () from /usr/lib/libkritaimage.so.11
#6  0x00007f79a924aaec in QThreadPrivate::start (arg=0x217bea0) at thread/qthread_unix.cpp:338
#7  0x00007f799e2fa2e4 in ?? () from /usr/lib/nvidia-experimental-310/libGL.so.1
#8  0x00007f79a4380e9a in start_thread (arg=0x7f798abb7700) at pthread_create.c:308
#9  0x00007f79ab318cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f798a3b6700 (LWP 29812)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f79a924b04b in wait (time=18446744073709551615, this=0x217c540) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x217c4f0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f79a9247338 in QSemaphore::tryAcquire (this=0x217c220, n=1, timeout=<optimized out>) at thread/qsemaphore.cpp:221
#4  0x00007f7992bea34a in KisTileDataSwapper::run() () from /usr/lib/libkritaimage.so.11
#5  0x00007f79a924aaec in QThreadPrivate::start (arg=0x217bed8) at thread/qthread_unix.cpp:338
#6  0x00007f799e2fa2e4 in ?? () from /usr/lib/nvidia-experimental-310/libGL.so.1
#7  0x00007f79a4380e9a in start_thread (arg=0x7f798a3b6700) at pthread_create.c:308
#8  0x00007f79ab318cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f79772fa700 (LWP 29817)):
#0  0x00007f79ab312023 in select () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f79a9373023 in qt_safe_select (nfds=31, fdread=0x7f796c000af8, fdwrite=0x7f796c000d90, fdexcept=0x7f796c001028, orig_timeout=0x0) at kernel/qcore_unix.cpp:83
#2  0x00007f79a93779e4 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x7f796c000940, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:223
#3  0x00007f79a9378572 in QEventDispatcherUNIX::processEvents (this=0x7f796c000920, flags=...) at kernel/qeventdispatcher_unix.cpp:926
#4  0x00007f79a93462bf in QEventLoop::processEvents (this=this@entry=0x7f79772f9cd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f79a9346548 in QEventLoop::exec (this=0x7f79772f9cd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f79a9247b10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f79a93269af in QInotifyFileSystemWatcherEngine::run (this=0x2606a10) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f79a924aaec in QThreadPrivate::start (arg=0x2606a10) at thread/qthread_unix.cpp:338
#9  0x00007f799e2fa2e4 in ?? () from /usr/lib/nvidia-experimental-310/libGL.so.1
#10 0x00007f79a4380e9a in start_thread (arg=0x7f79772fa700) at pthread_create.c:308
#11 0x00007f79ab318cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f7975ab1700 (LWP 29823)):
#0  0x00007f79ab312023 in select () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f79a9373023 in qt_safe_select (nfds=38, fdread=0x7f7960000af8, fdwrite=0x7f7960000d90, fdexcept=0x7f7960001028, orig_timeout=0x0) at kernel/qcore_unix.cpp:83
#2  0x00007f79a93779e4 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x7f7960000940, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:223
#3  0x00007f79a9378572 in QEventDispatcherUNIX::processEvents (this=0x7f7960000920, flags=...) at kernel/qeventdispatcher_unix.cpp:926
#4  0x00007f79a93462bf in QEventLoop::processEvents (this=this@entry=0x7f7975ab0cd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f79a9346548 in QEventLoop::exec (this=0x7f7975ab0cd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f79a9247b10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f79a93269af in QInotifyFileSystemWatcherEngine::run (this=0x259aa10) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f79a924aaec in QThreadPrivate::start (arg=0x259aa10) at thread/qthread_unix.cpp:338
#9  0x00007f799e2fa2e4 in ?? () from /usr/lib/nvidia-experimental-310/libGL.so.1
#10 0x00007f79a4380e9a in start_thread (arg=0x7f7975ab1700) at pthread_create.c:308
#11 0x00007f79ab318cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f79782fc700 (LWP 29835)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f79a924b04b in wait (time=18446744073709551615, this=0x4176580) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x4176100, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f79aa218f16 in QFileInfoGatherer::run (this=0x41760f0) at dialogs/qfileinfogatherer.cpp:214
#4  0x00007f79a924aaec in QThreadPrivate::start (arg=0x41760f0) at thread/qthread_unix.cpp:338
#5  0x00007f799e2fa2e4 in ?? () from /usr/lib/nvidia-experimental-310/libGL.so.1
#6  0x00007f79a4380e9a in start_thread (arg=0x7f79782fc700) at pthread_create.c:308
#7  0x00007f79ab318cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f7989565700 (LWP 29836)):
#0  0x00007f79ab312023 in select () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f79a9373023 in qt_safe_select (nfds=25, fdread=0x7f7968000af8, fdwrite=0x7f7968000d90, fdexcept=0x7f7968001028, orig_timeout=0x0) at kernel/qcore_unix.cpp:83
#2  0x00007f79a93779e4 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x7f7968000940, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:223
#3  0x00007f79a9378572 in QEventDispatcherUNIX::processEvents (this=0x7f7968000920, flags=...) at kernel/qeventdispatcher_unix.cpp:926
#4  0x00007f79a93462bf in QEventLoop::processEvents (this=this@entry=0x7f7989564cd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f79a9346548 in QEventLoop::exec (this=0x7f7989564cd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f79a9247b10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f79a93269af in QInotifyFileSystemWatcherEngine::run (this=0x4176680) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f79a924aaec in QThreadPrivate::start (arg=0x4176680) at thread/qthread_unix.cpp:338
#9  0x00007f799e2fa2e4 in ?? () from /usr/lib/nvidia-experimental-310/libGL.so.1
#10 0x00007f79a4380e9a in start_thread (arg=0x7f7989565700) at pthread_create.c:308
#11 0x00007f79ab318cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f79abdc67c0 (LWP 29810)):
[KCrash Handler]
#6  0x00007f79a6f1150e in KoProperties::contains(QString const&) const () from /usr/lib/libkoodf.so.11
#7  0x00007f7992c22cf6 in KisBaseNode::check(KoProperties const&) const () from /usr/lib/libkritaimage.so.11
#8  0x00007f7992c7b3af in KisNode::childNodes(QStringList const&, KoProperties const&) const () from /usr/lib/libkritaimage.so.11
#9  0x00007f7992c6e064 in KisLayer::selectionMask() const () from /usr/lib/libkritaimage.so.11
#10 0x00007f7992c5e21c in KisImage::globalSelection() const () from /usr/lib/libkritaimage.so.11
#11 0x00007f7992c6bd0c in KisLayer::selection() const () from /usr/lib/libkritaimage.so.11
#12 0x00007f799309a0b0 in KisCanvas2::shapeManager() const () from /usr/lib/libkritaui.so.11
#13 0x00007f79930c8703 in KisNodeShape::editabilityChanged() () from /usr/lib/libkritaui.so.11
#14 0x00007f79a935cf5f in QMetaObject::activate (sender=0x2c0f9f0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff80276250) at kernel/qobject.cpp:3547
#15 0x00007f7992c23542 in KisBaseNode::systemLockingChanged(bool) () from /usr/lib/libkritaimage.so.11
#16 0x00007f7992c23631 in KisBaseNode::setSystemLocked(bool, bool) () from /usr/lib/libkritaimage.so.11
#17 0x00007f797a4c971d in ?? () from /usr/lib/kde4/kritaselectiontools.so
#18 0x00007f79931f5854 in KisToolRectangleBase::mouseReleaseEvent(KoPointerEvent*) () from /usr/lib/libkritaui.so.11
#19 0x00007f79a71f4840 in KoToolProxy::mouseReleaseEvent(QMouseEvent*, QPointF const&) () from /usr/lib/libflake.so.11
#20 0x00007f799322f671 in ?? () from /usr/lib/libkritaui.so.11
#21 0x00007f7993234045 in KisShortcutMatcher::tryEndRunningShortcut(Qt::MouseButton, QMouseEvent*) () from /usr/lib/libkritaui.so.11
#22 0x00007f79932349b0 in KisShortcutMatcher::buttonReleased(Qt::MouseButton, QMouseEvent*) () from /usr/lib/libkritaui.so.11
#23 0x00007f799322c5ab in ?? () from /usr/lib/libkritaui.so.11
#24 0x00007f79a93476d6 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x43f6680, event=0x7fff80276bd0) at kernel/qcoreapplication.cpp:1025
#25 0x00007f79a9d28e6c in QApplicationPrivate::notify_helper (this=this@entry=0x184de10, receiver=receiver@entry=0x43f6680, e=e@entry=0x7fff80276bd0) at kernel/qapplication.cpp:4558
#26 0x00007f79a9d2db6b in QApplication::notify (this=<optimized out>, receiver=0x43f6680, e=0x7fff80276bd0) at kernel/qapplication.cpp:4105
#27 0x00007f79aaec2ba8 in KoApplication::notify(QObject*, QEvent*) () from /usr/lib/libkomain.so.11
#28 0x00007f79a934756e in QCoreApplication::notifyInternal (this=0x7fff80277680, receiver=0x43f6680, event=0x7fff80276bd0) at kernel/qcoreapplication.cpp:915
#29 0x00007f79a9d29cd3 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#30 QApplicationPrivate::sendMouseEvent (receiver=0x43f6680, event=0x7fff80276bd0, alienWidget=0x43f6680, nativeWidget=0x43ccc10, buttonDown=0x7f79aa805308 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3173
#31 0x00007f79a9da7554 in QETWidget::translateMouseEvent (this=this@entry=0x43ccc10, event=event@entry=0x7fff80277360) at kernel/qapplication_x11.cpp:4622
#32 0x00007f79a9da644f in QApplication::x11ProcessEvent (this=0x7fff80277680, event=0x7fff80277360) at kernel/qapplication_x11.cpp:3737
#33 0x00007f79a9dce9d9 in QEventDispatcherX11::processEvents (this=0x1783450, flags=...) at kernel/qeventdispatcher_x11.cpp:132
#34 0x00007f79a93462bf in QEventLoop::processEvents (this=this@entry=0x7fff802775d0, flags=...) at kernel/qeventloop.cpp:149
#35 0x00007f79a9346548 in QEventLoop::exec (this=0x7fff802775d0, flags=...) at kernel/qeventloop.cpp:204
#36 0x00007f79a934b708 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#37 0x00007f79ab7ca2f2 in kdemain () from /usr/lib/kde4/libkdeinit/libkdeinit4_krita.so
#38 0x00007f79ab24676d in __libc_start_main (main=0x400690, argc=1, ubp_av=0x7fff80277798, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff80277788) at libc-start.c:226
#39 0x00000000004006c1 in _start ()

Possible duplicates by query: bug 310554.

Reported using DrKonqi
Comment 1 Sven Langkamp 2013-02-22 11:31:30 UTC
Thanks for the report. Can you reproduce this bug or did it happen just once?
Comment 2 svenssonsven8 2013-02-22 12:27:46 UTC
(In reply to comment #1)
> Thanks for the report. Can you reproduce this bug or did it happen just once?

Hi! So far it has happened twice. I am unable to find an exact path that always produces the error, but those two times it happened, I was always clicking outside of the image in order to deselect the previous selection.

However, the few other times I did exactly the same, it didn't crash. I will try a bit harder tonight in order to find a more reliable method to reproduce the error.

Thanks.
Comment 3 svenssonsven8 2013-02-22 15:59:17 UTC
I think I managed to find a way to (somewhat) reliably reproduce the issue:

1. Launch Krita
2. Load an image (File->Open; I have used various images, all jpeg:s)
3. Choose "Select a rectangular area" tool from the Tools panel on the left
4. Select a rectangular image area 
5. Click somewhere on the image in order to deselect selection (I usually click outside the selection)
6. Repeat step 4-5 above a few times (for me it usually takes 2-3 fast repeats)
7. Krita eventually crashes
Comment 4 svenssonsven8 2013-03-07 16:03:09 UTC
I can still reproduce the bug on KDE 4.10.1 and Krita 2.6.1 by following the steps I outlined in comment #3.
Comment 5 Halla Rempt 2013-03-07 16:15:16 UTC
I haven't yet been able to reproduce :-(
Comment 6 Sven Langkamp 2013-03-07 21:44:30 UTC
I can't reproduce it either. Can you maybe make a video?
Comment 7 svenssonsven8 2013-03-08 07:39:32 UTC
Sven, I will try to make a video tonight when I am at home, I will do that.
Comment 8 svenssonsven8 2013-03-08 11:18:43 UTC
What kind of desktop recording software would you recommend? Also, what is the preferred video format I should save the recording into?
Comment 9 svenssonsven8 2013-03-10 07:23:49 UTC
Created attachment 77908 [details]
Video of Krita crashing after a selection and a click outside of selection
Comment 10 Halla Rempt 2013-03-10 13:38:56 UTC
Thanks for the video... I'm still not sure what is going on though! The crash is really weird :-(. Could you perhaps install the debug packages for Qt, Calligra and Krita and try to get a more detailed stacktrace? Thanks!
Comment 11 Halla Rempt 2013-03-10 14:26:02 UTC
Ha! With the image from bug https://bugs.kde.org/show_bug.cgi?id=316466 we can reproduce! Working on a fix now!
Comment 12 Halla Rempt 2013-03-10 14:38:21 UTC
Git commit 6e866e189ffa40d46360cd7b07f97af1690e1986 by Boudewijn Rempt.
Committed on 10/03/2013 at 15:35.
Pushed by rempt into branch 'master'.

Don't try to add or remove an empty selection
Related: bug 316466

M  +7    -1    krita/image/kis_pixel_selection.cpp

http://commits.kde.org/calligra/6e866e189ffa40d46360cd7b07f97af1690e1986
Comment 13 Sven Langkamp 2013-03-10 14:55:01 UTC
Git commit c44a679961d441a543e240b13b5fd875e41d1da4 by Sven Langkamp.
Committed on 10/03/2013 at 15:52.
Pushed by langkamp into branch 'master'.

deselect when selecting an empty selection
Related: bug 316466

M  +5    -0    krita/ui/tool/kis_selection_tool_helper.cpp

http://commits.kde.org/calligra/c44a679961d441a543e240b13b5fd875e41d1da4
Comment 14 svenssonsven8 2013-03-10 15:20:08 UTC
Great to hear! Thank you very much! :)
Comment 15 Halla Rempt 2013-03-26 10:45:55 UTC
Git commit 665bd4f2735899c7b465694910e069fb3997f718 by Boudewijn Rempt, on behalf of Sven Langkamp.
Committed on 10/03/2013 at 15:52.
Pushed by rempt into branch 'calligra/2.6'.

deselect when selecting an empty selection
Related: bug 316466

M  +5    -0    krita/ui/tool/kis_selection_tool_helper.cpp

http://commits.kde.org/calligra/665bd4f2735899c7b465694910e069fb3997f718