Bug 211481 - Crash after pressing Control-Z in Kolourpaint
Summary: Crash after pressing Control-Z in Kolourpaint
Status: RESOLVED FIXED
Alias: None
Product: kolourpaint
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR crash
Target Milestone: ---
Assignee: kolourpaint-support
URL:
Keywords:
: 157684 236464 254326 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-22 22:42 UTC by Alec Moskvin
Modified: 2010-10-16 12:21 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (4.36 KB, text/plain)
2010-03-08 10:18 UTC, Oleg Atamanenko
Details
New crash information added by DrKonqi (5.78 KB, text/plain)
2010-04-10 21:05 UTC, Igor Poboiko
Details
Patch to bug #211481 (2.81 KB, patch)
2010-06-13 21:57 UTC, Igor Poboiko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Moskvin 2009-10-22 22:42:29 UTC
Application that crashed: kolourpaint
Version of the application: 4.3.2 (KDE 4.3.2)
KDE Version: 4.3.2 (KDE 4.3.2)
Qt Version: 4.5.3
Operating System: Linux 2.6.31.4 i686

What I was doing when the application crashed:
I was drawing something in Kolourpaint. I'm not sure what exactly I was foing, but I remember the last thing I did before the crash was press Control-Z to undo something.

 -- Backtrace:
Application: KolourPaint (kolourpaint), signal: Segmentation fault
[KCrash Handler]
#6  0x0808809b in kpDocument::setSelection (this=0x8445918, selection=...) at /var/tmp/portage/kde-base/kolourpaint-4.3.2/work/kolourpaint-4.3.2/kolourpaint/document/kpDocument_Selection.cpp:146
#7  0x0806da48 in kpToolSelectionDestroyCommand::unexecute (this=0x89a7110)
    at /var/tmp/portage/kde-base/kolourpaint-4.3.2/work/kolourpaint-4.3.2/kolourpaint/commands/tools/selection/kpToolSelectionDestroyCommand.cpp:166
#8  0x080676f0 in kpCommandHistoryBase::undoInternal (this=0x82b8280) at /var/tmp/portage/kde-base/kolourpaint-4.3.2/work/kolourpaint-4.3.2/kolourpaint/commands/kpCommandHistoryBase.cpp:325
#9  0x08068b40 in kpCommandHistoryBase::undo (this=0x82b8280) at /var/tmp/portage/kde-base/kolourpaint-4.3.2/work/kolourpaint-4.3.2/kolourpaint/commands/kpCommandHistoryBase.cpp:390
#10 0x08067c4c in kpCommandHistoryBase::qt_metacall (this=0x82b8280, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0xbfb027c8)
    at /var/tmp/portage/kde-base/kolourpaint-4.3.2/work/kolourpaint-4.3.2_build/kolourpaint/kpCommandHistoryBase.moc:81
#11 0x0806a3ff in kpCommandHistory::qt_metacall (this=0x82b8280, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0xbfb027c8)
    at /var/tmp/portage/kde-base/kolourpaint-4.3.2/work/kolourpaint-4.3.2_build/kolourpaint/kpCommandHistory.moc:62
#12 0x47d66b3b in QMetaObject::activate (sender=) at kernel/qobject.cpp:3101
#13 0x47d66ee2 in QMetaObject::activate (sender=<value optimized out>, m=) at kernel/qobject.cpp:3198
#14 0x49910e06 in QAction::triggered (this=) at .moc/release-shared/moc_qaction.cpp:236
#15 0x499121d2 in QAction::activate (this=<value optimized out>, event=<value optimized out>) at kernel/qaction.cpp:1167
#16 0x49914740 in QAction::event (this=<value optimized out>, e=<value optimized out>) at kernel/qaction.cpp:1086
#17 0x48ae6e20 in KAction::event (this=) at /var/tmp/portage/kde-base/kdelibs-4.3.2-r3/work/kdelibs-4.3.2/kdeui/actions/kaction.cpp:88
#18 0x49916c3c in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4065
#19 0x4991ce0d in QApplication::notify (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:3961
#20 0x48bd6242 in KApplication::notify (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.2-r3/work/kdelibs-4.3.2/kdeui/kernel/kapplication.cpp:302
#21 0x47d5407d in QCoreApplication::notifyInternal (this=) at kernel/qcoreapplication.cpp:606
#22 0x4994cd93 in QCoreApplication::sendEvent (this=) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:213
#23 QShortcutMap::dispatchEvent (this=) at kernel/qshortcutmap.cpp:884
#24 0x4994ebe7 in QShortcutMap::tryShortcutEvent (this=<value optimized out>, o=) at kernel/qshortcutmap.cpp:369
#25 0x4991e1b3 in QApplication::notify (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:3647
#26 0x48bd6242 in KApplication::notify (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.2-r3/work/kdelibs-4.3.2/kdeui/kernel/kapplication.cpp:302
#27 0x47d5407d in QCoreApplication::notifyInternal (this=) at kernel/qcoreapplication.cpp:606
#28 0x49917e6e in QCoreApplication::sendSpontaneousEvent (receiver=) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:216
#29 qt_sendSpontaneousEvent (receiver=) at kernel/qapplication.cpp:4975
#30 0x499a7add in QKeyMapper::sendKeyEvent (keyWidget=<value optimized out>, grab=) at kernel/qkeymapper_x11.cpp:1675
#31 0x499aaadb in QKeyMapperPrivate::translateKeyEvent (this=) at kernel/qkeymapper_x11.cpp:1645
#32 0x499830cf in QApplication::x11ProcessEvent (this=) at kernel/qapplication_x11.cpp:3445
#33 0x499aba70 in x11EventSourceDispatch (s=) at kernel/qguieventdispatcher_glib.cpp:146
#34 0x4958c1cf in g_main_dispatch (context=) at gmain.c:1824
#35 IA__g_main_context_dispatch (context=) at gmain.c:2377
#36 0x4958f998 in g_main_context_iterate (context=<value optimized out>, block=<value optimized out>, dispatch=) at gmain.c:2455
#37 0x4958fabf in IA__g_main_context_iteration (context=<value optimized out>, may_block=) at gmain.c:2518
#38 0x47d7c169 in QEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:328
#39 0x499ab24b in QGuiEventDispatcherGlib::processEvents (this=) at kernel/qguieventdispatcher_glib.cpp:202
#40 0x47d5270e in QEventLoop::processEvents (this=) at kernel/qeventloop.cpp:149
#41 0x47d528fa in QEventLoop::exec (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:197
#42 0x47d54a96 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#43 0x49916aa5 in QApplication::exec () at kernel/qapplication.cpp:3525
#44 0x080994f5 in main (argc=1, argv=0xbfb04c34) at /var/tmp/portage/kde-base/kolourpaint-4.3.2/work/kolourpaint-4.3.2/kolourpaint/kolourpaint.cpp:125

Reported using DrKonqi
Comment 1 psk 2010-01-25 17:18:20 UTC
Hello,

I've just found a way to reproduce this crash for sure running :

kolourpaint
KDE 4.3.0
Linux (i686) release 2.6.27.30-170.2.82.fc10.i686
gcc

1) Open kolourpaint 
2) Select an area and move it
3) Try to write text somewhere (only select a zone, do not type any character)
4) Then undo (while the square zone for typing characters is displayed)
5) Crash
Comment 2 Alec Moskvin 2010-01-27 22:10:06 UTC
I can also reproduce this on KDE 4.4 RC2 (thanks psk!)

Qt: 4.6.1
KDE Development Platform: 4.3.95 (KDE 4.3.95 (KDE 4.4 RC2))
KolourPaint: 4.3.95 (KDE 4.3.95 (KDE 4.4 RC2))
Comment 3 Oleg Atamanenko 2010-03-08 10:18:32 UTC
Created attachment 41436 [details]
New crash information added by DrKonqi

I was trying to add text to the screenshot (to report bug #229915)  and suddenly kolourpaint crashed.
Comment 4 Igor Poboiko 2010-04-10 21:05:20 UTC
Created attachment 42655 [details]
New crash information added by DrKonqi

I added some text to my picture, pressed 'Ctrl+Z' and kolourpaint crashed (segmentation fault)
Backtrace attached.
Comment 5 Christoph Dalski 2010-06-10 16:16:07 UTC
I can also confirm this bug with kde4.4 on archlinux.
Just do the following steps:
- open kolourpaint
- write some text into a text field
- press control+a
- press control+z

=> Crash
Comment 6 Igor Poboiko 2010-06-13 21:57:57 UTC
Created attachment 47979 [details]
Patch to bug #211481

This patch fixes problem (tested with steps from comment #5 and comment #1). It also fixes some compilation errors when some DEBUG defines are set to 1.
Comment 7 Igor Poboiko 2010-06-14 10:25:57 UTC
This bug happens every time when after pressing Ctrl+Z selection type changes (for example, from text selection to image selection - like in comment #1, or from image selection to text selection - like in comment #5)
According to documentation (kpDocument::setSelection function), we mustn't call kpDocument::setSelection to set image selection when text selection is active and vice versa. If we must do it, we must push previous selection onto document (this is doing my patch)
Comment 8 Christoph Feck 2010-06-14 21:12:37 UTC
SVN commit 1137954 by cfeck:

Fix "Undo" crash after changing selection mode

Patch by Igor Poboiko, thanks!
BUG: 211481


 M  +4 -0      commands/tools/selection/kpToolSelectionDestroyCommand.cpp  
 M  +3 -1      document/kpDocument_Selection.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1137954
Comment 9 Christoph Feck 2010-06-14 21:14:31 UTC
SVN commit 1137955 by cfeck:

Fix "Undo" crash after changing selection mode (backport r1137954)

Patch by Igor Poboiko, thanks!
CCBUG: 211481
FIXED-IN: 4.4.5


 M  +4 -0      commands/tools/selection/kpToolSelectionDestroyCommand.cpp  
 M  +3 -1      document/kpDocument_Selection.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1137955
Comment 10 Christoph Feck 2010-07-02 02:25:43 UTC
*** Bug 157684 has been marked as a duplicate of this bug. ***
Comment 11 Christoph Feck 2010-10-16 12:19:55 UTC
*** Bug 254326 has been marked as a duplicate of this bug. ***
Comment 12 Christoph Feck 2010-10-16 12:21:47 UTC
*** Bug 236464 has been marked as a duplicate of this bug. ***