Bug 361577 - Clone tool brush stroke causes crash
Summary: Clone tool brush stroke causes crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: 3.0 Alpha
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-10 08:11 UTC by Marcus Kjeldsen
Modified: 2016-04-15 18:47 UTC (History)
3 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 Marcus Kjeldsen 2016-04-10 08:11:02 UTC
Using the clone tool causes immediate crash.

Reproducible: Always

Steps to Reproduce:
1. Select clone tool
2. Ctrl-click canvas to select clone source
3. Draw a stroke

Actual Results:  
Crash

Expected Results:  
Cloned brush stroke
Comment 1 ocumo 2016-04-12 01:13:39 UTC
I can confirm this bug in Kubuntu 15.04 - 64bit.  It is not only in Windows.
Krita version used:   Krita-3.0-Alpha-master-e5109c2-x86_64.AppImage

Steps to reproduce the problem in Kubuntu 15.04:
1. From the command line, launch Krita-3.0-Alpha-master-e5109c2-x86_64.AppImage.
2. Open a krita supported format file like .kra or .jpg.
3. On the Brush Presets tab, select the Clone_tool brush.
4. Try to use the tool on the image, e.g. left-click on it a couple of times. The application crashes and the GUI closes (Segmentation fault).
5. In the terminal, the last few stdout/stderr lines are these:

------------------------
krita.lib.flake: "InteractionTool" : action "object_order_lower" conflicts with canvas action "rotate_canvas_left" shortcut: "Ctrl+["
krita.lib.flake: "InteractionTool" : action "object_order_raise" conflicts with canvas action "rotate_canvas_right" shortcut: "Ctrl+]"
krita.lib.flake: "InteractionTool" : action "object_order_lower" conflicts with canvas action "rotate_canvas_left" shortcut: "Ctrl+["
krita.lib.flake: "InteractionTool" : action "object_order_raise" conflicts with canvas action "rotate_canvas_right" shortcut: "Ctrl+]"
Segmentation fault (core dumped)
Comment 2 Halla Rempt 2016-04-12 06:53:02 UTC
Hm, doesn't crash here on OSX or Linux. Or I'm doing something wrong....
Comment 3 Raghavendra kamath 2016-04-13 06:12:06 UTC
I can confirm this on arch linux 3.0 built from git

To reproduce
1) select the clone tool brush,
2) then ctrl click on canvas to select source
3) try to paint 

This can be reproduced by mouse as well as pen.

here is my back trace 

Application: krita (krita), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f43d165e840 (LWP 1722))]

Thread 14 (Thread 0x7f43af9d7700 (LWP 1724)):
#0  0x00007f43c8c2bc3d in poll () from /usr/lib/libc.so.6
#1  0x00007f43c40570fc in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f43c405720c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f43c9a5ecab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c9a076fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#5  0x00007f43c9830fe4 in QThread::exec() () from /usr/lib/libQt5Core.so.5
#6  0x00007f43c4e73a55 in ?? () from /usr/lib/libQt5DBus.so.5
#7  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#8  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#9  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 13 (Thread 0x7f439a481700 (LWP 1725)):
#0  0x00007f43c552a03f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836c8b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c982fc3b in QSemaphore::acquire(int) () from /usr/lib/libQt5Core.so.5
#3  0x00007f43cff9e62a in KisTileDataPooler::waitForWork() () from /home/raghu/kf5/inst/lib64/libkritaimage.so.15
#4  0x00007f43cff9e6d2 in KisTileDataPooler::run() () from /home/raghu/kf5/inst/lib64/libkritaimage.so.15
#5  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#6  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#7  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 12 (Thread 0x7f4399c80700 (LWP 1726)):
#0  0x00007f43c552a03f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836c8b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c982fef6 in QSemaphore::tryAcquire(int, int) () from /usr/lib/libQt5Core.so.5
#3  0x00007f43cffb9eb8 in KisTileDataSwapper::waitForWork() () from /home/raghu/kf5/inst/lib64/libkritaimage.so.15
#4  0x00007f43cffb9ed4 in KisTileDataSwapper::run() () from /home/raghu/kf5/inst/lib64/libkritaimage.so.15
#5  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#6  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#7  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 11 (Thread 0x7f439947f700 (LWP 1728)):
#0  0x00007f43c552a03f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836c8b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43ca95d3a2 in ?? () from /usr/lib/libQt5Widgets.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 10 (Thread 0x7f4384f3f700 (LWP 1763)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 9 (Thread 0x7f436dbfe700 (LWP 1764)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 8 (Thread 0x7f4386742700 (LWP 1765)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 7 (Thread 0x7f436d3fd700 (LWP 1766)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 6 (Thread 0x7f4385f41700 (LWP 1767)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7f437ffff700 (LWP 1768)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7f436e3ff700 (LWP 1769)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7f436cbfc700 (LWP 1770)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7f435fbff700 (LWP 1771)):
#0  0x00007f43c552a3e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f43c9836bc6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
#2  0x00007f43c98322dc in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f43c9835de8 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f43c5524424 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f43c8c34cbd in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f43d165e840 (LWP 1722)):
[KCrash Handler]
#5  0x00007f43d0568902 in KisBrush::scale() const () from /home/raghu/kf5/inst/lib64/libkritalibbrush.so.15
#6  0x00007f43a5ea5037 in KisBrushBasedPaintOpSettings::brushOutlineImpl(KisPaintInformation const&, KisPaintOpSettings::OutlineMode, double, bool) const () from /home/raghu/kf5/inst/lib64/libkritalibpaintop.so.15
#7  0x00007f43a57a6fd5 in KisDuplicateOpSettings::brushOutline(KisPaintInformation const&, KisPaintOpSettings::OutlineMode) const () from /home/raghu/kf5/inst/lib64/kritaplugins/kritadefaultpaintops.so
#8  0x00007f43d0e2d04b in KisToolFreehandHelper::paintOpOutline(QPointF const&, KoPointerEvent const*, KisPaintOpSettings const*, KisPaintOpSettings::OutlineMode) const () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#9  0x00007f43d0e27ed7 in KisToolFreehand::getOutlinePath(QPointF const&, KoPointerEvent const*, KisPaintOpSettings::OutlineMode) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#10 0x00007f43d0e39f12 in KisToolPaint::requestUpdateOutline(QPointF const&, KoPointerEvent const*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#11 0x00007f43d0e26d56 in KisToolFreehand::continuePrimaryAction(KoPointerEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#12 0x00007f43d0bfd343 in KisToolProxy::forwardToTool(KisToolProxy::ActionState, KisTool::ToolAction, QEvent*, QPointF const&) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#13 0x00007f43d0bfce8b in KisToolProxy::forwardEvent(KisToolProxy::ActionState, KisTool::ToolAction, QEvent*, QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#14 0x00007f43d0ed090e in KisToolInvocationAction::inputEvent(QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#15 0x00007f43d0ed7b43 in KisShortcutMatcher::pointerMoved(QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#16 0x00007f43d0ec5bb3 in KisInputManager::eventFilterImpl(QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#17 0x00007f43d0ec52c3 in KisInputManager::eventFilter(QObject*, QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#18 0x00007f43c9a09282 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#19 0x00007f43ca72d665 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#20 0x00007f43ca733fbc in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#21 0x00007f43d0f555af in KisApplication::notify(QObject*, QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#22 0x00007f43c9a09518 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#23 0x00007f43d100d6c0 in QCoreApplication::sendEvent(QObject*, QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#24 0x00007f43d101975d in processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#25 0x00007f43d101932b in QWindowSystemInterface::handleTabletEvent(QWindow*, QPointF const&, QPointF const&, int, int, QFlags<Qt::MouseButton>, double, int, int, double, double, int, long long, QFlags<Qt::KeyboardModifier>) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#26 0x00007f43d1013c4b in QXcbConnection::xi2ReportTabletEvent(QXcbConnection::TabletData&, void*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#27 0x00007f43d10131fd in QXcbConnection::xi2HandleTabletEvent(void*, QXcbConnection::TabletData*, QWindow*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#28 0x00007f43d10125ff in QXcbConnection::xi2HandleEvent(xcb_ge_event_t*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#29 0x00007f43d101b57b in KisXi2EventFilter::nativeEventFilter(QByteArray const&, void*, long*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#30 0x00007f43c9a0684f in QAbstractEventDispatcher::filterNativeEvent(QByteArray const&, void*, long*) () from /usr/lib/libQt5Core.so.5
#31 0x00007f43be15a9d5 in QXcbConnection::handleXcbEvent(xcb_generic_event_t*) () from /usr/lib/libQt5XcbQpa.so.5
#32 0x00007f43be15b906 in QXcbConnection::processXcbEvents() () from /usr/lib/libQt5XcbQpa.so.5
#33 0x00007f43c9a36659 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#34 0x00007f43ca72d68c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#35 0x00007f43ca7328f6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#36 0x00007f43d0f555af in KisApplication::notify(QObject*, QEvent*) () from /home/raghu/kf5/inst/lib64/libkritaui.so.15
#37 0x00007f43c9a09518 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#38 0x00007f43c9a0b3da in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5
#39 0x00007f43c9a5e883 in ?? () from /usr/lib/libQt5Core.so.5
#40 0x00007f43c4056f07 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#41 0x00007f43c4057160 in ?? () from /usr/lib/libglib-2.0.so.0
#42 0x00007f43c405720c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#43 0x00007f43c9a5ec8f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#44 0x00007f43c9a076fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#45 0x00007f43c9a0fb7c in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#46 0x00000000004081b1 in main ()
Comment 4 Halla Rempt 2016-04-13 13:04:50 UTC
Ah, I can confirm, too. I was mislead because of the "you cannot select the only item in the resource selector bug"... And I was wondering why the clone tool painted black, too....
Comment 5 Halla Rempt 2016-04-13 14:57:13 UTC
I suspect commit 00d78c05af9c4fd9081431c0177db465d934119a,  "Added a hack that keeps a KisBrush object available during painting"
Comment 6 Halla Rempt 2016-04-13 15:15:30 UTC
Yes... https://phabricator.kde.org/T2246
Comment 7 Dmitry Kazakov 2016-04-15 18:47:04 UTC
Git commit 39ce4e79e84658fb5414a314d3ba08293a484643 by Dmitry Kazakov.
Committed on 15/04/2016 at 18:46.
Pushed by dkazakov into branch 'master'.

Fix clone brush

Do not skip calling parent class implementation

Fixes T2246

M  +1    -1    plugins/paintops/defaultpaintops/duplicate/kis_duplicateop_settings.cpp

http://commits.kde.org/krita/39ce4e79e84658fb5414a314d3ba08293a484643