Bug 412804 - Crash when using the Magnetic Selection Tool
Summary: Crash when using the Magnetic Selection Tool
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Selection (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kuntal Majumder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-10 08:49 UTC by M
Modified: 2019-10-10 16:37 UTC (History)
1 user (show)

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


Attachments
Test file (1.04 MB, application/x-krita)
2019-10-10 08:49 UTC, M
Details
gdb backtrace (15.58 KB, text/plain)
2019-10-10 08:49 UTC, M
Details

Note You need to log in before you can comment on or make changes to this bug.
Description M 2019-10-10 08:49:04 UTC
Created attachment 123119 [details]
Test file

SUMMARY
The Magnetic Selection Tool can crash immediately after setting a control point with the attached test file.

STEPS TO REPRODUCE
1. Open the test file and choose the the Magnetic Selection Tool
2. Set the initial control point close to the beginning of the stroke in the bottom left

OBSERVED RESULT
Freeze and crash after trying to place a control point. Depending on where the first control point is set it can happen immediately when placing the first one, or later on. See the attached backtrace.

EXPECTED RESULT
Normal tool operation.

SOFTWARE/OS VERSIONS
Tested in build from master (git c870d77)
Comment 1 M 2019-10-10 08:49:54 UTC
Created attachment 123120 [details]
gdb backtrace
Comment 2 M 2019-10-10 08:57:21 UTC
Oh, I should add I left all the default values in the tool options.
Comment 3 Kuntal Majumder 2019-10-10 09:01:16 UTC
Not required, I got the problem, :)
Comment 4 Kuntal Majumder 2019-10-10 10:27:38 UTC
Git commit 9df578ddb13c9f4235a0bbd318407fa69a5e6716 by Kuntal Majumder.
Committed on 10/10/2019 at 10:27.
Pushed by kuntalmajumder into branch 'master'.

Checks the bounds before proceeding for calculating the edge

M  +10   -4    plugins/tools/selectiontools/KisMagneticWorker.cc
M  +15   -5    plugins/tools/selectiontools/KisToolSelectMagnetic.cc

https://invent.kde.org/kde/krita/commit/9df578ddb13c9f4235a0bbd318407fa69a5e6716
Comment 5 Kuntal Majumder 2019-10-10 16:37:57 UTC
Git commit 6310d2d7ad293f20a758ac80b84d95a90fa6c06b by Kuntal Majumder.
Committed on 10/10/2019 at 16:37.
Pushed by kuntalmajumder into branch 'master'.

Switched exactBounds with defaultBounds for calculating the right number
of tiles

M  +4    -12   plugins/tools/selectiontools/KisMagneticWorker.cc

https://invent.kde.org/kde/krita/commit/6310d2d7ad293f20a758ac80b84d95a90fa6c06b