<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>394068</bug_id>
          
          <creation_ts>2018-05-10 04:04:39 +0000</creation_ts>
          <short_desc>Can&apos;t copy between kra files, causes Runtime error</short_desc>
          <delta_ts>2018-05-19 21:03:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>General</component>
          <version>4.0.2</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>Microsoft Windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression, release_blocker</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>dragatora</reporter>
          <assigned_to name="Dmitry Kazakov">dimula73</assigned_to>
          <cc>alvin.shi</cc>
    
    <cc>halla</cc>
          
          <cf_commitlink>https://commits.kde.org/krita/0c8d097953fad6a0fa01644bf6d63f50d64e95b3</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1751092</commentid>
    <comment_count>0</comment_count>
    <who name="">dragatora</who>
    <bug_when>2018-05-10 04:04:39 +0000</bug_when>
    <thetext>I cannot copy and paste things between active kra documents.

Reproduction steps:
1. Have two kra docs open in Krita.
2. Select part of the image 1 and copy
3. Paste into image 2
4. Switch back to image 1 or attempt to save image 2
5. Runtime Error window pops up and Krita is forced to close

Does not matter if the documents are old or new.

System information:

Krita
  Version: 4.0.2

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

OpenGL Info 
  Vendor:  NVIDIA Corporation 
  Renderer:  &quot;GeForce GTX 1070/PCIe/SSE2&quot; 
  Version:  &quot;4.6.0 NVIDIA 390.65&quot; 
  Shading language:  4.60 NVIDIA 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: false 
  overridePreferAngle: false 
== log ==
 createPlatformOpenGLContext QSurfaceFormat(version 3.0, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile))
Basic wglCreateContext gives version 4.6
OpenGL 2.0 entry points available
GPU features: QSet()
supportedRenderers GpuDescription(vendorId=0x10de, deviceId=0x1b81, subSysId=0x62763842, revision=161, driver: &quot;nvldumdx.dll&quot;, version=23.21.13.9065, &quot;NVIDIA GeForce GTX 1070&quot;) renderer:  QFlags(0x1|0x2|0x4|0x8|0x20)
Qt: Using WGL and OpenGL from &quot;opengl32.dll&quot;
create OpenGL: &quot;NVIDIA Corporation&quot;,&quot;GeForce GTX 1070/PCIe/SSE2&quot; default ContextFormat: v4.6 profile: QSurfaceFormat::OpenGLContextProfile(NoProfile) options: QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions),SampleBuffers, Extension-API present
Extensions: 376
&quot;choosePixelFormat  Attributes:  0x2003 , 0x2027 , 0x2010 , 0x1 , 0x2001 , 0x1 , 0x2014 , 0x18 , 0x2011 , 0x1 , 0x2022 , 0x18 , 0x2013 , 0x202b , 0x201b , 0x8 , 0x2023 , 0x8 , 0x2041 , 0x0 , \n    obtained px # 12  of  1 \n     PIXELFORMATDESCRIPTOR dwFlags=0x8225 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=24 cStencilBits=8 cAuxBuffers=4 iLayerType=0 cAlphaBits=8 cAlphaShift=24 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 &quot;
createContext Creating context version 3 . 0 3 attributes
QWindowsGLContext 0x4d8adc0 ARB  requested:  QSurfaceFormat(version 3.0, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
    obtained # 12 ARB QSurfaceFormat(version 4.6, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
     PIXELFORMATDESCRIPTOR dwFlags=0x8225 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=24 cStencilBits=8 cAuxBuffers=4 iLayerType=0 cAlphaBits=8 cAlphaShift=24 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16  swap interval:  1 
    default:  ContextFormat: v4.6 profile: QSurfaceFormat::OpenGLContextProfile(NoProfile) options: QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions) 
    HGLRC= 0x30000
createPlatformOpenGLContext QSurfaceFormat(version 3.0, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile))
&quot;choosePixelFormat  Attributes:  0x2003 , 0x2027 , 0x2010 , 0x1 , 0x2001 , 0x1 , 0x2014 , 0x18 , 0x2011 , 0x1 , 0x2022 , 0x18 , 0x2013 , 0x202b , 0x201b , 0x8 , 0x2023 , 0x8 , 0x2041 , 0x0 , \n    obtained px # 12  of  1 \n     PIXELFORMATDESCRIPTOR dwFlags=0x8225 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=24 cStencilBits=8 cAuxBuffers=4 iLayerType=0 cAlphaBits=8 cAlphaShift=24 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 &quot;
createContext Creating context version 3 . 0 3 attributes
QWindowsGLContext 0x4d8ae50 ARB  requested:  QSurfaceFormat(version 3.0, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
    obtained # 12 ARB QSurfaceFormat(version 4.6, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
     PIXELFORMATDESCRIPTOR dwFlags=0x8225 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=24 cStencilBits=8 cAuxBuffers=4 iLayerType=0 cAlphaBits=8 cAlphaShift=24 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16  swap interval:  1 
    default:  ContextFormat: v4.6 profile: QSurfaceFormat::OpenGLContextProfile(NoProfile) options: QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions) 
    HGLRC= 0x10001 
== end log ==</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751116</commentid>
    <comment_count>1</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-05-10 09:03:21 +0000</bug_when>
    <thetext>Hi, 

I can confirm this issue. I get the following output:

ASSERT (krita): &quot;lod &gt; 0&quot; in file /home/boud/dev/krita/libs/image/kis_paint_device.cc, line 697
ASSERT (krita): &quot;lod &gt; 0&quot; in file /home/boud/dev/krita/libs/image/kis_paint_device.cc, line 697
ASSERT (krita): &quot;lod &gt; 0&quot; in file /home/boud/dev/krita/libs/image/kis_paint_device.cc, line 697
Unable to start Dr. Konqi
Re-raising signal for core dump handling.
ASSERT (krita): &quot;lod &gt; 0&quot; in file /home/boud/dev/krita/libs/image/kis_paint_device.cc, line 697</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751117</commentid>
    <comment_count>2</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-05-10 09:04:43 +0000</bug_when>
    <thetext>Backtrace:

(gdb) bt
#0  0x00007fffec5a5f67 in raise () from /lib64/libc.so.6
#1  0x00007fffec5a733a in abort () from /lib64/libc.so.6
#2  0x00007fffed256e9e in QMessageLogger::fatal(char const*, ...) const () from /usr/lib64/libQt5Core.so.5
#3  0x00007ffff3b5cad9 in kis_assert_common (assertion=assertion@entry=0x7ffff6411e09 &quot;lod &gt; 0&quot;, 
    file=file@entry=0x7ffff6411bd8 &quot;/home/boud/dev/krita/libs/image/kis_paint_device.cc&quot;, line=line@entry=697, 
    throwException=throwException@entry=false, isIgnorable=isIgnorable@entry=false)
    at /home/boud/dev/krita/libs/global/kis_assert.cpp:90
#4  0x00007ffff3b5cbea in kis_assert_recoverable (assertion=assertion@entry=0x7ffff6411e09 &quot;lod &gt; 0&quot;, 
    file=file@entry=0x7ffff6411bd8 &quot;/home/boud/dev/krita/libs/image/kis_paint_device.cc&quot;, line=line@entry=697)
    at /home/boud/dev/krita/libs/global/kis_assert.cpp:103
#5  0x00007ffff6325a78 in KisPaintDevice::Private::updateLodDataStruct (this=0x10630930, _dst=&lt;optimized out&gt;, 
    originalRect=...) at /home/boud/dev/krita/libs/image/kis_paint_device.cc:697
#6  0x00007ffff6325c59 in KisPaintDevice::updateLodDataStruct (this=&lt;optimized out&gt;, dst=&lt;optimized out&gt;, 
    srcRect=...) at /home/boud/dev/krita/libs/image/kis_paint_device.cc:2020
#7  0x00007ffff62cd748 in KisSyncLodCacheStrokeStrategy::doStrokeCallback (this=0x134ccf80, 
    data=&lt;optimized out&gt;) at /home/boud/dev/krita/libs/image/kis_sync_lod_cache_stroke_strategy.cpp:108
#8  0x00007ffff6405f4b in non-virtual thunk to KisUpdateJobItem::run() ()
   from /home/boud/dev/i-krita/lib64/libkritaimage.so.17
#9  0x00007fffed269172 in ?? () from /usr/lib64/libQt5Core.so.5
#10 0x00007fffed26be0f in ?? () from /usr/lib64/libQt5Core.so.5
#11 0x00007fffeb66a724 in start_thread () from /lib64/libpthread.so.0
#</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751230</commentid>
    <comment_count>3</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-05-10 17:43:37 +0000</bug_when>
    <thetext>https://bugs.kde.org/show_bug.cgi?id=394098 is probably a duplicate, even though the way to get to the crash is different.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751352</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-05-11 11:03:23 +0000</bug_when>
    <thetext>Git commit f64101001b131dc2b2c046e85a503f3912fad874 by Dmitry Kazakov.
Committed on 11/05/2018 at 11:03.
Pushed by dkazakov into branch &apos;kazakov/animation-cache-swapping&apos;.

Fix a crash when copy-pasting data between two different images

We shouldn&apos;t use makeCloneFromRough() on the devices that belong to
the nodes, because it resets the defaultBounds() link of the source.
Use KisPainter::copyAreaOptimized() instead.

M  +2    -0    libs/image/kis_paint_device.cc
M  +3    -2    libs/ui/actions/KisPasteActionFactory.cpp

https://commits.kde.org/krita/f64101001b131dc2b2c046e85a503f3912fad874</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751354</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-05-11 11:04:39 +0000</bug_when>
    <thetext>Git commit 07420801e47da6c0a97ee732672523b40234e380 by Dmitry Kazakov.
Committed on 11/05/2018 at 11:04.
Pushed by dkazakov into branch &apos;krita/4.0&apos;.

Fix a crash when copy-pasting data between two different images

We shouldn&apos;t use makeCloneFromRough() on the devices that belong to
the nodes, because it resets the defaultBounds() link of the source.
Use KisPainter::copyAreaOptimized() instead.

M  +2    -0    libs/image/kis_paint_device.cc
M  +3    -2    libs/ui/actions/KisPasteActionFactory.cpp

https://commits.kde.org/krita/07420801e47da6c0a97ee732672523b40234e380</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751359</commentid>
    <comment_count>6</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-05-11 11:07:59 +0000</bug_when>
    <thetext>*** Bug 394109 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751958</commentid>
    <comment_count>7</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-05-12 09:19:44 +0000</bug_when>
    <thetext>Git commit b9fcb63fd1b71f7dc206e622485e007eaf97915a by Dmitry Kazakov.
Committed on 12/05/2018 at 09:19.
Pushed by dkazakov into branch &apos;kazakov/animation-cache-swapping&apos;.

Fix crash on OSX because of wrong implementation of KoShape::compareShapeZIndex()

Compare function should return false when comparing an item with itself

M  +8    -0    libs/flake/KoShape.cpp

https://commits.kde.org/krita/b9fcb63fd1b71f7dc206e622485e007eaf97915a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751959</commentid>
    <comment_count>8</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-05-12 09:20:08 +0000</bug_when>
    <thetext>Git commit 6ed15803e1ced414fe83b4e817d2cfd792a64aef by Dmitry Kazakov.
Committed on 12/05/2018 at 09:19.
Pushed by dkazakov into branch &apos;krita/4.0&apos;.

Fix crash on OSX because of wrong implementation of KoShape::compareShapeZIndex()

Compare function should return false when comparing an item with itself

M  +8    -0    libs/flake/KoShape.cpp

https://commits.kde.org/krita/6ed15803e1ced414fe83b4e817d2cfd792a64aef</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751960</commentid>
    <comment_count>9</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-05-12 09:21:44 +0000</bug_when>
    <thetext>Git commit b9637823322a2d0e4b88aafedb36ab4d61f61b9f by Dmitry Kazakov.
Committed on 12/05/2018 at 09:21.
Pushed by dkazakov into branch &apos;master&apos;.

Fix crash on OSX because of wrong implementation of KoShape::compareShapeZIndex()

Compare function should return false when comparing an item with itself

M  +8    -0    libs/flake/KoShape.cpp

https://commits.kde.org/krita/b9637823322a2d0e4b88aafedb36ab4d61f61b9f</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1753632</commentid>
    <comment_count>10</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-05-19 21:03:46 +0000</bug_when>
    <thetext>Git commit 0c8d097953fad6a0fa01644bf6d63f50d64e95b3 by Dmitry Kazakov.
Committed on 19/05/2018 at 21:03.
Pushed by dkazakov into branch &apos;master&apos;.

Fix a crash when copy-pasting data between two different images

We shouldn&apos;t use makeCloneFromRough() on the devices that belong to
the nodes, because it resets the defaultBounds() link of the source.
Use KisPainter::copyAreaOptimized() instead.

M  +2    -0    libs/image/kis_paint_device.cc
M  +3    -2    libs/ui/actions/KisPasteActionFactory.cpp

https://commits.kde.org/krita/0c8d097953fad6a0fa01644bf6d63f50d64e95b3</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>