Bug 336959

Summary: Krita freeze if add new layer key-shortcut is used during linetool usage.
Product: [Applications] krita Reporter: vanyossi <ghevan>
Component: ToolsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: grave CC: dimula73
Priority: HI    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description vanyossi 2014-07-02 04:56:56 UTC
Krita freezes if I use any layer operation shortcut at the same time linetool click drag operation is still active.

I tried
Add new layer
Flatten Image.

After killing. backtrace gave me this.

Thread 13 (Thread 0x7fffc9bb8700 (LWP 26027)):
#0  0x00007fffef6a4b6d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fffe84a856c in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fffe84a8684 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ffff087ff3e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ffff085127f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007ffff0851500 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ffff0758080 in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007ffff083364f in ?? () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007ffff075a78c in ?? () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007ffff04c4eda in start_thread (arg=0x7fffc9bb8700) at pthread_create.c:308
#10 0x00007fffef6ae5ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 12 (Thread 0x7fffca76a700 (LWP 26026)):
#0  pthread_cond_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff075acf3 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ffff1bf362e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#3  0x00007ffff075a78c in ?? () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ffff04c4eda in start_thread (arg=0x7fffca76a700) at pthread_create.c:308
#5  0x00007fffef6ae5ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113


Thread 9 (Thread 0x7fffd90f8700 (LWP 26023)):
#0  pthread_cond_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff075acf3 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ffff07570d8 in QSemaphore::tryAcquire(int, int) () from /usr/lib64/qt4/libQtCore.so.4
#3  0x00007ffff6edf513 in KisTileDataSwapper::waitForWork (this=<optimized out>)
    at /home/tara/nalaf/nala/program/calligra/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:86
#4  0x00007ffff6edf80a in KisTileDataSwapper::run (this=0xfe1c38)
    at /home/tara/nalaf/nala/program/calligra/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#5  0x00007ffff075a78c in ?? () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ffff04c4eda in start_thread (arg=0x7fffd90f8700) at pthread_create.c:308
#7  0x00007fffef6ae5ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 8 (Thread 0x7fffcaf6b700 (LWP 26022)):
#0  pthread_cond_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff075acf3 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ffff0756d17 in QSemaphore::acquire(int) () from /usr/lib64/qt4/libQtCore.so.4
#3  0x00007ffff6ec1f9e in KisTileDataPooler::waitForWork (this=this@entry=0xfe1c00)
    at /home/tara/nalaf/nala/program/calligra/krita/image/tiles3/kis_tile_data_pooler.cc:162
#4  0x00007ffff6ec234b in KisTileDataPooler::run (this=0xfe1c00)
    at /home/tara/nalaf/nala/program/calligra/krita/image/tiles3/kis_tile_data_pooler.cc:184
#5  0x00007ffff075a78c in ?? () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ffff04c4eda in start_thread (arg=0x7fffcaf6b700) at pthread_create.c:308
#7  0x00007fffef6ae5ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7ffff7fa17c0 (LWP 25705)):
#0  0x00007ffff074f5f6 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#1  0x00007ffff6f5f069 in KisUpdateScheduler::barrierLock (this=0xfe4070)
    at /home/tara/nalaf/nala/program/calligra/krita/image/kis_update_scheduler.cpp:258
#2  0x00007ffff6f65e5d in KisImage::barrierLock (this=0xfca3d0) at /home/tara/nalaf/nala/program/calligra/krita/image/kis_image.cc:349
#3  0x00007ffff6fbc156 in KisLegacyUndoAdapter::addCommand (this=0xfd2a50, command=0x20e09a0)
    at /home/tara/nalaf/nala/program/calligra/krita/image/kis_legacy_undo_adapter.cpp:50
#4  0x00007ffff76aeb68 in KisNodeCommandsAdapter::addNode (this=<optimized out>, node=..., parent=..., aboveThis=...)
    at /home/tara/nalaf/nala/program/calligra/krita/ui/kis_node_commands_adapter.cpp:60
#5  0x00007ffff769d51a in KisLayerManager::addLayerCommon (this=this@entry=0x2ee9af0, activeNode=..., layer=...)
    at /home/tara/nalaf/nala/program/calligra/krita/ui/kis_layer_manager.cc:518
#6  0x00007ffff769e7ab in KisLayerManager::addLayer (this=0x2ee9af0, activeNode=...)
    at /home/tara/nalaf/nala/program/calligra/krita/ui/kis_layer_manager.cc:525
#7  0x00007ffff76b588e in KisNodeManager::createNode (this=0x2ee9870, nodeType=..., quiet=quiet@entry=false)
    at /home/tara/nalaf/nala/program/calligra/krita/ui/kis_node_manager.cpp:434
#8  0x00007ffff76b9122 in KisNodeManager::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, 
    _a=<optimized out>) at /home/tara/nalaf/nala/program/build/master-calligra/krita/ui/kis_node_manager.moc:125
#9  0x00007ffff0866537 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007ffff086d495 in QSignalMapper::mapped(QString const&) () from /usr/lib64/qt4/libQtCore.so.4
#11 0x00007ffff086d5a6 in QSignalMapper::map(QObject*) () from /usr/lib64/qt4/libQtCore.so.4
#12 0x00007ffff0866537 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#13 0x00007ffff172c632 in QAction::triggered(bool) () from /usr/lib64/qt4/libQtGui.so.4
#14 0x00007ffff172da18 in QAction::activate(QAction::ActionEvent) () from /usr/lib64/qt4/libQtGui.so.4
#15 0x00007ffff172db6f in QAction::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#16 0x00007ffff234cd47 in KAction::event(QEvent*) () from /usr/lib64/libkdeui.so.5
#17 0x00007ffff1732aac in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#18 0x00007ffff17353ab in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#19 0x00007ffff6b206b8 in KoApplication::notify (this=<optimized out>, receiver=0x2ef0c40, event=0x7fffffffc3c0)
    at /home/tara/nalaf/nala/program/calligra/libs/main/KoApplication.cpp:622
#20 0x00007ffff085259d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#21 0x00007ffff176504e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#22 0x00007ffff176549d in ?? () from /usr/lib64/qt4/libQtGui.so.4
#23 0x00007ffff1736e87 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#24 0x00007ffff6b206b8 in KoApplication::notify (this=<optimized out>, receiver=0x1cf0c60, event=0x7fffffffc9c0)
    at /home/tara/nalaf/nala/program/calligra/libs/main/KoApplication.cpp:622
#25 0x00007ffff085259d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#26 0x00007ffff17ce907 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#27 0x00007ffff17ced11 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#28 0x00007ffff17a8b28 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#29 0x00007ffff17d12e2 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#30 0x00007fffe84a827c in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#31 0x00007fffe84a85d4 in ?? () from /usr/lib64/libglib-2.0.so.0
#32 0x00007fffe84a8684 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#33 0x00007ffff087ff3e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#34 0x00007ffff17d13ae in ?? () from /usr/lib64/qt4/libQtGui.so.4
#35 0x00007ffff085127f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#36 0x00007ffff0851500 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#37 0x00007ffff0856628 in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#38 0x00007ffff7b340f3 in kdemain (argc=<optimized out>, argv=<optimized out>)
    at /home/tara/nalaf/nala/program/calligra/krita/main.cc:108
#39 0x00007fffef5e7bc5 in __libc_start_main (main=0x4009f0 <main(int, char**)>, argc=1, ubp_av=0x7fffffffd9e8, init=<optimized out>, 
    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd9d8) at libc-start.c:258
#40 0x0000000000400a21 in _start ()



Reproducible: Always
Comment 1 Dmitry Kazakov 2014-07-30 09:36:41 UTC
Confirmed. Recent regression
Comment 2 Dmitry Kazakov 2015-01-22 15:03:13 UTC
Git commit 70634f19718ac248c1e7ebabb47c7b5d8410a566 by Dmitry Kazakov.
Committed on 22/01/2015 at 14:02.
Pushed by dkazakov into branch 'calligra/2.9'.

Fix KisToolLine to handle end and cancel requests

M  +37   -4    krita/plugins/tools/defaulttools/kis_tool_line.cc
M  +9    -0    krita/plugins/tools/defaulttools/kis_tool_line.h
M  +9    -0    krita/plugins/tools/defaulttools/kis_tool_line_helper.cpp
M  +2    -1    krita/plugins/tools/defaulttools/kis_tool_line_helper.h
M  +5    -0    krita/ui/tool/kis_tool_freehand_helper.cpp
M  +2    -0    krita/ui/tool/kis_tool_freehand_helper.h

http://commits.kde.org/calligra/70634f19718ac248c1e7ebabb47c7b5d8410a566