Bug 314846

Summary: Crash (segmentation fault) switching layer with unapplied transformation
Product: [Applications] krita Reporter: Tom Hall <tahall256>
Component: Tools/TransformAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: critical CC: dimula73
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Tom Hall 2013-02-10 19:21:54 UTC
Beginning a transformation using the transform tool, then attempting to switch layers without applying or cancelling the transformation causes a Segmentation Fault.

The following is output to the terminal just before the crash:
WARNING: Transform Stroke: the device is absent in cache!

Reproducible: Always

Steps to Reproduce:
1. Create a document with at least 2 layers.
2. Make a selection.
3. Select the transform tool and transform the selection in some way (but don't press enter to apply the transformation).
4. Select a different layer via the layers docker.
Actual Results:  
Terminal output: "WARNING: Transform Stroke: the device is absent in cache!"
Segmentation Fault!!!

Expected Results:  
Don't crash, obviously.

(Not sure what it would do if it didn't segfault, but if there's any doubt, I suggest it should either discard the unfinished transformation, store it in some way so the user can continue transforming when they switch back to the layer, or show a dialog asking the user whether to apply/discard/cancel.)
Comment 1 Dmitry Kazakov 2013-02-10 20:03:26 UTC
Hi!

Thank you for your report! I can reproduce this crash.
Comment 2 Dmitry Kazakov 2013-03-09 22:36:29 UTC
Git commit ddccc819070d86404e022487d686700d8e165927 by Dmitry Kazakov.
Committed on 09/03/2013 at 22:41.
Pushed by dkazakov into branch 'master'.

Fix a crash in the transform tool

The currentNode() can be changed when the stroke is finished
by switching the layers.

M  +10   -8    krita/plugins/tools/tool_transform2/kis_tool_transform.cc
M  +9    -2    krita/plugins/tools/tool_transform2/transform_transaction_properties.h

http://commits.kde.org/calligra/ddccc819070d86404e022487d686700d8e165927