Bug 412622

Summary: Using any feathering other than 0 when using the magic wand crashes.
Product: [Applications] krita Reporter: Ralek Kolemios <info>
Component: Tools/SelectionAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: crash CC: ahab.greybeard, dev.larpon, halla, info, krzysio.kurek
Priority: NOR    
Version: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: Dialogue box
Dozens of internal error windows

Description Ralek Kolemios 2019-10-05 00:20:57 UTC
Created attachment 123023 [details]
Dialogue box

SUMMARY
When using the magic wand selector, feather set to 0 is fine, but feather set to 1 or more immediately creates dozens of dialogue boxes that look like the attached. It then crashes to desktop regardless of which button is pressed.



Krita
  Version: 4.3.0-prealpha (git 835ca2e)

Qt
  Version (compiled): 5.12.5
  Version (loaded): 5.12.5

OS Information
  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.17134
  Pretty Productname: Windows 10 (10.0)
Comment 1 Ahab Greybeard 2019-10-06 07:53:17 UTC
Using the same nightly build (portable zip) on Windows 10, I have two Safe Assert warnings and I can Ignore them to continue as normal. This is the case no matter how complex the image is.

Using the 4.2.7.1 portable zip, I have no safe Assert warnings but the log shows they were raised internally. (I think this is a new deliberate policy for formal releases.)

With the Linux 4.2.7.1 appimage I have the two Safe Asserts and can Ignore them.

With a Linux recent nightly build, I don't have Safe Assert warnings but they do appear in the log. (Are the Linux builds the 'wrong way around'?)

Krita

 Version: 4.3.0-prealpha (git 835ca2e)
 Languages: en_US
 Hidpi: false

Qt

  Version (compiled): 5.12.5
  Version (loaded): 5.12.5

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.16299
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10


Hardware Information

  GPU Acceleration: auto
  Memory: 16381 Mb
  Number of Cores: 8
  Swap Location: /tmp
Comment 2 Ralek Kolemios 2019-10-07 00:47:06 UTC
Created attachment 123072 [details]
Dozens of internal error windows

Strange, when I first encountered the error, there was no content in the popup dialogue, and there were so many of them that the 'drop shadow' around them all combined into a thick black line. (attached)
Now when I try to reproduce it, it's ignorable.
Comment 3 Ahab Greybeard 2019-10-07 10:30:45 UTC
That is strange but a Safe Assert is being raised and asks for the bug to be reported so I'll set to Confirmed.
Comment 4 Halla Rempt 2019-10-10 10:08:41 UTC
I suspect:

commit 0d45094ff507ad1a3de98d8d185fcc8fcc7d0124
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Mon Sep 23 12:47:05 2019 +0300
Fix crash in Feather Selection (also in Wavelets, Blur and Edge Detection)
The device that is fed to the convolution painter with repeat stretegy
should always contain the a proper KisDefaultBounds object. Otherwise
the repeat iterator will try to read data from infinite positions, which
is not nice :)
BUG:412057


Let's see...
Comment 5 Halla Rempt 2019-10-10 10:10:54 UTC
Yeah...

+        KIS_SAFE_ASSERT_RECOVER(boundsRect != KisDefaultBounds().bounds()) {
+            dataRect = requestedRect | src->exactBounds();
+        }

Dmitry, I'm assigning this bug to you.
Comment 6 Halla Rempt 2019-10-10 10:16:18 UTC
*** Bug 412583 has been marked as a duplicate of this bug. ***
Comment 7 Dmitry Kazakov 2019-10-14 12:23:57 UTC
*** Bug 412850 has been marked as a duplicate of this bug. ***
Comment 8 Dmitry Kazakov 2019-10-14 12:37:31 UTC
Git commit 9af432885186c6b40b07e75e80739c4bc34ded3e by Dmitry Kazakov.
Committed on 14/10/2019 at 12:37.
Pushed by dkazakov into branch 'master'.

Fix crash when using Contionous Selection tool with Feather option

KisSelectionDefaultBounds should not care about the image, it should
take all the values from the parent device's default bounds object.

M  +28   -5    libs/image/kis_default_bounds.cpp
M  +6    -2    libs/image/kis_default_bounds.h
M  +5    -5    libs/image/kis_mask.cc
M  +2    -2    libs/image/kis_selection.cc
M  +1    -1    libs/image/tests/kis_image_test.cpp
M  +1    -1    libs/image/tests/kis_projection_leaf_test.cpp
M  +1    -1    libs/image/tests/kis_selection_test.cpp
M  +1    -1    plugins/extensions/colorrange/dlg_colorrange.cc
M  +1    -1    sdk/tests/qimage_based_test.h

https://invent.kde.org/kde/krita/commit/9af432885186c6b40b07e75e80739c4bc34ded3e
Comment 9 Dmitry Kazakov 2019-11-05 17:18:19 UTC
Git commit 32d27e262ceb55a721b3e34077f440d42e50d0c3 by Dmitry Kazakov.
Committed on 05/11/2019 at 17:18.
Pushed by dkazakov into branch 'krita/4.2'.

Fix crash when using Contionous Selection tool with Feather option

KisSelectionDefaultBounds should not care about the image, it should
take all the values from the parent device's default bounds object.

M  +28   -5    libs/image/kis_default_bounds.cpp
M  +6    -2    libs/image/kis_default_bounds.h
M  +5    -5    libs/image/kis_mask.cc
M  +2    -2    libs/image/kis_selection.cc
M  +1    -1    libs/image/tests/kis_image_test.cpp
M  +1    -1    libs/image/tests/kis_projection_leaf_test.cpp
M  +1    -1    libs/image/tests/kis_selection_test.cpp
M  +1    -1    plugins/extensions/colorrange/dlg_colorrange.cc
M  +1    -1    sdk/tests/qimage_based_test.h

https://invent.kde.org/kde/krita/commit/32d27e262ceb55a721b3e34077f440d42e50d0c3