Bug 319855

Summary: Crash when selecting Layer Properties on a Filter mask layer type "Color Adjustment" or "Brightness / Contrast" applied on a cloned layer or group layer
Product: [Applications] krita Reporter: vanyossi <ghevan>
Component: Filter LayersAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: File with filter masks in groups and clones

Description vanyossi 2013-05-15 03:12:24 UTC
Test file attached.

If a Filter mask of type "Color Adjustment" or "Brightness / Contrast" is applied to clone or group. selecting that filter mask properties to adjust values will crash krita.

Reproducible: Always

Steps to Reproduce:
1.Add a filter mask of type "Color Adjustment" or "Brightness / Contrast" to a clone or group layer
2. Right click on filter mask just created
3. Select properties to adjust values

Actual Results:  
Krita crash


As far as I can observe it only crashes on Filters with a Curve widget in it.
Comment 1 vanyossi 2013-05-15 03:13:46 UTC
Created attachment 79891 [details]
File with filter masks in groups and clones
Comment 2 Halla Rempt 2013-05-18 09:03:54 UTC
Ack, I see the assert:
krita(10077): "[
0: /usr/lib64/libkdecore.so.5(kRealBacktrace(int)+0x38) [0x7f5d70aded38]
1: /home/boud/kde/master/lib64/kde4/kritacolorsfilters.so(+0x1b233) [0x7f5d61a67233]
2: /home/boud/kde/master/lib64/kde4/kritacolorsfilters.so(+0x1b8f2) [0x7f5d61a678f2]
3: /home/boud/kde/inst/lib64/libkritaui.so.13(+0x195656) [0x7f5d78179656]
4: /home/boud/kde/inst/lib64/libkritaui.so.13(+0x292f29) [0x7f5d78276f29]
5: /home/boud/kde/inst/lib64/libkritaui.so.13(KisNodeManager::nodeProperties(KisSharedPtr<KisNode>)+0x6a) [0x7f5d782897fa]
6: /home/boud/kde/master/lib64/kde4/kritadefaultdockers.so(+0x16eb3) [0x7f5d50d0beb3]
7: /home/boud/kde/master/lib64/kde4/kritadefaultdockers.so(+0x1db60) [0x7f5d50d12b60]
8: /usr/lib64/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x2bf) [0x7f5d78aeb29f]
9: /usr/lib64/libQtGui.so.4(QAction::triggered(bool)+0x32) [0x7f5d712d5662]
10: /usr/lib64/libQtGui.so.4(QAction::activate(QAction::ActionEvent)+0x70) [0x7f5d712d5850]
11: /usr/lib64/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x2bf) [0x7f5d78aeb29f]
12: /usr/lib64/libQtGui.so.4(QAbstractButton::clicked(bool)+0x32) [0x7f5d71940702]
13: /usr/lib64/libQtGui.so.4(+0x59804e) [0x7f5d7169504e]
14: /usr/lib64/libQtGui.so.4(+0x598880) [0x7f5d71695880]
15: /usr/lib64/libQtGui.so.4(QAbstractButton::mouseReleaseEvent(QMouseEvent*)+0x8c) [0x7f5d71695aec]
16: /usr/lib64/libQtGui.so.4(QToolButton::mouseReleaseEvent(QMouseEvent*)+0xa) [0x7f5d7174fe1a]
17: /usr/lib64/libQtGui.so.4(QWidget::event(QEvent*)+0x929) [0x7f5d7132b149]
18: /usr/lib64/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0xac) [0x7f5d712db86c]
19: /usr/lib64/libQtGui.so.4(QApplication::notify(QObject*, QEvent*)+0x99b) [0x7f5d712e054b]
20: /home/boud/kde/inst/lib64/libkomain.so.13(KoApplication::notify(QObject*, QEvent*)+0x28) [0x7f5d776e8dc8]
21: /usr/lib64/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, QEvent*)+0x8e) [0x7f5d78ad5d8e]
22: /usr/lib64/libQtGui.so.4(QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)+0x14b) [0x7f5d712dc6ab]
23: /usr/lib64/libQtGui.so.4(+0x259e94) [0x7f5d71356e94]
24: /usr/lib64/libQtGui.so.4(QApplication::x11ProcessEvent(_XEvent*)+0xb11) [0x7f5d71355c21]
25: /usr/lib64/libQtGui.so.4(+0x27f9d9) [0x7f5d7137c9d9]
26: /usr/lib64/libQtCore.so.4(QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x2f) [0x7f5d78ad4adf]
27: /usr/lib64/libQtCore.so.4(QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+0x138) [0x7f5d78ad4d68]
28: /usr/lib64/libQtCore.so.4(QCoreApplication::exec()+0x88) [0x7f5d78ad9a08]
29: /home/boud/kde/inst/lib64/libkdeinit4_krita.so(kdemain+0x212) [0x7f5d79070902]
30: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f5d6fbb7a15]
31: krita() [0x400a21]
]
" 
ASSERT: "dev" in file /home/boud/kde/src/calligra/krita/plugins/filters/colorsfilters/kis_perchannel_filter.cpp, line 56

And the crash dump:

Thread 1 (Thread 0x7f5d796a6780 (LWP 10077)):
[KCrash Handler]
#5  0x00007f5d6fbcb3d5 in raise () from /lib64/libc.so.6
#6  0x00007f5d6fbcc858 in abort () from /lib64/libc.so.6
#7  0x00007f5d789cfc54 in qt_message_output(QtMsgType, char const*) () from /usr/lib64/libQtCore.so.4
#8  0x00007f5d789cfe08 in ?? () from /usr/lib64/libQtCore.so.4
#9  0x00007f5d789cff94 in qFatal(char const*, ...) () from /usr/lib64/libQtCore.so.4
#10 0x00007f5d789cffda in qt_assert(char const*, char const*, int) () from /usr/lib64/libQtCore.so.4
#11 0x00007f5d61a672f4 in KisPerChannelConfigWidget::KisPerChannelConfigWidget (this=0x7ee0870, parent=<optimized out>, dev=..., f=...) at /home/boud/kde/src/calligra/krita/plugins/filters/colorsfilters/kis_perchannel_filter.cpp:56
#12 0x00007f5d61a678f2 in KisPerChannelFilter::createConfigurationWidget (this=<optimized out>, parent=0x760b010, dev=...) at /home/boud/kde/src/calligra/krita/plugins/filters/colorsfilters/kis_perchannel_filter.cpp:411
#13 0x00007f5d78179656 in KisDlgAdjLayerProps::KisDlgAdjLayerProps (this=0x7fff36dd0190, node=..., nfi=<optimized out>, paintDevice=..., view=0x327de50, configuration=<optimized out>, layerName=..., caption=..., parent=0x327de50, name=0x7f5d78443745 "dlgeffectmaskprops") at /home/boud/kde/src/calligra/krita/ui/dialogs/kis_dlg_adj_layer_props.cc:93
#14 0x00007f5d78276f29 in KisMaskManager::maskProperties (this=0x4d83ae0) at /home/boud/kde/src/calligra/krita/ui/kis_mask_manager.cc:280
#15 0x00007f5d782897fa in KisNodeManager::nodeProperties (this=0x4d83870, node=...) at /home/boud/kde/src/calligra/krita/ui/kis_node_manager.cpp:399
#16 0x00007f5d50d0beb3 in KisLayerBox::slotPropertiesClicked (this=this@entry=0x47f1e30) at /home/boud/kde/src/calligra/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp:664
#17 0x00007f5d50d12b60 in KisLayerBox::qt_static_metacall (_o=0x47f1e30, _id=<optimized out>, _a=0x7fff36dd0460, _c=<optimized out>) at /home/boud/kde/build/calligra/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.moc:118
#18 0x00007f5d78aeb29f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#19 0x00007f5d712d5662 in QAction::triggered(bool) () from /usr/lib64/libQtGui.so.4
#20 0x00007f5d712d5850 in QAction::activate(QAction::ActionEvent) () from /usr/lib64/libQtGui.so.4
#21 0x00007f5d78aeb29f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#22 0x00007f5d71940702 in QAbstractButton::clicked(bool) () from /usr/lib64/libQtGui.so.4
#23 0x00007f5d7169504e in ?? () from /usr/lib64/libQtGui.so.4
#24 0x00007f5d71695880 in ?? () from /usr/lib64/libQtGui.so.4
#25 0x00007f5d71695aec in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQtGui.so.4
#26 0x00007f5d7174fe1a in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQtGui.so.4
#27 0x00007f5d7132b149 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#28 0x00007f5d712db86c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#29 0x00007f5d712e054b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#30 0x00007f5d776e8dc8 in KoApplication::notify (this=<optimized out>, receiver=0x481b900, event=0x7fff36dd0ea0) at /home/boud/kde/src/calligra/libs/main/KoApplication.cpp:556
#31 0x00007f5d78ad5d8e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#32 0x00007f5d712dc6ab in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQtGui.so.4
#33 0x00007f5d71356e94 in ?? () from /usr/lib64/libQtGui.so.4
#34 0x00007f5d71355c21 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#35 0x00007f5d7137c9d9 in ?? () from /usr/lib64/libQtGui.so.4
#36 0x00007f5d78ad4adf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#37 0x00007f5d78ad4d68 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#38 0x00007f5d78ad9a08 in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#39 0x00007f5d79070902 in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/boud/kde/src/calligra/krita/main.cc:79
#40 0x00007f5d6fbb7a15 in __libc_start_main () from /lib64/libc.so.6
#41 0x0000000000400a21 in _start () at ../sysdeps/x86_64/start.S:123
Comment 3 Halla Rempt 2013-05-18 09:09:50 UTC
Git commit 0b8b9c7a04d8cf3a28277d0d9e0021737e4ffb2f by Boudewijn Rempt.
Committed on 18/05/2013 at 11:08.
Pushed by rempt into branch 'master'.

Do not crash when editing a filter mask on a clone layer

Some filters need direct access to a paint device, and the clone layer
doesn't have one. Return the original paint device in that case.

M  +14   -0    krita/ui/kis_mask_manager.cc

http://commits.kde.org/calligra/0b8b9c7a04d8cf3a28277d0d9e0021737e4ffb2f
Comment 4 vanyossi 2013-05-21 01:21:17 UTC
Almost done but still "Group layers" crash Krita. 
I must reopen because of that.

The file provided before includes both cases for test.
Layers called "Group filter mask" are applied to the folder, in this case it's called "Layer 6". the problem must be the same, but in this case I don't think there is an original paint device as it is a Group layer.  wish I could help more than just reporting =(

Aside from that it is working perfectly on clone layers.
Thanks a lot boud!
Comment 5 Halla Rempt 2013-05-21 07:13:34 UTC
Ok -- this should be fixable as well.
Comment 6 Halla Rempt 2013-05-21 07:36:26 UTC
Git commit b30bf50fe0d940c77837895991999e5b71ca2509 by Boudewijn Rempt.
Committed on 21/05/2013 at 09:35.
Pushed by rempt into branch 'master'.

Don't crash when opening a filter mask properties dialog for group layers

M  +0    -1    krita/image/kis_paint_layer.h
M  +3    -11   krita/ui/kis_mask_manager.cc

http://commits.kde.org/calligra/b30bf50fe0d940c77837895991999e5b71ca2509
Comment 7 Halla Rempt 2013-05-31 08:35:03 UTC
Git commit 259b71b03ee3931e7b6a7f87c63475f96592475d by Boudewijn Rempt.
Committed on 21/05/2013 at 09:35.
Pushed by rempt into branch 'calligra/2.7'.

Don't crash when opening a filter mask properties dialog for group layers

M  +0    -1    krita/image/kis_paint_layer.h
M  +3    -11   krita/ui/kis_mask_manager.cc

http://commits.kde.org/calligra/259b71b03ee3931e7b6a7f87c63475f96592475d