Bug 261033

Summary: Transform on Local Selection crash
Product: krita Reporter: sinozzuke <sinozzuke>
Component: GeneralAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: crash CC: halla, sinozzuke
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: New crash information added by DrKonqi

Description sinozzuke 2010-12-23 03:36:27 UTC
Application: krita (2.3 Beta 4)
KDE Platform Version: 4.5.85 (4.6 Beta2)
Qt Version: 4.7.1
Operating System: Linux 2.6.34.7-0.5-desktop x86_64
Distribution: "openSUSE 11.3 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:
Steps to reproduce:
1.New layer
2.Draw someting
3.Select part of drawing
4.Store that selection
5.Select Transform tool
6.Transfom selection
7.Click Apply
crash

-- Backtrace:
Application: Krita (krita), signal: Aborted
[Current thread is 1 (Thread 0x7f6182f9b7a0 (LWP 2207))]

Thread 4 (Thread 0x7f615d317710 (LWP 2208)):
#0  0x00007fff317ff851 in clock_gettime ()
#1  0x00007f6179a242a3 in clock_gettime () from /lib64/librt.so.1
#2  0x00007f6182808522 in do_gettime () at tools/qelapsedtimer_unix.cpp:123
#3  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#4  0x00007f61828cc4ad in QTimerInfoList::updateCurrentTime (this=0x10ef870) at kernel/qeventdispatcher_unix.cpp:339
#5  0x00007f61828cd746 in QEventDispatcherUNIXPrivate::doSelect (this=0x10ef000, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:182
#6  0x00007f61828ced2f in QEventDispatcherUNIX::processEvents (this=0x1048ed0, flags=...) at kernel/qeventdispatcher_unix.cpp:933
#7  0x00007f61828a0262 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#8  0x00007f61828a0475 in QEventLoop::exec (this=0x7f615d316ce0, flags=...) at kernel/qeventloop.cpp:201
#9  0x00007f61827b31a4 in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:490
#10 0x00007f6182881918 in QInotifyFileSystemWatcherEngine::run (this=0x10dfae0) at io/qfilesystemwatcher_inotify.cpp:248
#11 0x00007f61827b5a1e in QThreadPrivate::start (arg=0x10dfae0) at thread/qthread_unix.cpp:285
#12 0x00007f6180a19ae3 in ?? () from /usr/lib64/libGL.so.1
#13 0x00007f6182526a4f in start_thread () from /lib64/libpthread.so.0
#14 0x00007f617a31882d in clone () from /lib64/libc.so.6
#15 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f615c01a710 (LWP 2219)):
#0  0x00007f618252b39c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f61827b610b in wait (this=<value optimized out>, mutex=0x142b3e0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x142b3e0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00007f61827b2a95 in QSemaphore::acquire (this=0x11ed820, n=1) at thread/qsemaphore.cpp:144
#4  0x00007f6181a1feee in KisTileDataPooler::waitForWork (this=0x11ed810) at /home/sinozzuke/kde4/calligra/src/krita/image/tiles3/kis_tile_data_pooler.cc:127
#5  0x00007f6181a1ffac in KisTileDataPooler::run (this=0x11ed810) at /home/sinozzuke/kde4/calligra/src/krita/image/tiles3/kis_tile_data_pooler.cc:156
#6  0x00007f61827b5a1e in QThreadPrivate::start (arg=0x11ed810) at thread/qthread_unix.cpp:285
#7  0x00007f6180a19ae3 in ?? () from /usr/lib64/libGL.so.1
#8  0x00007f6182526a4f in start_thread () from /lib64/libpthread.so.0
#9  0x00007f617a31882d in clone () from /lib64/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f615b819710 (LWP 2220)):
#0  0x00007f618252b39c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f61827b610b in wait (this=<value optimized out>, mutex=0x142a7e0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x142a7e0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00007f61827b2cc9 in QSemaphore::tryAcquire (this=0x11eddf0, n=1, timeout=-1) at thread/qsemaphore.cpp:221
#4  0x00007f6181a5b67a in KisTileDataSwapper::run (this=0x11ed840) at /home/sinozzuke/kde4/calligra/src/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:90
#5  0x00007f61827b5a1e in QThreadPrivate::start (arg=0x11ed840) at thread/qthread_unix.cpp:285
#6  0x00007f6180a19ae3 in ?? () from /usr/lib64/libGL.so.1
#7  0x00007f6182526a4f in start_thread () from /lib64/libpthread.so.0
#8  0x00007f617a31882d in clone () from /lib64/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f6182f9b7a0 (LWP 2207)):
[KCrash Handler]
#6  0x00007f617a27a9e5 in raise () from /lib64/libc.so.6
#7  0x00007f617a27bee6 in abort () from /lib64/libc.so.6
#8  0x00007f61827ad864 in qt_message_output (msgType=<value optimized out>, buf=<value optimized out>) at global/qglobal.cpp:2282
#9  0x00007f61827ada2d in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=0x7f6182900c08 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fff3172b420)
    at global/qglobal.cpp:2328
#10 0x00007f61827adbc5 in qFatal (msg=<value optimized out>) at global/qglobal.cpp:2511
#11 0x00007f61827adc0a in qt_assert (assertion=0x89f <Address 0x89f out of bounds>, file=0x6 <Address 0x6 out of bounds>, line=-1) at global/qglobal.cpp:2027
#12 0x00007f6181a35b46 in KisMementoManager::getMemento (this=0x1310d30) at /home/sinozzuke/kde4/calligra/src/krita/image/tiles3/kis_memento_manager.cc:231
#13 0x00007f6181c0d225 in getMemento (this=0x47f2940, name=<value optimized out>, device=<value optimized out>, parent=<value optimized out>)
    at /home/sinozzuke/kde4/calligra/src/krita/image/tiles3/kis_tiled_data_manager.h:150
#14 getMemento (this=0x47f2940, name=<value optimized out>, device=<value optimized out>, parent=<value optimized out>) at /home/sinozzuke/kde4/calligra/src/krita/image/kis_datamanager.h:89
#15 KisTransactionData::KisTransactionData (this=0x47f2940, name=<value optimized out>, device=<value optimized out>, parent=<value optimized out>)
    at /home/sinozzuke/kde4/calligra/src/krita/image/kis_transaction_data.cpp:53
#16 0x00007f6181bee0e8 in KisSelectedTransactionData::KisSelectedTransactionData (this=0x43941f0, name=..., node=<value optimized out>, parent=<value optimized out>)
    at /home/sinozzuke/kde4/calligra/src/krita/image/kis_selected_transaction_data.cpp:39
#17 0x00007f6162a4dff6 in ApplyTransformCmdData::ApplyTransformCmdData (this=0x43941f0, tool=0x2dac960, mode=ToolTransformArgs::FREE_TRANSFORM, node=<value optimized out>)
    at /home/sinozzuke/kde4/calligra/src/krita/plugins/tools/tool_transform2/tool_transform_commands.cc:25
#18 0x00007f6162a4e26b in ApplyTransformCmd::ApplyTransformCmd (this=0x7fff3172c200, tool=0x2dac960, mode=ToolTransformArgs::FREE_TRANSFORM, node=<value optimized out>)
    at /home/sinozzuke/kde4/calligra/src/krita/plugins/tools/tool_transform2/tool_transform_commands.cc:51
#19 0x00007f6162a562fe in KisToolTransform::applyTransform (this=0x2dac960) at /home/sinozzuke/kde4/calligra/src/krita/plugins/tools/tool_transform2/kis_tool_transform.cc:1975
#20 0x00007f6162a699f0 in KisToolTransform::slotButtonBoxClicked (this=0x2dac960, button=0x31a20d0) at /home/sinozzuke/kde4/calligra/src/krita/plugins/tools/tool_transform2/kis_tool_transform.cc:2607
#21 0x00007f6162a69c52 in KisToolTransform::qt_metacall (this=0x2dac960, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff3172cac0)
    at /home/sinozzuke/kde4/calligra/build/krita/plugins/tools/tool_transform2/kis_tool_transform.moc:184
#22 0x00007f61828b5fef in QMetaObject::activate (sender=0x3197470, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff3172cac0) at kernel/qobject.cpp:3272
#23 0x00007f617bc5506f in QDialogButtonBox::clicked (this=<value optimized out>, _t1=0x31a20d0) at .moc/release-shared/moc_qdialogbuttonbox.cpp:165
#24 0x00007f617bc55114 in QDialogButtonBoxPrivate::_q_handleButtonClicked (this=<value optimized out>) at widgets/qdialogbuttonbox.cpp:1130
#25 0x00007f617bc56649 in QDialogButtonBox::qt_metacall (this=0x3197470, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff3172cc20) at .moc/release-shared/moc_qdialogbuttonbox.cpp:121
#26 0x00007f61828b5fef in QMetaObject::activate (sender=0x31a20d0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff3172cc20) at kernel/qobject.cpp:3272
#27 0x00007f617bee46b2 in QAbstractButton::clicked (this=<value optimized out>, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:206
#28 0x00007f617bc2971b in QAbstractButtonPrivate::emitClicked (this=0x31a2110) at widgets/qabstractbutton.cpp:546
#29 0x00007f617bc2aceb in QAbstractButtonPrivate::click (this=0x31a2110) at widgets/qabstractbutton.cpp:539
#30 0x00007f617bc2af5c in QAbstractButton::mouseReleaseEvent (this=0x31a20d0, e=0x7fff3172d5a0) at widgets/qabstractbutton.cpp:1121
#31 0x00007f617b8bf4a8 in QWidget::event (this=0x31a20d0, event=0x7fff3172d5a0) at kernel/qwidget.cpp:8200
#32 0x00007f617b86dcd4 in QApplicationPrivate::notify_helper (this=0x6d3790, receiver=0x31a20d0, e=0x7fff3172d5a0) at kernel/qapplication.cpp:4445
#33 0x00007f617b876a4a in QApplication::notify (this=<value optimized out>, receiver=0x31a20d0, e=0x7fff3172d5a0) at kernel/qapplication.cpp:4006
#34 0x00007f617c4d8c66 in KApplication::notify (this=0x7fff3172e0f0, receiver=0x31a20d0, event=0x7fff3172d5a0) at /usr/src/debug/kdelibs-4.5.85/kdeui/kernel/kapplication.cpp:311
#35 0x00007f61828a0e2c in QCoreApplication::notifyInternal (this=0x7fff3172e0f0, receiver=0x31a20d0, event=0x7fff3172d5a0) at kernel/qcoreapplication.cpp:732
#36 0x00007f617b86ecd5 in sendEvent (receiver=0x31a20d0, event=0x7fff3172d5a0, alienWidget=0x31a20d0, nativeWidget=0xe8e880, buttonDown=0x7f617c349178, lastMouseReceiver=..., spontaneous=true)
    at ../../src/corelib/kernel/qcoreapplication.h:215
#37 QApplicationPrivate::sendMouseEvent (receiver=0x31a20d0, event=0x7fff3172d5a0, alienWidget=0x31a20d0, nativeWidget=0xe8e880, buttonDown=0x7f617c349178, lastMouseReceiver=..., spontaneous=true)
    at kernel/qapplication.cpp:3105
#38 0x00007f617b8ecef8 in QETWidget::translateMouseEvent (this=0xe8e880, event=<value optimized out>) at kernel/qapplication_x11.cpp:4438
#39 0x00007f617b8eb5d9 in QApplication::x11ProcessEvent (this=0x7fff3172e0f0, event=0x7fff3172df10) at kernel/qapplication_x11.cpp:3564
#40 0x00007f617b913c04 in QEventDispatcherX11::processEvents (this=0x659580, flags=...) at kernel/qeventdispatcher_x11.cpp:132
#41 0x00007f61828a0262 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#42 0x00007f61828a0475 in QEventLoop::exec (this=0x7fff3172e0a0, flags=...) at kernel/qeventloop.cpp:201
#43 0x00007f61828a48db in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#44 0x00007f6182bd83e5 in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /home/sinozzuke/kde4/calligra/src/krita/main.cc:49
#45 0x00007f617a266b7d in __libc_start_main () from /lib64/libc.so.6
#46 0x0000000000400919 in _start () at ../sysdeps/x86_64/elf/start.S:113

Possible duplicates by query: bug 248374.

Reported using DrKonqi
Comment 1 Halla Rempt 2010-12-23 17:17:17 UTC
Ack. Dmitry....
Comment 2 sinozzuke 2010-12-28 23:34:18 UTC
Created attachment 55331 [details]
New crash information added by DrKonqi

krita (2.4 Alpha 1) on KDE Platform 4.5.90 (4.6 RC1) using Qt 4.7.1

- What I was doing when the application crashed:

The same error. Make a Local Selection, select it, and then transform tool. Get the crash

-- Backtrace (Reduced):
#11 0x00007ff2e0349c0a in qt_assert (assertion=0x5317 <Address 0x5317 out of bounds>, file=0x6 <Address 0x6 out of bounds>, line=-1) at global/qglobal.cpp:2027
#12 0x00007ff2df5c23f6 in KisMementoManager::getMemento (this=0x7dfa600) at /home/sinozzuke/kde4/calligra/src/krita/image/tiles3/kis_memento_manager.cc:231
#13 0x00007ff2df79c715 in getMemento (this=0x87be970, name=<value optimized out>, device=<value optimized out>, parent=<value optimized out>)
    at /home/sinozzuke/kde4/calligra/src/krita/image/tiles3/kis_tiled_data_manager.h:150
#14 getMemento (this=0x87be970, name=<value optimized out>, device=<value optimized out>, parent=<value optimized out>) at /home/sinozzuke/kde4/calligra/src/krita/image/kis_datamanager.h:89
#15 KisTransactionData::KisTransactionData (this=0x87be970, name=<value optimized out>, device=<value optimized out>, parent=<value optimized out>)
    at /home/sinozzuke/kde4/calligra/src/krita/image/kis_transaction_data.cpp:53
Comment 3 Halla Rempt 2011-06-18 15:23:03 UTC
And another assert:

krita(13006): "[
0: /usr/lib/libkdecore.so.5(kRealBacktrace(int)+0x45) [0xb4b70735]
1: /home/boud/kde/inst/lib/libkritaimage.so.8(KisMementoManager::getMemento()+0x3b) [0xb6e0e20b]
2: /home/boud/kde/inst/lib/libkritaimage.so.8(KisTransactionData::KisTransactionData(QString const&, KisSharedPtr<KisPaintDevice>, QUndoCommand*)+0x169) [0xb7023329]
3: /home/boud/kde/inst/lib/libkritaimage.so.8(KisSelectedTransactionData::KisSelectedTransactionData(QString const&, KisSharedPtr<KisNode>, QUndoCommand*)+0x282) [0xb7001842]
4: /home/boud/kde/master/lib/kde4/kritatooltransform.so(+0xc148) [0xac09c148]
5: /home/boud/kde/master/lib/kde4/kritatooltransform.so(+0xc3e2) [0xac09c3e2]
6: /home/boud/kde/master/lib/kde4/kritatooltransform.so(+0x1453a) [0xac0a453a]
7: /home/boud/kde/master/lib/kde4/kritatooltransform.so(+0x27f0e) [0xac0b7f0e]
8: /home/boud/kde/master/lib/kde4/kritatooltransform.so(+0x2818e) [0xac0b818e]
9: /usr/lib/libQtCore.so.4(QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**)+0x3d) [0xb771d0ed]
]
" 
ASSERT: "!namedTransactionInProgress()" in file /home/boud/kde/src/calligra/krita/image/tiles3/kis_memento_manager.cc, line 231
Aborted
Comment 4 Dmitry Kazakov 2011-06-19 09:09:55 UTC
This asssert happens because two transactions are opened on the same paint device at the same time. This happens because of the following:
1) KisTransformTool opens KisSelectedTransaction on a mask (i can't say whether this is right or wrong).
2) KisSelectedTransaction opens two transactions on two devices: mask->paintDevice() and parentLayer->selection().
This is ok for all the nodes except of selection mask, because it *is* the selection of the node itself. So it happens that mask->paintDevice() and parentLayer->selection() coincide.
Comment 5 Halla Rempt 2011-06-19 10:08:13 UTC
Ok... but what now? Even if we implement the selection plan, this bug won't be automatically fixed, will it?
Comment 6 Dmitry Kazakov 2011-06-19 13:39:57 UTC
Automatically -- not. KisSelectedTransaction should check whether two devices (selection and paint) coincide. I tried to do it this morning, but i failed. It returns different devices, though they should be the same. Either my assumption is wrong, or there is some other bug somewhere as well. I'll check this later.
Comment 7 Dmitry Kazakov 2012-02-10 11:06:08 UTC
Git commit e78752f3b9ebe3b17d4f8645b70f057d4191ba53 by Dmitry Kazakov.
Committed on 10/02/2012 at 13:04.
Pushed by dkazakov into branch 'shapes-as-node-model-kazakov'.

Fix crash when transform local selections

M  +1    -1    krita/image/kis_mask.cc
M  +14   -7    krita/image/kis_selected_transaction_data.cpp
M  +1    -1    krita/plugins/tools/tool_transform2/kis_tool_transform.cc

http://commits.kde.org/calligra/e78752f3b9ebe3b17d4f8645b70f057d4191ba53