Bug 356997 - Krita crashes when I try to draw on the preview field for "Tangent Normal"
Summary: Krita crashes when I try to draw on the preview field for "Tangent Normal"
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: 3.0 Beta
Platform: Microsoft Windows Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-21 12:40 UTC by Adam Piter
Modified: 2016-05-27 01:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
App crash when drawing in the preview field here (317.00 KB, image/png)
2015-12-21 12:41 UTC, Adam Piter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Piter 2015-12-21 12:40:22 UTC
All the other Brush Engines work fine in the preview, the Krita app crashes the second I put my pencil and try to draw with the "Tangent Normal" Brush Engine on the preview field.

Reproducible: Always

Steps to Reproduce:
1. Go to brush engines
2. select "Tangent Normal"
3. Try to draw on the preview field, immediate app crash.

Actual Results:  
App crashes


OS: Win 10 x64bit
CPU: I7-4770
GPU: GTX960
Wacom Tablet
Comment 1 Adam Piter 2015-12-21 12:41:56 UTC
Created attachment 96227 [details]
App crash when drawing in the preview field here
Comment 2 wolthera 2016-01-06 18:24:40 UTC
Could you clear you config and check if it happens again?

Instructions here: https://userbase.kde.org/Krita/Manual/FAQ#Resetting_Krita_configuration
Comment 3 Andy 2016-05-18 16:38:12 UTC
I also confirm this bug.

I use recent *krita-3.0-RC-1-master-6f75b0f-x86_64.appimage*. Just downloaded it, launched, created new custom document, selected Tangent Normal brush from brush menu and tried to draw.

'Segmentation fault' appears every time I try to draw with this brush whether on canvas or preview area.

I tried to remove all personal Krita data by 

    rm -r ~/.local/share/{k,K}rita ~/.config/krita*

and draw again, but it crashes all the same when I just click on a canvas with this brush.
Comment 4 wolthera 2016-05-18 17:00:15 UTC
Okay, I have a backtrace, but this is definitely for dmitry, considering it has to dow with the stroke framework.

Thread 25 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff98a38700 (LWP 19210)]
KisBrushBasedPaintOp::KisBrushBasedPaintOp (this=0x7fff8c1f57c0, 
    settings=0x12936eb0, painter=<optimized out>)
    at /home/krita/kde/src/krita/plugins/paintops/libpaintop/kis_brush_based_paintop.cpp:91
91	    m_brush->notifyStrokeStarted();
(gdb) thread apply all backtrace

Thread 25 (Thread 0x7fff98a38700 (LWP 19210)):
#0  KisBrushBasedPaintOp::KisBrushBasedPaintOp (this=0x7fff8c1f57c0, 
    settings=0x12936eb0, painter=<optimized out>)
    at /home/krita/kde/src/krita/plugins/paintops/libpaintop/kis_brush_based_paintop.cpp:91
#1  0x00007fffb2d165e1 in KisTangentNormalPaintOp::KisTangentNormalPaintOp (
    this=0x7fff8c1f57c0, settings=0x12936eb0, painter=0xe703310, node=..., 
    image=...)
    at /home/krita/kde/src/krita/plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp:39
#2  0x00007fffb2d1465e in KisSimplePaintOpFactory<KisTangentNormalPaintOp, KisBrushBasedPaintOpSettings, KisTangentNormalPaintOpSettingsWidget>::createOp (
    this=<optimized out>, settings=..., painter=0xe703310, node=..., image=...)
    at /home/krita/kde/src/krita/plugins/paintops/libpaintop/kis_simple_paintop_factory.h:97
#3  0x00007ffff3135eb0 in KisPaintOpRegistry::paintOp (
    this=this@entry=0x7ffff359fac0 <(anonymous namespace)::Q_QGS_s_registryInstance::innerFunction()::holder>, id=..., settings=..., 
    painter=painter@entry=0xe703310, node=..., image=...)
    at /home/krita/kde/src/krita/libs/image/brushengine/kis_paintop_registry.cc:104
#4  0x00007ffff313609a in KisPaintOpRegistry::paintOp (
---Type <return> to continue, or q <return> to quit---
    this=0x7ffff359fac0 <(anonymous namespace)::Q_QGS_s_registryInstance::innerFunction()::holder>, preset=..., painter=painter@entry=0xe703310, node=..., 
    image=...)
    at /home/krita/kde/src/krita/libs/image/brushengine/kis_paintop_registry.cc:120
#5  0x00007ffff3121275 in KisPainter::setPaintOpPreset (
    this=this@entry=0xe703310, preset=..., node=..., image=...)
    at /home/krita/kde/src/krita/libs/image/kis_painter.cc:2584
#6  0x00007ffff7813152 in KisResourcesSnapshot::setupPainter (this=0x12b4c3f0, 
    painter=painter@entry=0xe703310)
    at /home/krita/kde/src/krita/libs/ui/tool/kis_resources_snapshot.cpp:165
#7  0x00007ffff7816704 in KisPainterBasedStrokeStrategy::initPainters (
    this=this@entry=0x11b8a130, targetDevice=..., selection=..., 
    hasIndirectPainting=false, indirectPaintingCompositeOp=...)
    at /home/krita/kde/src/krita/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp:157
#8  0x00007ffff7817348 in KisPainterBasedStrokeStrategy::initStrokeCallback (
    this=0x11b8a130)
    at /home/krita/kde/src/krita/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp:213
#9  0x00007ffff32f61e1 in KisStrokeJob::run (this=<optimized out>)
    at /home/krita/kde/build/libs/image/../../../src/krita/libs/image/kis_stroke_job.h:44
---Type <return> to continue, or q <return> to quit---
#10 KisUpdateJobItem::run (this=0xf047480)
    at /home/krita/kde/build/libs/image/../../../src/krita/libs/image/kis_update_job_item.h:66
#11 0x00007ffff559630d in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#12 0x00007ffff5599c89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#13 0x00007fffef14c6fa in start_thread (arg=0x7fff98a38700)
    at pthread_create.c:333
#14 0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 11 (Thread 0x7fffa3fff700 (LWP 19194)):
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff559a7eb in QWaitCondition::wait(QMutex*, unsigned long) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#2  0x00007ffff6770aa2 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#3  0x00007ffff5599c89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#4  0x00007fffef14c6fa in start_thread (arg=0x7fffa3fff700)
    at pthread_create.c:333
---Type <return> to continue, or q <return> to quit---
#5  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 10 (Thread 0x7fffa886c700 (LWP 19193)):
#0  0x00007ffff4c5a8dd in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff5641f7d in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#2  0x00007ffff5599138 in QThread::msleep(unsigned long) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#3  0x00007ffff311a58a in KisTileDataSwapper::run (
    this=0x7ffff359f480 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>)
    at /home/krita/kde/src/krita/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:97
#4  0x00007ffff5599c89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#5  0x00007fffef14c6fa in start_thread (arg=0x7fffa886c700)
    at pthread_create.c:333
#6  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 9 (Thread 0x7fffbbfff700 (LWP 19192)):
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
---Type <return> to continue, or q <return> to quit---
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff559a7eb in QWaitCondition::wait(QMutex*, unsigned long) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#2  0x00007ffff5593e8b in QSemaphore::acquire(int) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#3  0x00007ffff310074e in KisTileDataPooler::waitForWork (
    this=0x7ffff359f440 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>)
    at /home/krita/kde/src/krita/libs/image/tiles3/kis_tile_data_pooler.cc:165
#4  0x00007ffff3100f0a in KisTileDataPooler::run (
    this=0x7ffff359f440 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>)
    at /home/krita/kde/src/krita/libs/image/tiles3/kis_tile_data_pooler.cc:187
#5  0x00007ffff5599c89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#6  0x00007fffef14c6fa in start_thread (arg=0x7fffbbfff700)
    at pthread_create.c:333
#7  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7fffcbfff700 (LWP 19188)):
#0  0x00007ffff4c89e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee82131c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#2  0x00007fffee82142c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff57ab4fc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#4  0x00007ffff5759efa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#5  0x00007ffff559538c in QThread::exec() ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#6  0x00007fffef377cd5 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5DBus.so.5
#7  0x00007ffff5599c89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#8  0x00007fffef14c6fa in start_thread (arg=0x7fffcbfff700)
    at pthread_create.c:333
#9  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7fffd903c700 (LWP 19187)):
#0  0x00007ffff4c89e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee82131c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee8216a2 in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffde499906 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#4  0x00007fffee847b45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fffef14c6fa in start_thread (arg=0x7fffd903c700)
    at pthread_create.c:333
#6  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7fffd983d700 (LWP 19186)):
#0  0x00007ffff4c89e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee82131c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee82142c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffee821469 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fffee847b45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fffef14c6fa in start_thread (arg=0x7fffd983d700)
    at pthread_create.c:333
#6  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fffda03e700 (LWP 19185)):
#0  0x00007ffff4c89e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee82131c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee82142c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#3  0x00007fffda04628d in ?? ()
   from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007fffee847b45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fffef14c6fa in start_thread (arg=0x7fffda03e700)
    at pthread_create.c:333
#6  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fffe4859700 (LWP 19184)):
#0  0x00007ffff4c89e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff35b8c62 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007ffff35ba8d7 in xcb_wait_for_event ()
   from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fffe5708dc9 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5
#4  0x00007ffff5599c89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#5  0x00007fffef14c6fa in start_thread (arg=0x7fffe4859700)
    at pthread_create.c:333
#6  0x00007ffff4c95b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7f0f8c0 (LWP 19179)):
---Type <return> to continue, or q <return> to quit---
#0  0x00007ffff4c8b687 in ioctl () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffe75640f8 in drmIoctl ()
   from /usr/lib/x86_64-linux-gnu/libdrm.so.2
#2  0x00007fffd8408340 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libdrm_intel.so.1
#3  0x00007fffd840a68a in drm_intel_gem_bo_context_exec ()
   from /usr/lib/x86_64-linux-gnu/libdrm_intel.so.1
#4  0x00007fffcb362845 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fffcb329d9c in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#6  0x00007fffcb14986a in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#7  0x00007ffff77d127b in QOpenGLFunctions::glDrawArrays (count=6, first=0, 
    mode=4, this=0xef59120)
    at /home/krita/Qt/5.6/gcc_64/include/QtGui/qopenglfunctions.h:717
#8  KisOpenGLCanvas2::drawImage (this=this@entry=0xef590f0)
    at /home/krita/kde/src/krita/libs/ui/opengl/kis_opengl_canvas2.cpp:562
#9  0x00007ffff77d17a8 in KisOpenGLCanvas2::renderCanvasGL (
    this=this@entry=0xef590f0)
    at /home/krita/kde/src/krita/libs/ui/opengl/kis_opengl_canvas2.cpp:750
#10 0x00007ffff77d1887 in KisOpenGLCanvas2::paintGL (this=0xef590f0)
    at /home/krita/kde/src/krita/libs/ui/opengl/kis_opengl_canvas2.cpp:244
#11 0x00007ffff65b07e5 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#12 0x00007ffff6591308 in QWidget::event(QEvent*) ()
---Type <return> to continue, or q <return> to quit---
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#13 0x00007ffff654f04c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#14 0x00007ffff6553488 in QApplication::notify(QObject*, QEvent*) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#15 0x00007ffff78dcbc7 in KisApplication::notify (this=<optimized out>, 
    receiver=0xef590f0, event=0x7fffffffca40)
    at /home/krita/kde/src/krita/libs/ui/KisApplication.cpp:502
#16 0x00007ffff575be80 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
    () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#17 0x00007ffff658a71a in QWidgetPrivate::sendPaintEvent(QRegion const&) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#18 0x00007ffff655b387 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#19 0x00007ffff655bea9 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#20 0x00007ffff657b6ef in QWidgetPrivate::syncBackingStore() ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#21 0x00007ffff65913d0 in QWidget::event(QEvent*) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#22 0x00007ffff669f01b in QMainWindow::event(QEvent*) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#23 0x00007ffff6f75437 in KMainWindow::event (this=this@entry=0xdc07870, 
---Type <return> to continue, or q <return> to quit---
    ev=ev@entry=0x12b680a0)
    at /home/krita/kde/src/krita/libs/widgetutils/xmlgui/kmainwindow.cpp:780
#24 0x00007ffff6fada49 in KXmlGuiWindow::event (this=0xdc07870, ev=0x12b680a0)
    at /home/krita/kde/src/krita/libs/widgetutils/xmlgui/kxmlguiwindow.cpp:125
#25 0x00007ffff654f04c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#26 0x00007ffff6553488 in QApplication::notify(QObject*, QEvent*) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Widgets.so.5
#27 0x00007ffff78dcbc7 in KisApplication::notify (this=<optimized out>, 
    receiver=0xdc07870, event=0x12b680a0)
    at /home/krita/kde/src/krita/libs/ui/KisApplication.cpp:502
#28 0x00007ffff575be80 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
    () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#29 0x00007ffff575e673 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#30 0x00007ffff57ab0f3 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#31 0x00007fffee821127 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007fffee821380 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007fffee82142c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff57ab4e7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop:---Type <return> to continue, or q <return> to quit---
:ProcessEventsFlag>) () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#35 0x00007ffff5759efa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#36 0x00007ffff5761d9d in QCoreApplication::exec() ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#37 0x000000000040496d in main (argc=1, argv=<optimized out>)
    at /home/krita/kde/src/krita/krita/main.cc:231
(gdb) q
A debugging session is active.

	Inferior 1 [process 19179] will be killed.

Quit anyway? (y or n) y
krita@krita-2012-Client-Platform:~/kde/build$
Comment 5 Dmitry Kazakov 2016-05-20 06:45:55 UTC
It seems like KisBrushBasedPaintOp::m_brush does not get initialized for some reason. Although there is an explicit initialization before that:

    if (!m_brush) {
        KisBrushOption brushOption;
        brushOption.readOptionSetting(settings);
        m_brush = brushOption.brush();
    }

    m_brush->notifyStrokeStarted();
Comment 6 Dmitry Kazakov 2016-05-24 16:12:44 UTC
Git commit 18343baa19e296fb8c80464bbc8d1fccd231ef69 by Dmitry Kazakov.
Committed on 24/05/2016 at 16:08.
Pushed by dkazakov into branch 'master'.

Fix default preset for TangentNormal brush

The preset has wrong paintop id: 'tangennormal' instead of 'tangentnormal'

Fixes T2539

M  +-    --    plugins/paintops/defaultpresets/tangentnormal.kpp

http://commits.kde.org/krita/18343baa19e296fb8c80464bbc8d1fccd231ef69
Comment 7 Andy 2016-05-27 01:19:35 UTC
(In reply to Dmitry Kazakov from comment #6)

Thanks you, Dmitry! It was fast. Typos like that are really hard to find sometimes. I stared for a minute at ids before I mentioned the differenece :)