Bug 394068 - Can't copy between kra files, causes Runtime error
Summary: Can't copy between kra files, causes Runtime error
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.0.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression, release_blocker
: 394109 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-05-10 04:04 UTC by dragatora
Modified: 2018-05-19 21:03 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dragatora 2018-05-10 04:04:39 UTC
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:  "GeForce GTX 1070/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 390.65" 
  Shading language:  4.60 NVIDIA 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(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<QSurfaceFormat::FormatOption>(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<QSurfaceFormat::FormatOption>(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: "nvldumdx.dll", version=23.21.13.9065, "NVIDIA GeForce GTX 1070") renderer:  QFlags(0x1|0x2|0x4|0x8|0x20)
Qt: Using WGL and OpenGL from "opengl32.dll"
create OpenGL: "NVIDIA Corporation","GeForce GTX 1070/PCIe/SSE2" default ContextFormat: v4.6 profile: QSurfaceFormat::OpenGLContextProfile(NoProfile) options: QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions),SampleBuffers, Extension-API present
Extensions: 376
"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 "
createContext Creating context version 3 . 0 3 attributes
QWindowsGLContext 0x4d8adc0 ARB  requested:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(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<QSurfaceFormat::FormatOption>(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<QSurfaceFormat::FormatOption>(DeprecatedFunctions) 
    HGLRC= 0x30000
createPlatformOpenGLContext QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(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))
"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 "
createContext Creating context version 3 . 0 3 attributes
QWindowsGLContext 0x4d8ae50 ARB  requested:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(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<QSurfaceFormat::FormatOption>(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<QSurfaceFormat::FormatOption>(DeprecatedFunctions) 
    HGLRC= 0x10001 
== end log ==
Comment 1 Halla Rempt 2018-05-10 09:03:21 UTC
Hi, 

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

ASSERT (krita): "lod > 0" in file /home/boud/dev/krita/libs/image/kis_paint_device.cc, line 697
ASSERT (krita): "lod > 0" in file /home/boud/dev/krita/libs/image/kis_paint_device.cc, line 697
ASSERT (krita): "lod > 0" 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): "lod > 0" in file /home/boud/dev/krita/libs/image/kis_paint_device.cc, line 697
Comment 2 Halla Rempt 2018-05-10 09:04:43 UTC
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 "lod > 0", 
    file=file@entry=0x7ffff6411bd8 "/home/boud/dev/krita/libs/image/kis_paint_device.cc", 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 "lod > 0", 
    file=file@entry=0x7ffff6411bd8 "/home/boud/dev/krita/libs/image/kis_paint_device.cc", line=line@entry=697)
    at /home/boud/dev/krita/libs/global/kis_assert.cpp:103
#5  0x00007ffff6325a78 in KisPaintDevice::Private::updateLodDataStruct (this=0x10630930, _dst=<optimized out>, 
    originalRect=...) at /home/boud/dev/krita/libs/image/kis_paint_device.cc:697
#6  0x00007ffff6325c59 in KisPaintDevice::updateLodDataStruct (this=<optimized out>, dst=<optimized out>, 
    srcRect=...) at /home/boud/dev/krita/libs/image/kis_paint_device.cc:2020
#7  0x00007ffff62cd748 in KisSyncLodCacheStrokeStrategy::doStrokeCallback (this=0x134ccf80, 
    data=<optimized out>) 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
#
Comment 3 Halla Rempt 2018-05-10 17:43:37 UTC
https://bugs.kde.org/show_bug.cgi?id=394098 is probably a duplicate, even though the way to get to the crash is different.
Comment 4 Dmitry Kazakov 2018-05-11 11:03:23 UTC
Git commit f64101001b131dc2b2c046e85a503f3912fad874 by Dmitry Kazakov.
Committed on 11/05/2018 at 11:03.
Pushed by dkazakov into branch 'kazakov/animation-cache-swapping'.

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

We shouldn'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
Comment 5 Dmitry Kazakov 2018-05-11 11:04:39 UTC
Git commit 07420801e47da6c0a97ee732672523b40234e380 by Dmitry Kazakov.
Committed on 11/05/2018 at 11:04.
Pushed by dkazakov into branch 'krita/4.0'.

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

We shouldn'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
Comment 6 Dmitry Kazakov 2018-05-11 11:07:59 UTC
*** Bug 394109 has been marked as a duplicate of this bug. ***
Comment 7 Dmitry Kazakov 2018-05-12 09:19:44 UTC
Git commit b9fcb63fd1b71f7dc206e622485e007eaf97915a by Dmitry Kazakov.
Committed on 12/05/2018 at 09:19.
Pushed by dkazakov into branch 'kazakov/animation-cache-swapping'.

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
Comment 8 Dmitry Kazakov 2018-05-12 09:20:08 UTC
Git commit 6ed15803e1ced414fe83b4e817d2cfd792a64aef by Dmitry Kazakov.
Committed on 12/05/2018 at 09:19.
Pushed by dkazakov into branch 'krita/4.0'.

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
Comment 9 Dmitry Kazakov 2018-05-12 09:21:44 UTC
Git commit b9637823322a2d0e4b88aafedb36ab4d61f61b9f by Dmitry Kazakov.
Committed on 12/05/2018 at 09:21.
Pushed by dkazakov into branch 'master'.

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
Comment 10 Dmitry Kazakov 2018-05-19 21:03:46 UTC
Git commit 0c8d097953fad6a0fa01644bf6d63f50d64e95b3 by Dmitry Kazakov.
Committed on 19/05/2018 at 21:03.
Pushed by dkazakov into branch 'master'.

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

We shouldn'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