Bug 329967 - Crash after drawing freehand path on vector layer
Summary: Crash after drawing freehand path on vector layer
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: 2.9 Beta
Platform: Compiled Sources All
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 330036 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-14 18:56 UTC by Aniruddha Hardikar
Modified: 2014-02-04 11:24 UTC (History)
4 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 Aniruddha Hardikar 2014-01-14 18:56:56 UTC
Krita crashes after drawing with the freehand path tool on a vector layer. The rest of the path tools do not cause a crash, Also the freehand path draws successfully on non-vector layers.

Reproducible: Always

Steps to Reproduce:
1. Open a new document.
2. Create vector layer.
3. Draw on vector layer with freehand path tool
Actual Results:  
Krita crashes abruptly.

Expected Results:  
The freehand path stroke should be drawn as a path on the vector layer.

Encountered in 2.7.9.4 x64 on Windows 7 Ultimate (64-bit) 
Untested on previous versions.
Comment 1 Dmitry Kazakov 2014-01-14 20:08:55 UTC
Confirmed also on Linux:

Thread 1 (Thread 0x7ff8f4e8e7a0 (LWP 6388)):
[KCrash Handler]
#6  0x00007ff8ec585d95 in raise () from /lib64/libc.so.6
#7  0x00007ff8ec5872ab in abort () from /lib64/libc.so.6
#8  0x00007ff8ed53e9f4 in qt_message_output (msgType=<optimized out>, buf=<optimized out>) at global/qglobal.cpp:2291
#9  0x00007ff8ed53ebaf in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=0x7ff8ed68d678 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fffb75268c8) at global/qglobal.cpp:2337
#10 0x00007ff8ed53ed54 in qFatal (msg=<optimized out>) at global/qglobal.cpp:2520
#11 0x00007ff8ed53ed9a in qt_assert (assertion=<optimized out>, file=<optimized out>, line=<optimized out>) at global/qglobal.cpp:2036
#12 0x00007ff8f167239d in KoShapeController::Private::addShape (this=0x6b54860, shape=0x7d74800, showDialog=<optimized out>, parent=0x0) at /home/devel/kde-src/calligra/libs/flake/KoShapeController.cpp:63
#13 0x00007ff8f46c2a69 in KisToolShape::addShape (this=0x7a94680, shape=0x7d74800) at /home/devel/kde-src/calligra/krita/ui/tool/kis_tool_shape.cc:159
#14 0x00007ff8f46c4d01 in KisToolShape::addPathShape (this=0x7a94680, pathShape=0x7d74800, name=...) at /home/devel/kde-src/calligra/krita/ui/tool/kis_tool_shape.cc:227
#15 0x00007ff8d203530b in __KisToolPencilLocalTool::addPathShape (this=0x7a94750, pathShape=0x7d74800, closePath=<optimized out>) at /home/devel/kde-src/calligra/krita/plugins/tools/defaulttools/kis_tool_pencil.cc:61
#16 0x00007ff8dce3d13a in KoPencilTool::finish (this=0x7a94750, closePath=false) at /home/devel/kde-src/calligra/libs/basicflakes/tools/KoPencilTool.cpp:273
#17 0x00007ff8dce3d494 in KoPencilTool::mouseReleaseEvent (this=0x7a94750, event=0x7fffb7527440) at /home/devel/kde-src/calligra/libs/basicflakes/tools/KoPencilTool.cpp:151
#18 0x00007ff8d1ff314c in mouseReleaseEvent (event=<optimized out>, this=<optimized out>) at /home/devel/kde-src/calligra/krita/ui/tool/kis_delegated_tool.h:97
#19 KisDelegatedTool<KisToolShape, __KisToolPencilLocalTool>::mouseReleaseEvent (this=0x7a94680, event=0x7fffb7527440) at /home/devel/kde-src/calligra/krita/ui/tool/kis_delegated_tool.h:91
#20 0x00007ff8f16820b0 in KoToolProxy::mouseReleaseEvent (this=0x6b557e0, event=0x7fffb7527ee0, point=...) at /home/devel/kde-src/calligra/libs/flake/KoToolProxy.cpp:383
#21 0x00007ff8f445e268 in KisToolProxy::forwardEvent (this=0x6b557e0, state=KisToolProxy::END, action=KisTool::Primary, event=<optimized out>, originalEvent=0x7fffb7527ee0, lastTabletEvent=<optimized out>, canvasOriginWorkaround=...) at /home/devel/kde-src/calligra/krita/ui/canvas/kis_tool_proxy.cpp:130
#22 0x00007ff8f4738c45 in KisToolInvocationAction::end (this=0x6b562e0, event=0x7fffb7527ee0) at /home/devel/kde-src/calligra/krita/ui/input/kis_tool_invocation_action.cpp:118
#23 0x00007ff8f4741c01 in KisShortcutMatcher::tryEndRunningShortcut (this=0x6b55e20, button=<optimized out>, event=0x7fffb7527ee0) at /home/devel/kde-src/calligra/krita/ui/input/kis_shortcut_matcher.cpp:413
#24 0x00007ff8f4742f27 in KisShortcutMatcher::buttonReleased (this=0x6b55e20, button=Qt::LeftButton, event=<optimized out>) at /home/devel/kde-src/calligra/krita/ui/input/kis_shortcut_matcher.cpp:187
#25 0x00007ff8f473640d in KisInputManager::eventFilter (this=0x6b55cd0, object=0x7028ed0, event=0x7fffb7527ee0) at /home/devel/kde-src/calligra/krita/ui/input/kis_input_manager.cpp:589
#26 0x00007ff8ed62e9a8 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x7028ed0, event=0x7fffb7527ee0) at kernel/qcoreapplication.cpp:902
#27 0x00007ff8ee284baf in notify_helper (e=0x7fffb7527ee0, receiver=0x7028ed0, this=0x6aaee0) at kernel/qapplication.cpp:4477
#28 QApplicationPrivate::notify_helper (this=0x6aaee0, receiver=0x7028ed0, e=0x7fffb7527ee0) at kernel/qapplication.cpp:4453
#29 0x00007ff8ee28a36b in QApplication::notify (this=<optimized out>, receiver=0x7028ed0, e=0x7fffb7527ee0) at kernel/qapplication.cpp:4042
#30 0x00007ff8f3a3ddbe in KoApplication::notify (this=<optimized out>, receiver=0x7028ed0, event=0x7fffb7527ee0) at /home/devel/kde-src/calligra/libs/main/KoApplication.cpp:554
#31 0x00007ff8ed62e81c in QCoreApplication::notifyInternal (this=0x7fffb7528a40, receiver=0x7028ed0, event=0x7fffb7527ee0) at kernel/qcoreapplication.cpp:787
#32 0x00007ff8ee285bb2 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:215
#33 QApplicationPrivate::sendMouseEvent (receiver=0x7028ed0, event=0x7fffb7527ee0, alienWidget=0x0, nativeWidget=0x7028ed0, buttonDown=0x0, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3141
#34 0x00007ff8ee301b55 in QETWidget::translateMouseEvent (this=0x7028ed0, event=<optimized out>) at kernel/qapplication_x11.cpp:4472
#35 0x00007ff8ee300a2a in QApplication::x11ProcessEvent (this=0x7fffb7528a40, event=0x7fffb75287b0) at kernel/qapplication_x11.cpp:3598
#36 0x00007ff8ee328cba in QEventDispatcherX11::processEvents (this=0x60df00, flags=...) at kernel/qeventdispatcher_x11.cpp:132
#37 0x00007ff8ed62da22 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#38 0x00007ff8ed62dc1f in QEventLoop::exec (this=0x7fffb7528a00, flags=...) at kernel/qeventloop.cpp:201
#39 0x00007ff8ed631de7 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#40 0x00007ff8f4a8212f in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/devel/kde-src/calligra/krita/main.cc:101
#41 0x00007ff8ec57223d in __libc_start_main () from /lib64/libc.so.6
#42 0x0000000000400901 in _start () at ../sysdeps/x86_64/elf/start.S:113
Comment 2 Halla Rempt 2014-01-14 20:35:49 UTC
Interesting...

                KoShapeFactoryBase *factory = KoShapeRegistry::instance()->value(shape->shapeId());
                Q_ASSERT(factory);

So this shape's ID is unknown?
Comment 3 Halla Rempt 2014-01-15 10:06:33 UTC
This is a regression since 2.7. The other vector tools still work. Adding the pathshape id explicity doesn't fix the issue...
Comment 4 Bollebib 2014-01-16 14:35:37 UTC
*** Bug 330036 has been marked as a duplicate of this bug. ***
Comment 5 Dmitry Kazakov 2014-01-28 13:37:23 UTC
Git commit e9bca7e1276b6392134fe96144e21a4134122f09 by Dmitry Kazakov.
Committed on 28/01/2014 at 12:58.
Pushed by dkazakov into branch 'master'.

Fix the Stroke and Shape Id of the Pencil Tool

This patch fixes two issues:

1) Crash in Krita caused by non-initialized id of the shape

2) Wrong stroke parameters of KoPencilTool calligra-wise
   The stroke was not initilized properly.

REVIEW:115352

M  +1    -7    libs/basicflakes/tools/KoCreatePathTool.cpp
M  +13   -12   libs/basicflakes/tools/KoPencilTool.cpp
M  +3    -2    libs/basicflakes/tools/KoPencilTool.h
M  +14   -0    libs/widgets/KoStrokeConfigWidget.cpp
M  +7    -0    libs/widgets/KoStrokeConfigWidget.h

http://commits.kde.org/calligra/e9bca7e1276b6392134fe96144e21a4134122f09
Comment 6 Aniruddha Hardikar 2014-02-04 07:43:53 UTC
As of version 2.7.9.6 (x64) the bug is still present and can be reproduced on Windows 7 x64.
Comment 7 Dmitry Kazakov 2014-02-04 08:21:43 UTC
Git commit 3da1a3530b761c1f1990cfe32f35dae232855888 by Dmitry Kazakov.
Committed on 28/01/2014 at 12:58.
Pushed by dkazakov into branch 'calligra/2.8'.

Fix the Stroke and Shape Id of the Pencil Tool

This patch fixes two issues:

1) Crash in Krita caused by non-initialized id of the shape

2) Wrong stroke parameters of KoPencilTool calligra-wise
   The stroke was not initilized properly.

REVIEW:115352

M  +1    -7    libs/basicflakes/tools/KoCreatePathTool.cpp
M  +13   -12   libs/basicflakes/tools/KoPencilTool.cpp
M  +3    -2    libs/basicflakes/tools/KoPencilTool.h
M  +14   -0    libs/widgets/KoStrokeConfigWidget.cpp
M  +7    -0    libs/widgets/KoStrokeConfigWidget.h

http://commits.kde.org/calligra/3da1a3530b761c1f1990cfe32f35dae232855888
Comment 8 Halla Rempt 2014-02-04 11:24:18 UTC
The fix is in the new build I made today.