Bug 378656 - Crash when undoing a quick group when a label filter is active on the layerbox
Summary: Crash when undoing a quick group when a label filter is active on the layerbox
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 3.1.3-beta
Platform: Other All
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2017-04-11 09:05 UTC by SirPigeonz
Modified: 2019-05-13 11:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
crash log color labels and R + LMB (25.78 KB, text/plain)
2017-04-11 09:05 UTC, SirPigeonz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SirPigeonz 2017-04-11 09:05:25 UTC
Created attachment 104961 [details]
crash log color labels and R + LMB

I attach crash log.

How to reproduce:
1 create new layer and paint something on it
2 create new layer and also paint on it
3 set color label on 2nd layer
4 select first layer and add it to a group layer
5 turn on color label filtering to color of 2nd layer
6 try few times selecting random layers with R+LMB

Usually crashes after few click, I suspect mostly with selecting the lowest layer.
Comment 1 SirPigeonz 2017-04-11 09:29:04 UTC
Checked 3.1.3 crashes there also.
Comment 2 Halla Rempt 2017-05-16 12:07:49 UTC
Hm, looks like I can only reproduce this on Windows, but I can reproduce it there.
Comment 3 Antti Savolainen 2018-06-26 19:16:38 UTC
Oh, this is exiting finding a working crash in old reports

I followed your instructions and and kinda panicked when after left and right clicking layers started disappearing. I Ctrl+z a couple of times to reverse the changes, which came out not as it was supposed to and eventually a crash.

Build & Platform:

    krita 4.1.0-pre-alpha (git hash: 4a3af9a)
    Xubuntu 17.10

Video demonstrating the crash: https://www.youtube.com/watch?v=Yn1TIg22ro0

Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
__memmove_avx_unaligned_erms ()
    at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:489
489	../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0  0x00007ffff40230e5 in __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:489
#1  0x00007ffff4a71aea in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007ffff4a71d03 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff4a74358 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff4ad98e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff4a462be in QAbstractItemModel::rowsAboutToBeRemoved(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff4a4d21b in QAbstractItemModel::beginRemoveRows(QModelIndex const&, int, int) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff7008a9e in KisNodeModel::slotBeginRemoveDummy(KisNodeDummy*) (this=0x555561a985e0, dummy=0x55555981b020) at /home/managor/Sourcebuilding/krita/libs/ui/kis_node_model.cpp:348
#8  0x00007ffff73ecd35 in KisNodeModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x555561a985e0, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffffffc800)
    at /home/managor/Sourcebuilding/b-krita/libs/ui/kritaui_autogen/EWIEGA46WW/moc_kis_node_model.cpp:124
#9  0x00007ffff4ad98e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff73e2064 in KisDummiesFacadeBase::sigBeginRemoveDummy(KisNodeDummy*) (this=0x555561fd00f0, _t1=0x55555981b020) at /home/managor/Sourcebuilding/b-krita/libs/ui/kritaui_autogen/QUY67KCZCL/moc_kis_dummies_facade_base.cpp:281
#11 0x00007ffff6f49be2 in KisDummiesFacadeBase::slotContinueRemoveNode(KisSharedPtr<KisNode>) (this=0x555561fd00f0, node=...) at /home/managor/Sourcebuilding/krita/libs/ui/flake/kis_dummies_facade_base.cpp:153
#12 0x00007ffff73e18b3 in KisDummiesFacadeBase::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x555561fd00f0, _c=QMetaObject::InvokeMetaMethod, _id=14, _a=0x7fffffffca70)
    at /home/managor/Sourcebuilding/b-krita/libs/ui/kritaui_autogen/QUY67KCZCL/moc_kis_dummies_facade_base.cpp:148
#13 0x00007ffff4ad98e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff73e1ef4 in KisDummiesFacadeBase::sigContinueRemoveNode(KisSharedPtr<KisNode>) (this=0x555561fd00f0, _t1=...) at /home/managor/Sourcebuilding/b-krita/libs/ui/kritaui_autogen/QUY67KCZCL/moc_kis_dummies_facade_base.cpp:260
#15 0x00007ffff6f497cc in KisDummiesFacadeBase::slotRemoveNode(KisSharedPtr<KisNode>) (this=0x555561fd00f0, node=...) at /home/managor/Sourcebuilding/krita/libs/ui/flake/kis_dummies_facade_base.cpp:133
#16 0x00007ffff73e17da in KisDummiesFacadeBase::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x555561fd00f0, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7fffffffcce0)
    at /home/managor/Sourcebuilding/b-krita/libs/ui/kritaui_autogen/QUY67KCZCL/moc_kis_dummies_facade_base.cpp:146
#17 0x00007ffff4ad98e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff1d33562 in KisImage::sigRemoveNodeAsync(KisSharedPtr<KisNode>) (this=0x555561f46bf0, _t1=...) at /home/managor/Sourcebuilding/b-krita/libs/image/kritaimage_autogen/EWIEGA46WW/moc_kis_image.cpp:726
#19 0x00007ffff1d3197f in KisImage::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x555561f46bf0, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0x7fffffffcfc0)
    at /home/managor/Sourcebuilding/b-krita/libs/image/kritaimage_autogen/EWIEGA46WW/moc_kis_image.cpp:317
#20 0x00007ffff4ad98e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff1d34dfc in KisImageSignalRouter::sigRemoveNodeAsync(KisSharedPtr<KisNode>) (this=0x555561f0f100, _t1=...)
    at /home/managor/Sourcebuilding/b-krita/libs/image/kritaimage_autogen/EWIEGA46WW/moc_kis_image_signal_router.cpp:332
#22 0x00007ffff1b6b8bd in KisImageSignalRouter::emitAboutToRemoveANode(KisNode*, int) (this=0x555561f0f100, parent=0x555562026ed0, index=1) at /home/managor/Sourcebuilding/krita/libs/image/kis_image_signal_router.cpp:113
#23 0x00007ffff1b5674f in KisImage::aboutToRemoveANode(KisNode*, int) (this=0x555561f46bf0, parent=0x555562026ed0, index=1) at /home/managor/Sourcebuilding/krita/libs/image/kis_image.cc:372
#24 0x00007ffff1c123b2 in KisNode::remove(unsigned int) (this=0x555562026ed0, index=1) at /home/managor/Sourcebuilding/krita/libs/image/kis_node.cpp:521
#25 0x00007ffff1c125e8 in KisNode::remove(KisSharedPtr<KisNode>) (this=0x555562026ed0, node=...) at /home/managor/Sourcebuilding/krita/libs/image/kis_node.cpp:547
#26 0x00007ffff1c18314 in KisNodeFacade::removeNode(KisSharedPtr<KisNode>) (this=0x555561f46c20, node=...) at /home/managor/Sourcebuilding/krita/libs/image/kis_node_facade.cpp:142
#27 0x00007ffff1a24785 in KisImageLayerAddCommand::undo() (this=0x55556276dea0) at /home/managor/Sourcebuilding/krita/libs/image/commands/kis_image_layer_add_command.cpp:83
#28 0x00007ffff03436db in KUndo2Command::undoMergedCommands() (this=0x55556276dea0) at /home/managor/Sourcebuilding/krita/libs/command/kundo2stack.cpp:376
#29 0x00007ffff03450ac in KUndo2QStack::undo() (this=0x555561f0dc50) at /home/managor/Sourcebuilding/krita/libs/command/kundo2stack.cpp:935
#30 0x00007ffff72df725 in UndoStack::undo() (this=0x555561f0dc50) at /home/managor/Sourcebuilding/krita/libs/ui/KisDocument.cpp:200
#31 0x00007ffff730ad1b in KisMainWindow::undo() (this=0x55555a10c0e0) at /home/managor/Sourcebuilding/krita/libs/ui/KisMainWindow.cpp:1210
#32 0x00007ffff731560d in KisMainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x55555a10c0e0, _c=QMetaObject::InvokeMetaMethod, _id=43, _a=0x7fffffffd540)
    at /home/managor/Sourcebuilding/b-krita/libs/ui/kritaui_autogen/include/moc_KisMainWindow.cpp:340
#33 0x00007ffff4ad98e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007ffff581ed82 in QAction::triggered(bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#35 0x00007ffff582146c in QAction::activate(QAction::ActionEvent) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#36 0x00007ffff5821d15 in QAction::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#37 0x00007ffff582546c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#38 0x00007ffff582cd34 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#39 0x00007ffff72ca717 in KisApplication::notify(QObject*, QEvent*) (this=0x7fffffffde20, receiver=0x555561b44930, event=0x7fffffffd880) at /home/managor/Sourcebuilding/krita/libs/ui/KisApplication.cpp:626
#40 0x00007ffff4aaade8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#41 0x00007ffff5097d77 in QShortcutMap::dispatchEvent(QKeyEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#42 0x00007ffff5097e4a in QShortcutMap::tryShortcut(QKeyEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#43 0x00007ffff5047473 in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#44 0x00007ffff50669b7 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#45 0x00007ffff506ba05 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#46 0x00007ffff5043cab in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#47 0x00007fffe21005a0 in  () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#48 0x00007fffec03cfb7 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#49 0x00007fffec03d1f0 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#50 0x00007fffec03d27c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#51 0x00007ffff4b0347f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#52 0x00007ffff4aa8e3a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#53 0x00007ffff4ab1da4 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#54 0x0000555555e903cc in main(int, char**) (argc=1, argv=0x7fffffffdf88) at /home/managor/Sourcebuilding/krita/krita/main.cc:419
Comment 4 joupent 2018-10-08 12:47:39 UTC
I can get the same crash with the following steps:
1. Create a couple of layers
2. Set a color label on one of them.
3. Create a quick group from an unlabeled layer. Keep the layer inside the group active.
4. Set color filter.
5. Undo.
Comment 5 Halla Rempt 2019-05-09 12:54:59 UTC
I'm fine with making this a release blocker, but we have released 3.1 and 4.1 with this bug present :-)
Comment 6 Dmitry Kazakov 2019-05-10 14:09:15 UTC
I can reproduce the crash here :)
Comment 7 Halla Rempt 2019-05-10 14:10:19 UTC
Yes, that's not so hard :P
Comment 8 Dmitry Kazakov 2019-05-13 11:38:39 UTC
Git commit 1705367a4b975b2f52055fdb019734a747b83ff2 by Dmitry Kazakov.
Committed on 13/05/2019 at 11:37.
Pushed by dkazakov into branch 'master'.

Fix crash when undoing grouping layer with filtering enabled

We shouldn't recursively start model invalidation right inside
beginRemoveRows() call.

M  +5    -7    libs/ui/kis_node_filter_proxy_model.cpp

https://invent.kde.org/kde/krita/commit/1705367a4b975b2f52055fdb019734a747b83ff2