Bug 461788 - [master] Segfault when activating transform tool with no selection
Summary: [master] Segfault when activating transform tool with no selection
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-13 19:55 UTC by tomtomtomreportingin
Modified: 2022-11-14 08:10 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomtomtomreportingin 2022-11-13 19:55:08 UTC
git 077e016a6f

Does not occur in krita-5.1.3-29ec62a196

SUMMARY
Krita freezes and segfaults if the user activates the transform tool with no selection.

STEPS TO REPRODUCE
1. Create a new document.
2. Activate the transform tool.

OBSERVED RESULT
Freeze and segfault.

EXPECTED RESULT
No freeze and segfault.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.98.0
Qt Version: 5.12.12 (appimage)
Comment 1 Freya Lupen 2022-11-13 20:05:02 UTC
Confirmed on 55b758bc. Judging by the backtrace, it was introduced in 812ef762 "Make sure that local selection is not transformed twice during transformation" (https://invent.kde.org/graphics/krita/-/commit/812ef7623b8d3b205b90b7e546773ff26854c3bb), but I haven't confirmed that.

libkritaimage.dll!KisSelection::parentNode+0x9
kritatooltransform.dll!KisTransformUtils::fetchNodesList+0x144  [src/plugins/tools/tool_transform2/kis_transform_utils.cpp @ 667]
   665:     KIS_SAFE_ASSERT_RECOVER_NOOP(!hasTransformMaskDescendant);
   666: 
>  667:     KisNodeSP selectionNode = selection->parentNode();
   668: 
   669:     auto fetchFunc =
kritatooltransform.dll!InplaceTransformStrokeStrategy::initStrokeCallback+0x497  [src/plugins/tools/tool_transform2/strokes/inplace_transform_stroke_strategy.cpp @ 305]
   303: 
   304:     // When placing an external source image, we never work recursively on any layer masks
>  305:     m_d->processedNodes = KisTransformUtils::fetchNodesList(m_d->mode, m_d->rootNode, m_d->externalSource, m_d->selection);
   306: 
   307:     bool argsAreInitialized = false;
Comment 2 Dmitry Kazakov 2022-11-14 08:10:22 UTC
Git commit 8fcfc8ce26f81807312056a893fab4b30e2d84e9 by Dmitry Kazakov.
Committed on 14/11/2022 at 08:09.
Pushed by dkazakov into branch 'master'.

Fix the condition for avoidance of double selection transformation

M  +2    -2    plugins/tools/tool_transform2/kis_transform_utils.cpp

https://invent.kde.org/graphics/krita/commit/8fcfc8ce26f81807312056a893fab4b30e2d84e9