Bug 434257 - Safe assert on undo in Colorize Mask
Summary: Safe assert on undo in Colorize Mask
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: git master (please specify the git hash!)
Platform: Mint (Ubuntu based) Linux
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-10 21:24 UTC by Tiar
Modified: 2021-07-30 04:59 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Crash log for all threads (18.50 KB, text/plain)
2021-03-10 21:24 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2021-03-10 21:24:12 UTC
Created attachment 136572 [details]
Crash log for all threads

SUMMARY
I was doing multiple things at once - undoing, redoing and changing the visibility of layers and masks around and including the Colorize Mask.

Git hash: d3260196b4

STEPS TO REPRODUCE
1. No known steps yet.

OBSERVED RESULT
Crash

EXPECTED RESULT
No crash! :D

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.0-prealpha (git eda033d)
 Languages: pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.11.1
  Version (loaded): 5.11.1

ADDITIONAL INFORMATION
SAFE ASSERT (krita): "m_newPropertyList == other->m_oldPropertyList" in file /home/tymon/kritadev/krita/libs/image/commands/kis_node_property_list_command.cpp, line 101

Thread 1 "krita" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: Nie ma takiego pliku ani katalogu.
(gdb) bt
#0  0x00007ffff3d65ed7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff3d47535 in __GI_abort () at abort.c:79
#2  0x00007ffff452f8d7 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff563c3b8 in kis_assert_common(char const*, char const*, int, bool, bool) (assertion=0x7ffff5e17c50 "m_newPropertyList == other->m_oldPropertyList", file=0x7ffff5e17bf8 "/home/tymon/kritadev/krita/libs/image/commands/kis_node_property_list_command.cpp", line=101, throwException=false, isIgnorable=true) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qarraydata.h:206
#4  0x00007ffff563c81d in kis_safe_assert_recoverable(char const*, char const*, int) (assertion=assertion@entry=0x7ffff5e17c50 "m_newPropertyList == other->m_oldPropertyList", file=file@entry=0x7ffff5e17bf8 "/home/tymon/kritadev/krita/libs/image/commands/kis_node_property_list_command.cpp", line=line@entry=101) at /home/tymon/kritadev/krita/libs/global/kis_assert.cpp:107
#5  0x00007ffff5a7af28 in KisNodePropertyListCommand::mergeWith(KUndo2Command const*) (this=0x7fffc80223a0, command=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:583
#6  0x00007ffff2884fb4 in KUndo2QStack::push(KUndo2Command*) (this=0x55556e323910, cmd=<optimized out>) at /home/tymon/kritadev/krita/libs/command/kundo2stack.cpp:850
#7  0x00007ffff5d14e52 in KisLegacyUndoAdapter::addCommand(KUndo2Command*) (command=0x55555ad7f5d0, this=0x7fffc8010630) at /home/tymon/kritadev/krita/libs/image/kis_undo_adapter.h:42
#8  0x00007ffff5d14e52 in KisLegacyUndoAdapter::addCommand(KUndo2Command*) (this=0x7fffc8010630, command=0x55555ad7f5d0) at /home/tymon/kritadev/krita/libs/image/kis_legacy_undo_adapter.cpp:30
#9  0x00007ffff5a7a5e1 in KisNodePropertyListCommand::setNodePropertiesAutoUndo(KisSharedPtr<KisNode>, KisSharedPtr<KisImage>, QList<KisBaseNode::Property>) (node=..., image=..., proplist=...)
    at /home/tymon/kritadev/krita/libs/global/kis_shared_ptr.h:167
#10 0x00007ffff5d6420b in KisLayerPropertiesIcons::setNodePropertyAutoUndo(KisSharedPtr<KisNode>, KoID const&, QVariant const&, KisSharedPtr<KisImage>) (node=..., id=..., value=..., image=...) at /usr/include/c++/8/bits/atomic_base.h:295
#11 0x00007fffc6a60eac in KisToolLazyBrush::activateAlternateAction(KisTool::AlternateAction) (this=0x55556587b7b0, action=<optimized out>) at /usr/include/c++/8/bits/atomic_base.h:295
#12 0x00007ffff6ba6126 in KisToolProxy::activateToolAction(KisTool::ToolAction) (this=0x55555a6bd160, action=KisTool::AlternateSecondary) at /home/tymon/kritadev/krita/libs/ui/canvas/kis_tool_proxy.cpp:226
#13 0x00007ffff2de2dfa in KoToolManager::Private::currentLayerChanged(KoShapeLayer const*) (this=0x55555a312cd0, layer=0x555575e81530) at /home/tymon/kritadev/krita/libs/flake/KoToolManager.cpp:890
#14 0x00007ffff2de78a0 in KoToolManager::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /home/tymon/kritadev/build/libs/flake/kritaflake_autogen/include/moc_KoToolManager.cpp:314
#15 0x00007ffff47426db in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff71061ad in KisSelectedShapesProxy::currentLayerChanged(KoShapeLayer const*) (_t1=<optimized out>, this=<optimized out>) at /home/tymon/kritadev/build/libs/ui/kritaui_autogen/EWIEGA46WW/moc_KisSelectedShapesProxy.cpp:164
#17 0x00007ffff71061ad in KisSelectedShapesProxy::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_a=<optimized out>, _id=<optimized out>, _c=<optimized out>, _o=<optimized out>)
    at /home/tymon/kritadev/build/libs/ui/kritaui_autogen/EWIEGA46WW/moc_KisSelectedShapesProxy.cpp:83
#18 0x00007ffff71061ad in KisSelectedShapesProxy::qt_metacall(QMetaObject::Call, int, void**) (this=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /home/tymon/kritadev/build/libs/ui/kritaui_autogen/EWIEGA46WW/moc_KisSelectedShapesProxy.cpp:138
#19 0x00007ffff47426db in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff2f18182 in KoSelection::currentLayerChanged(KoShapeLayer const*) (this=this@entry=0x55557131b2d0, _t1=<optimized out>) at /home/tymon/kritadev/build/libs/flake/kritaflake_autogen/EWIEGA46WW/moc_KoSelection.cpp:151
#21 0x00007ffff2da8979 in KoSelection::setActiveLayer(KoShapeLayer*) (this=this@entry=0x55557131b2d0, layer=layer@entry=0x555575e81530) at /home/tymon/kritadev/krita/libs/flake/KoSelection.cpp:224
#22 0x00007ffff6c69f3b in KisNodeShape::editabilityChanged() [clone .localalias.21] (this=0x555575e81520) at /home/tymon/kritadev/krita/libs/ui/flake/kis_node_shape.cpp:108
#23 0x00007ffff47426db in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007ffff5c3758a in KisMask::baseNodeChangedCallback() (this=0x555573391430) at /home/tymon/kritadev/krita/libs/image/kis_mask.cc:512
#25 0x00007ffff5afd554 in KisColorizeMask::setShowKeyStrokes(bool) (this=this@entry=0x555573391430, value=<optimized out>) at /home/tymon/kritadev/krita/libs/image/lazybrush/kis_colorize_mask.cpp:866
#26 0x00007ffff5aff204 in KisColorizeMask::setSectionModelProperties(QList<KisBaseNode::Property> const&) (this=0x555573391430, properties=...) at /home/tymon/kritadev/krita/libs/image/lazybrush/kis_colorize_mask.cpp:446
#27 0x00007ffff5a7d4ac in KisNodePropertyListCommand::redo() (this=0x5555713026d0) at /home/tymon/kritadev/krita/libs/global/kis_shared_ptr.h:167
#28 0x00007ffff2883ae3 in KUndo2Command::redoMergedCommands() (this=0x5555713026d0) at /home/tymon/kritadev/krita/libs/command/kundo2stack.cpp:407
#29 0x00007ffff2884978 in KUndo2QStack::push(KUndo2Command*) (this=0x55556e323910, cmd=<optimized out>) at /home/tymon/kritadev/krita/libs/command/kundo2stack.cpp:720
#30 0x00007ffff5d14e52 in KisLegacyUndoAdapter::addCommand(KUndo2Command*) (command=0x5555713026d0, this=0x7fffc8010630) at /home/tymon/kritadev/krita/libs/image/kis_undo_adapter.h:42
#31 0x00007ffff5d14e52 in KisLegacyUndoAdapter::addCommand(KUndo2Command*) (this=0x7fffc8010630, command=0x5555713026d0) at /home/tymon/kritadev/krita/libs/image/kis_legacy_undo_adapter.cpp:30
#32 0x00007ffff5a7a5e1 in KisNodePropertyListCommand::setNodePropertiesAutoUndo(KisSharedPtr<KisNode>, KisSharedPtr<KisImage>, QList<KisBaseNode::Property>) (node=..., image=..., proplist=...)
    at /home/tymon/kritadev/krita/libs/global/kis_shared_ptr.h:167
#33 0x00007ffff5d6420b in KisLayerPropertiesIcons::setNodePropertyAutoUndo(KisSharedPtr<KisNode>, KoID const&, QVariant const&, KisSharedPtr<KisImage>) (node=..., id=..., value=..., image=...) at /usr/include/c++/8/bits/atomic_base.h:295
#34 0x00007fffc6a61dca in KisToolLazyBrush::deactivateAlternateAction(KisTool::AlternateAction) (this=0x55556587b7b0, action=<optimized out>) at /usr/include/c++/8/bits/atomic_base.h:295
#35 0x00007ffff6ba61a6 in KisToolProxy::deactivateToolAction(KisTool::ToolAction) (this=0x55555a6bd160, action=action@entry=KisTool::AlternateSecondary) at /home/tymon/kritadev/krita/libs/ui/canvas/kis_tool_proxy.cpp:242
#36 0x00007ffff6f8114b in KisAlternateInvocationAction::deactivate(int) (this=<optimized out>, shortcut=<optimized out>) at /usr/include/c++/8/bits/atomic_base.h:390
#37 0x00007ffff6f8cd55 in KisShortcutMatcher::tryActivateReadyShortcut() (this=0x55555a211310) at /home/tymon/kritadev/krita/libs/ui/input/kis_shortcut_matcher.cpp:664
#38 0x00007ffff6f8df40 in KisShortcutMatcher::keyPressed(Qt::Key) (this=0x55555a211310, key=Qt::Key_Z) at /home/tymon/kritadev/krita/libs/ui/input/kis_shortcut_matcher.cpp:200
#39 0x00007ffff6f6b3af in KisInputManager::eventFilterImpl(QEvent*) [clone .localalias.272] (this=0x55555a217958, event=0x7fffffffd740) at /home/tymon/kritadev/krita/libs/ui/input/kis_input_manager.cpp:374
#40 0x00007ffff47191ab in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#41 0x00007ffff50d8491 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#42 0x00007ffff50e0a69 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#43 0x00007ffff6ff78e7 in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x55557229ebf0, event=0x7fffffffd740) at /home/tymon/kritadev/krita/libs/ui/KisApplication.cpp:710
#44 0x00007ffff4719499 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#45 0x00007ffff5133e79 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#46 0x00007ffff50d84a1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
---Type <return> to continue, or q <return> to quit---
#47 0x00007ffff50dfae0 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#48 0x00007ffff6ff78e7 in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x55555915f5f0, event=0x7fffffffd740) at /home/tymon/kritadev/krita/libs/ui/KisApplication.cpp:710
#49 0x00007ffff4719499 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#50 0x00007ffff4b1ad98 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#51 0x00007ffff4b20415 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#52 0x00007ffff4afb045 in bool QWindowSystemInterfacePrivate::handleWindowSystemEvent<QWindowSystemInterface::SynchronousDelivery>(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#53 0x00007ffff4afe81c 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
#54 0x00007ffff4b1acbd in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#55 0x00007ffff4b20415 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#56 0x00007ffff4afab6b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#57 0x00007fffea76de5b in  () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#58 0x00007ffff471816b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#59 0x00007ffff47202e2 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#60 0x0000555555e2a21b in main (argc=<optimized out>, argv=0x7fffffffde38) at /home/tymon/kritadev/krita/krita/main.cc:663
#61 0x00007ffff3d48b6b in __libc_start_main (main=0x555555e28890 <main>, argc=1, argv=0x7fffffffde38, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffde28) at ../csu/libc-start.c:308
#62 0x0000555555e2b2da in _start () at /home/tymon/kritadev/krita/krita/main.cc:468
Comment 1 tomtomtomreportingin 2021-03-11 02:18:23 UTC
I am not sure if this is the same issue as the safe assert, as a safe assert doesn't happen in this case, but a user can consistently brute-force a colorize mask crash through these steps:

1. Select Colorize Mask tool.
2. Draw a dot.
3. Update.
4. Repeatedly hold undo and hold redo back-and-forth until crash.

I think a big part of this instability is that the update operation exists as a seperate item in the undo stack, even though the actual update output already exists as another seperate item in the stack. The output item even lies before the update operation in the stack. Is there a reason why the intensive update operation is included in the undo stack when you'd really just want the output?

Generated backtrace:
Application: Krita (krita), signal: Aborted

[KCrash Handler]
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x00007fa1de5d6537 in __GI_abort () at abort.c:79
#6  0x00007fa1de9eebf1 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fa1de9ee040 in qt_assert_x(char const*, char const*, char const*, int) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fa1dfeeb558 in KisSharedPtr<KisNode>::operator->() (this=<optimized out>, this=0x7ffe3aa6a6c0) at /home/name/kritadev/fork/krita/libs/global/kis_shared_ptr.h:168
#9  KisColorizeMask::slotUpdateRegenerateFilling(bool) (this=0x56076c8fa9b0, prefilterOnly=<optimized out>) at /home/name/kritadev/fork/krita/libs/image/lazybrush/kis_colorize_mask.cpp:310
#10 0x00007fa1dec41580 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007fa1dec41580 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007fa1dfc81f35 in KisSignalCompressor::tryEmitSignalSafely() (this=this@entry=0x56075a00f3f0) at /home/name/kritadev/fork/krita/libs/global/kis_signal_compressor.cpp:195
#13 0x00007fa1dfc81fe5 in KisSignalCompressor::tryEmitOnTick(bool) (this=this@entry=0x56075a00f3f0, isFromTimer=isFromTimer@entry=true) at /home/name/kritadev/fork/krita/libs/global/kis_signal_compressor.cpp:172
#14 0x00007fa1dfc821aa in KisSignalCompressor::slotTimerExpired() (this=0x56075a00f3f0) at /home/name/kritadev/fork/krita/libs/global/kis_signal_compressor.cpp:207
#15 0x00007fa1dec41580 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007fa1dec4545a in QTimer::timeout(QTimer::QPrivateSignal) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fa1dec36ecf in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007fa1df6cc15f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007fa1e15a7a69 in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x5607586ca8b0, event=0x7ffe3aa6ac80) at /home/name/kritadev/fork/krita/libs/ui/KisApplication.cpp:710
#20 0x00007fa1dec0af6a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007fa1dec61883 in QTimerInfoList::activateTimers() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007fa1dec6213c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007fa1dbf7de6b in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007fa1dbf7e118 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fa1dbf7e1cf in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fa1dec624bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007fa1dec0992b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#28 0x00007fa1dec11ba0 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x000056074d4e2b4e in main(int, char**) (argc=<optimized out>, argv=0x7ffe3aa6b1e8) at /home/name/kritadev/fork/krita/krita/main.cc:663
[Inferior 1 (process 76349) detached]
Comment 2 Dmitry Kazakov 2021-07-30 04:59:02 UTC
Git commit 444d4aed57a8955858ecaf6e2c5305ac0758d04e by Dmitry Kazakov.
Committed on 30/07/2021 at 04:58.
Pushed by dkazakov into branch 'master'.

Don't add undo commands for colorize mask update state

This property doesn't satisfy normal switching conditions, therefore
the commands compression may sometimes get crazy.

M  +3    -1    libs/image/commands/kis_node_property_list_command.cpp
M  +13   -0    libs/image/kis_base_node.cpp
M  +1    -1    libs/image/kis_base_node.h

https://invent.kde.org/graphics/krita/commit/444d4aed57a8955858ecaf6e2c5305ac0758d04e