Bug 424829 - Crash when undoing/redoing while using Colorize Mask
Summary: Crash when undoing/redoing while using Colorize Mask
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Colorize (show other bugs)
Version: 4.3.0
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2020-07-30 14:26 UTC by tomtomtomreportingin
Modified: 2020-09-09 20:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomtomtomreportingin 2020-07-30 14:26:11 UTC
SUMMARY
Krita segfaults if you undo and redo in a certain order while using Colorize Mask

STEPS TO REPRODUCE
1. Draw a circle.
2. Select Colorize Mask tool, click the canvas.
3. Undo until the circle is gone.
4. Redo until the Colorize Mask is brought back, then redo again.

OBSERVED RESULT
Krita segfaults.

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
I'm using the appimage so I'm not sure if it matters, but:
Linux/KDE Plasma: Debian sid
(available in About System)
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
The crash doesn't happen if there's no content drawn.
Comment 1 Tiar 2020-07-31 12:19:43 UTC
Hmm I cannot reproduce it :(
I did notice a weirdness in Redo though - it creates lots of "Property Changed" steps, and the lineart is blinking.

Btw @tomtomtomreportingin, if you're using the appimage, then the Qt Krita uses is not 5.14.2 but I believe 5.12.8, you can access those information in Help -> Show system information for bug reports. I usually just copy first two or three sections and replace the whole software section here with that.
Comment 2 tomtomtomreportingin 2020-07-31 16:28:42 UTC
My friend on Debian testing (Bullseye) can reproduce the same crash using the appimage, and I tried Krita 4.3 from the Debian repos and it also produces the same crash, so maybe the crash is Linux/Debian-specific?
Comment 3 Ahab Greybeard 2020-08-01 21:24:00 UTC
This happens for all appimages from 4.2.0 onwards on Debian 10 (stable).
It happens for 4.2.9 installed and the 4.3.0 snap package and the 4.3.0 appimage on Ubuntu 20.04.
It happens for the 4.3.0 portable .zip package on Windows 10.
On Windows there is no crash log.

For the appimage, the only log entry is:
KRITA DID NOT CLOSE CORRECTLY

[Side Note: I think Tymond runs Linux Mint, which should be very similar.
Could it be a CPU issue? My dual Xeons are ten years old.]

The terminal output for the 4.3.0 appimnage is as follows:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/tmp/.mount_krita-0AP959/usr/lib/krita-python-libs/krita added to PYTHONPATH
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout

======== fully started, new file/image ============
======== draw ellipse
======== select colourise mask tool
1
2
1
2
====== click on canvas
1
2
1
------ these seem to happen at regular intervals
2
1
1
==== two undos and a redo
1
1
1
------ if you wait, more happen
1
2
1
2
====== one more redo
Segmentation fault
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
See Additional Information

SOFTWARE
Krita

 Version: 4.3.0
 Languages: en_GB, en, en, en_GB, en
 Hidpi: false

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.19.0-9-amd64
  Pretty Productname: Debian GNU/Linux 10 (buster)
  Product Type: debian
  Product Version: 10
  Desktop: MATE

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "GeForce GTX 750 Ti/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 440.100" 
  Shading language:  "4.60 NVIDIA" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsOpenGLES: true 
  isQtPreferOpenGLES: false 

ADDITIONAL INFORMATION
I tried this with multi-section 'lineart' and painted mask colours in the sections.
I used Undo to go back to just before the colourise mask was used so that there were still lineart strokes on the canvas.
For various scenarios, it always crashes when 'Redo Colourise Mask' is performed but you need to use Undo to take it back to remove at least one brushstroke before doing Redo up to the Redo Colourise Mask.
Comment 4 tomtomtomreportingin 2020-08-11 00:21:00 UTC
I wouldn't think it's a CPU issue. I have an i3 Haswell while my friend has a 2nd generation Ryzen.
Comment 5 Dmitry Kazakov 2020-09-09 19:37:28 UTC
I can reproduce on Windows
Comment 6 Dmitry Kazakov 2020-09-09 20:56:00 UTC
Git commit e3e085825bac1b0019c8c957e7838fb87d2c46cc by Dmitry Kazakov.
Committed on 09/09/2020 at 20:55.
Pushed by dkazakov into branch 'krita/4.3'.

Fix crash when redoing creation of a colorize mask

Neither changing "Colorize Needs Update", nor running
KisColorizeStrokeStrategy should reset redo state.

M  +9    -37   libs/image/commands/kis_node_property_list_command.cpp
M  +3    -0    libs/image/lazybrush/kis_colorize_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/commit/e3e085825bac1b0019c8c957e7838fb87d2c46cc
Comment 7 Dmitry Kazakov 2020-09-09 20:56:58 UTC
Git commit 631da961d750eeefbd3ce04df01d06dfd8072f50 by Dmitry Kazakov.
Committed on 09/09/2020 at 20:56.
Pushed by dkazakov into branch 'master'.

Fix crash when redoing creation of a colorize mask

Neither changing "Colorize Needs Update", nor running
KisColorizeStrokeStrategy should reset redo state.

M  +9    -37   libs/image/commands/kis_node_property_list_command.cpp
M  +3    -0    libs/image/lazybrush/kis_colorize_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/commit/631da961d750eeefbd3ce04df01d06dfd8072f50