Bug 425875 - Crashes if selecting animated brush preset in smudge brush engine
Summary: Crashes if selecting animated brush preset in smudge brush engine
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush Engine/Shape (show other bugs)
Version: 4.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-27 14:20 UTC by janeelf
Modified: 2020-09-11 12:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
bubble5.gih (2.19 MB, image/x-gimp-gih)
2020-08-31 10:59 UTC, Halla Rempt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description janeelf 2020-08-27 14:20:46 UTC
SUMMARY
Crashes if selecting animated brush preset (imported from a gih. file) in smudge brush engine

STEPS TO REPRODUCE
1. Go to a brush that uses smudge brush engine (possibly others not using pixel engine as well)
2. Choose an animated brush preset shape
3. Crashes krita

OBSERVED RESULT

Crashes Krita to desktop.

EXPECTED RESULT
Wasn't sure, that's why I tested it. Obviously it doesn't work so i won't do it again

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2020-08-27 14:40:40 UTC
I'm sorry, but I cannot reproduce this. Could you

* attach the actual gih file, or if it's one that comes with krita, tell us which one it is
* attach the %LOCALAPPDATA%\kritacrash.log file to this bug report?
Comment 2 janeelf 2020-08-27 16:28:13 UTC
(In reply to Boudewijn Rempt from comment #1)
> I'm sorry, but I cannot reproduce this. Could you
> 
> * attach the actual gih file, or if it's one that comes with krita, tell us
> which one it is
> * attach the %LOCALAPPDATA%\kritacrash.log file to this bug report?

Sure, here is the log report after the crash. It won't let me attach the gih. file.
 
SESSION: 27 Aug 2020 17:14:26 +0100. Executing E:\programs\krita\Krita (x64)\bin\krita.exe

Krita Version: 4.3.0, Qt version compiled: 5.12.8, loaded: 5.12.8. Process ID: 8440
-- -- -- -- -- -- -- --
27 Aug 2020 17:14:26 +0100: Style: fusion. Available styles: windowsvista, Windows, Fusion
27 Aug 2020 17:14:41 +0100: Created image "Unnamed", 2480 * 3508 pixels, 300 dpi. Color model: 8-bit integer/channel RGB/Alpha (sRGB-elle-V2-srgbtrc.icc). Layers: 1
27 Aug 2020 17:17:50 +0100: ASSERT (krita): "m_dstDabRect.size() == m_maskDab->bounds().size()" in file C:\Packaging\workspace\Krita_Release_Windows64_Build\krita\plugins\paintops\colorsmudge\kis_colorsmudgeop.cpp, line 142
Comment 3 Halla Rempt 2020-08-27 16:35:27 UTC
Hm... Could you just mail the file to me, at boudewijnrempt@gmail.com?
Comment 4 Bug Janitor Service 2020-08-28 04:33:09 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 5 Halla Rempt 2020-08-31 10:59:11 UTC
I can confirm a assert with this gih file: 

ASSERT (krita): "m_dstDabRect.size() == m_maskDab->bounds().size()" in file /home/boud/dev/4.3/plugins/paintops/colorsmudge/kis_colorsmudgeop.cpp, line 142
Comment 6 Halla Rempt 2020-08-31 10:59:30 UTC
Created attachment 131308 [details]
bubble5.gih
Comment 7 Halla Rempt 2020-08-31 11:02:37 UTC
Note: only 4.3 can load this gih file, master fails on it.
Comment 8 Dmitry Kazakov 2020-09-11 11:47:51 UTC
Git commit e0e8a608d9481f818ec8384d42faf596595eea57 by Dmitry Kazakov.
Committed on 11/09/2020 at 11:47.
Pushed by dkazakov into branch 'krita/4.3'.

Fix unused lightnessStrength parameter in KisDabCache

It should be used for the calculation of cache state

M  +2    -1    plugins/paintops/libpaintop/kis_dab_cache.cpp

https://invent.kde.org/graphics/krita/commit/e0e8a608d9481f818ec8384d42faf596595eea57
Comment 9 Dmitry Kazakov 2020-09-11 11:48:00 UTC
Git commit a599a55ecb0800b5ec86978e61a6512a2fcb70ee by Dmitry Kazakov.
Committed on 11/09/2020 at 11:47.
Pushed by dkazakov into branch 'krita/4.3'.

Fix crash in ColorSmudge paintop with animated GIH brushes

The crash happened because dabRect and actual dab were calculated for
different brush indexes in the animated brush.

Before the patch, the switch of the index happened implicitly in
a call to KisBrush::brushIndex(). Now there are no implicit switches,
instead, the user is obliged to call KisBrush::prepareForSeqNo() before
doing brush generation.

Most of the times, tracking of seqNo is handled by the dab caching
system.

M  +1    -7    libs/brush/kis_brush.cpp
M  +5    -15   libs/brush/kis_brush.h
M  +2    -11   libs/brush/kis_brushes_pipe.h
M  +6    -11   libs/brush/kis_imagepipe_brush.cpp
M  +1    -2    libs/brush/kis_imagepipe_brush.h
M  +6    -11   libs/brush/kis_text_brush.cpp
M  +1    -2    libs/brush/kis_text_brush.h
M  +7    -1    plugins/paintops/libpaintop/kis_dab_cache.cpp
M  +1    -1    plugins/paintops/libpaintop/kis_dab_cache_base.cpp
M  +2    -0    plugins/paintops/spray/spray_brush.cpp
M  +1    -0    plugins/paintops/spray/spray_brush.h

https://invent.kde.org/graphics/krita/commit/a599a55ecb0800b5ec86978e61a6512a2fcb70ee
Comment 10 Dmitry Kazakov 2020-09-11 12:15:40 UTC
Git commit c787ab9a068c10541db7afe811725d7150c44e51 by Dmitry Kazakov.
Committed on 11/09/2020 at 11:48.
Pushed by dkazakov into branch 'master'.

Fix unused lightnessStrength parameter in KisDabCache

It should be used for the calculation of cache state

M  +2    -1    plugins/paintops/libpaintop/kis_dab_cache.cpp

https://invent.kde.org/graphics/krita/commit/c787ab9a068c10541db7afe811725d7150c44e51
Comment 11 Dmitry Kazakov 2020-09-11 12:15:48 UTC
Git commit 42cdcf12ac3d8424ecd7c3e16f5f99fdedb0cb1f by Dmitry Kazakov.
Committed on 11/09/2020 at 11:53.
Pushed by dkazakov into branch 'master'.

Fix crash in ColorSmudge paintop with animated GIH brushes

The crash happened because dabRect and actual dab were calculated for
different brush indexes in the animated brush.

Before the patch, the switch of the index happened implicitly in
a call to KisBrush::brushIndex(). Now there are no implicit switches,
instead, the user is obliged to call KisBrush::prepareForSeqNo() before
doing brush generation.

Most of the times, tracking of seqNo is handled by the dab caching
system.

# Conflicts:
#	libs/brush/kis_imagepipe_brush.cpp

M  +1    -7    libs/brush/kis_brush.cpp
M  +5    -15   libs/brush/kis_brush.h
M  +2    -11   libs/brush/kis_brushes_pipe.h
M  +6    -11   libs/brush/kis_imagepipe_brush.cpp
M  +1    -2    libs/brush/kis_imagepipe_brush.h
M  +6    -11   libs/brush/kis_text_brush.cpp
M  +1    -2    libs/brush/kis_text_brush.h
M  +7    -1    plugins/paintops/libpaintop/kis_dab_cache.cpp
M  +1    -1    plugins/paintops/libpaintop/kis_dab_cache_base.cpp
M  +2    -0    plugins/paintops/spray/spray_brush.cpp
M  +1    -0    plugins/paintops/spray/spray_brush.h

https://invent.kde.org/graphics/krita/commit/42cdcf12ac3d8424ecd7c3e16f5f99fdedb0cb1f