Bug 450121 - Krita crashes when trying to create a brush tip with the same name as an already deleted brush tip.
Summary: Krita crashes when trying to create a brush tip with the same name as an alre...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: 5.0.2
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Tiar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-13 05:07 UTC by Rogelio Orozco
Modified: 2022-02-28 13:48 UTC (History)
3 users (show)

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


Attachments
My Usage Log and System Information. Unfortunately I wasn't able to create a useful backtrace (15.74 KB, text/plain)
2022-02-13 05:07 UTC, Rogelio Orozco
Details
. (63.83 KB, text/plain)
2022-02-13 05:08 UTC, Rogelio Orozco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rogelio Orozco 2022-02-13 05:07:00 UTC
Created attachment 146656 [details]
My Usage Log and System Information. Unfortunately I wasn't able to create a useful backtrace

SUMMARY
***
I created some custom brush tips for experimenting, after testing them for a while I decided to keep some and delete the rest. The thing is that I used generic listing names to easily organize them (My tip 1, My tip 2, etc.). When I tried creating some new ones and reusing the names of the deleted ones to keep the order, Krita would advert that the names are already taken (despite those tips being already deleted) and that If I would like to overwrite those tips, when I click yes I get a message saying that the operation failed and Krita crashes shortly after I close it.

I even tried to restart the system in case that the old tips may still exist archived in some kind of archive or "trash bin" for recovering them if accidentally deleted. But it still happens
 
***


STEPS TO REPRODUCE
1. Create a custom brush tip
2. Delete the brush tip
3. Create a new brush tip using the same name as the first one
4. Say yes on the confirmation to overwrite the "already existing brush tip" 

OBSERVED RESULT

Krita shows you a pop-up screen informing that the operation failed, and shortly after closing the message Krita crashes.

EXPECTED RESULT

It shouldn't even give you the message that a brush tip with the same name already exists in the first place, since that old tip have already been deleted. You should be able to create your new tip and give it the same name just fine.

SOFTWARE/OS VERSIONS
Windows:  Microsoft Windows 11 Home
Comment 1 Rogelio Orozco 2022-02-13 05:08:40 UTC
Created attachment 146657 [details]
.
Comment 2 Halla Rempt 2022-02-14 14:10:10 UTC
Crash log: 

Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
KisPredefinedBrushChooser::slotUpdateBrushModeButtonsState (this=0x555556181750)
    at /home/halla/dev/krita/plugins/paintops/libpaintop/kis_predefined_brush_chooser.cpp:432
432             cmbBrushMode->setCurrentIndex(int(m_brush->brushApplication()));
(gdb) 
(gdb) bt
#0  KisPredefinedBrushChooser::slotUpdateBrushModeButtonsState (this=0x555556181750)
    at /home/halla/dev/krita/plugins/paintops/libpaintop/kis_predefined_brush_chooser.cpp:432
#1  0x00007fffe06aca56 in KisPredefinedBrushChooser::updateBrushTip (this=0x555556181750, resource=..., 
    isChangingBrushPresets=<optimized out>)
    at /home/halla/dev/krita/plugins/paintops/libpaintop/kis_predefined_brush_chooser.cpp:404
#2  0x00007fffe06afa03 in KisPredefinedBrushChooser::slotOpenStampBrush (this=0x555556181750)
    at /home/halla/dev/krita/plugins/paintops/libpaintop/kis_predefined_brush_chooser.cpp:319
#3  0x00007fffe06b08ab in KisPredefinedBrushChooser::qt_static_metacall (_o=<optimized out>, 
    _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /home/halla/dev/b-krita/plugins/paintops/libpaintop/kritalibpaintop_autogen/include/moc_kis_predefined_brush_chooser.cpp:145
#4  0x00007ffff5a9c100 in QMetaObject::activate(QObject*, int, int, void**) ()
   from /home/halla/dev/deps/lib/libQt5Core.so.5
#5  0x00007ffff6596256 in QAbstractButton::clicked(bool) () from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#6  0x00007ffff659647e in ?? () from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#7  0x00007ffff65978c3 in ?? () from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#8  0x00007ffff6597a85 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
   from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#9  0x00007ffff64e3a5e in QWidget::event(QEvent*) () from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#10 0x00007ffff64a10d6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#11 0x00007ffff64aa897 in QApplication::notify(QObject*, QEvent*) ()
   from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#12 0x00007ffff7c3e28e in KisApplication::notify (this=0x7fffffffd660, receiver=0x55555addd840, 
    event=0x7fffffffcb30) at /home/halla/dev/krita/libs/ui/KisApplication.cpp:757
#13 0x00007ffff5a706ea in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /home/halla/dev/deps/lib/libQt5Core.so.5
#14 0x00007ffff64a9ac7 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#15 0x00007ffff64ffb2d in ?? () from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#16 0x00007ffff6502b64 in ?? () from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#17 0x00007ffff64a10d6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#18 0x00007ffff64aa5d0 in QApplication::notify(QObject*, QEvent*) ()
   from /home/halla/dev/deps/lib/libQt5Widgets.so.5
#19 0x00007ffff7c3e28e in KisApplication::notify (this=0x7fffffffd660, receiver=0x555563916310, 
    event=0x7fffffffd030) at /home/halla/dev/krita/libs/ui/KisApplication.cpp:757
#20 0x00007ffff5a706ea in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /home/halla/dev/deps/lib/libQt5Core.so.5
#21 0x00007ffff5e61fa3 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)
    () from /home/halla/dev/deps/lib/libQt5Gui.so.5
#22 0x00007ffff5e638db in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /home/halla/dev/deps/lib/libQt5Gui.so.5
#23 0x00007ffff5e3d98c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
    () from /home/halla/dev/deps/lib/libQt5Gui.so.5
#24 0x00007ffff01f254e in ?? () from /home/halla/dev/deps/lib/libQt5XcbQpa.so.5
#25 0x00007ffff305e17d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007ffff305e400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007ffff305e4a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007ffff5ac8645 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /home/halla/dev/deps/lib/libQt5Core.so.5
#29 0x00007ffff5a6f29b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /home/halla/dev/deps/lib/libQt5Core.so.5
#30 0x00007ffff5a76ff6 in QCoreApplication::exec() () from /home/halla/dev/deps/lib/libQt5Core.so.5
#31 0x000055555555d60f in main (argc=<optimized out>, argv=<optimized out>)
    at /home/halla/dev/krita/krita/main.cc:699
Comment 3 Dmitry Kazakov 2022-02-28 13:14:16 UTC
Git commit 606c5774795cdb32c50d08086a52f6a743ee1dd9 by Dmitry Kazakov.
Committed on 28/02/2022 at 13:13.
Pushed by dkazakov into branch 'master'.

Fix custom brush widget to not activate null brush resource when overriding
Related: bug 449226

M  +3    -3    plugins/paintops/libpaintop/kis_clipboard_brush_widget.cpp
M  +6    -4    plugins/paintops/libpaintop/kis_custom_brush_widget.cpp

https://invent.kde.org/graphics/krita/commit/606c5774795cdb32c50d08086a52f6a743ee1dd9
Comment 4 Dmitry Kazakov 2022-02-28 13:48:30 UTC
Git commit 000f36f9a1dd2f512337cbfa294414cd6c6cc0d3 by Dmitry Kazakov.
Committed on 28/02/2022 at 13:48.
Pushed by dkazakov into branch 'krita/5.0'.

Fix custom brush widget to not activate null brush resource when overriding
Related: bug 449226

M  +3    -3    plugins/paintops/libpaintop/kis_clipboard_brush_widget.cpp
M  +6    -4    plugins/paintops/libpaintop/kis_custom_brush_widget.cpp

https://invent.kde.org/graphics/krita/commit/000f36f9a1dd2f512337cbfa294414cd6c6cc0d3