Bug 336473 - Clone tool crashes if clone source layer is a layer group
Summary: Clone tool crashes if clone source layer is a layer group
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: git master (please specify the git hash!)
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
Depends on:
Reported: 2014-06-19 19:08 UTC by vanyossi
Modified: 2014-06-20 06:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description vanyossi 2014-06-19 19:08:44 UTC
Make the source of a clone a group layer and a paint layer as the destination.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffcd01f700 (LWP 18173)]
KisPaintDevice::defaultBounds (this=0x0) at /home/tara/nalaf/nala/program/calligra/krita/image/kis_paint_device.cc:365
365	    return m_d->defaultBounds;

Reproducible: Always

Expected Results:  
I was expecting it to clone the group layer contents but I understand why you wouldn't want to.
Cloning from a layer group to a child paint layer
Comment 1 vanyossi 2014-06-19 19:19:49 UTC
No special setup.
Created group layer with 2 paint layer childs.
Select clone tool
Ctrl + click with the group layer highlighted
Select a paint layer outside the group (Ie background layer)

A little more detail on the backtrace.

#0  KisPaintDevice::defaultBounds (this=0x0) at /home/tara/nalaf/nala/program/calligra/krita/image/kis_paint_device.cc:365
#1  0x00007fffd913a056 in KisDuplicateOp::paintAt (this=0x7fff9cac0b10, info=...)
    at /home/tara/nalaf/nala/program/calligra/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.cpp:171
#2  0x00007ffff6efe3e7 in KisPaintInformation::paintAt (this=this@entry=0x7fffceff7c60, op=op@entry=0x7fff9cac0b10, 
    at /home/tara/nalaf/nala/program/calligra/krita/image/brushengine/kis_paint_information.cc:188
#3  0x00007ffff6f00876 in KisPaintOp::paintLine (this=0x7fff9cac0b10, pi1=..., pi2=..., currentDistance=0x4102260)
    at /home/tara/nalaf/nala/program/calligra/krita/image/brushengine/kis_paintop.cc:194
#4  0x00007ffff6f000aa in paintBezierCurve (paintOp=0x7fff9cac0b10, pi1=..., control1=..., control2=..., pi2=..., 
    currentDistance=0x4102260) at /home/tara/nalaf/nala/program/calligra/krita/image/brushengine/kis_paintop.cc:141
#5  0x00007ffff6f0012a in KisPaintOp::paintBezierCurve (this=<optimized out>, pi1=..., control1=..., control2=..., pi2=..., 
    currentDistance=<optimized out>) at /home/tara/nalaf/nala/program/calligra/krita/image/brushengine/kis_paintop.cc:164
#6  0x00007ffff77914ad in FreehandStrokeStrategy::doStrokeCallback (this=<optimized out>, data=<optimized out>)
    at /home/tara/nalaf/nala/program/calligra/krita/ui/tool/strokes/freehand_stroke.cpp:76
#7  0x00007ffff6ecacd9 in KisUpdateJobItem::run (this=0x12bfa40)
    at /home/tara/nalaf/nala/program/build/master-calligra/krita/image/../../../../calligra/krita/image/kis_update_job_item.h:61
#8  0x00007ffff07605eb in ?? () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007ffff076c78c in ?? () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007ffff04d6eda in start_thread (arg=0x7fffceff8700) at pthread_create.c:308
#11 0x00007fffef6c05ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Comment 2 Dmitry Kazakov 2014-06-20 06:53:23 UTC
Git commit 025c2020cd575f49ce13257ccf5bdd20294eb387 by Dmitry Kazakov.
Committed on 20/06/2014 at 06:44.
Pushed by dkazakov into branch 'master'.

Fixed crash when color picking from a group layer

Also fix all the pickers to read from projection() instead of paintDevice().
All nodes in Krita are expected to have projection() which is a visual
representation of the node in the stack.

The only new behavior this patch introduces is the picking from
Filter layers. Now it picks not from their 'selection' (which is
a paintDevice()), but from the filtered area cache (projection()).

M  +1    -1    krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.cpp
M  +2    -3    krita/plugins/tools/defaulttools/kis_tool_colorpicker.cc
M  +2    -10   krita/ui/tool/kis_tool_paint.cc