Bug 418855

Summary: Layer content is invisible after applying transform on a system under load
Product: [Applications] krita Reporter: Anna Medonosova <anna.medonosova>
Component: Tools/TransformAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, halla, tamtamy.tymona
Priority: NOR Keywords: triaged
Version First Reported In: 4.2.8   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screen capture of the problem

Description Anna Medonosova 2020-03-14 19:41:42 UTC
Created attachment 126789 [details]
Screen capture of the problem

SUMMARY
When the system is under load, content of both normal and vector layers turns invisible after applying any transform. Usually when an operation takes a long time, there is a progress bar under the layer name in the Layers docker. However, in this case, there is no progress bar and the transformed area does not reappear.

Layer content reappears when the canvas is redrawn (e.g. tool change, window focus change).

Curiously enough, I have not seen it happen when transforming selections.

It seems similar to bug https://bugs.kde.org/show_bug.cgi?id=408057, but it happens on Linux and also I have reproduced it only when the CPUs are overloaded (image size or layer count do not seem to impact this issue).

I have reproduced the same behavior on 4.2.8, 4.2.9beta1 and git master.


STEPS TO REPRODUCE
1. Open a document in Krita, create a layer, draw something
2. Stress the system (compile Krita in the background on all your cores, or use some synthetic load generator, like stress-ng)
3. Switch back to Krita, select the Transform Tool, do any transformation available
4. Confirm the transformation with the Enter key

OBSERVED RESULT
The transformed area turns invisible.

EXPECTED RESULT
The transformed area reappears after some time. There is a progress bar in the Layers docker showing that there is an operation in progress.

ADDITIONAL INFORMATION

Krita

Version: 4.2.8
Languages: en_US, en_US, en_US, en_US, en_US, en_US
Hidpi: false

Qt

Version (compiled): 5.12.5
Version (loaded): 5.12.5

OS Information

Build ABI: x86_64-little_endian-lp64
Build CPU: x86_64
CPU: x86_64
Kernel Type: linux
Kernel Version: 5.3.0-40-generic
Pretty Productname: Ubuntu 19.10
Product Type: ubuntu
Product Version: 19.10

OpenGL Info
Vendor: "Intel Open Source Technology Center"
Renderer: "Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) "
Version: "3.0 Mesa 19.2.8"
Shading language: "1.30"
Requested format: QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile)
Current format: QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
Version: 3.0
Supports deprecated functions true
is OpenGL ES: false

QPA OpenGL Detection Info
supportsDesktopGL: true
supportsOpenGLES: true
isQtPreferOpenGLES: false

Hardware Information

GPU Acceleration: auto
Memory: 7849 Mb
Number of Cores: 4
Swap Location: /tmp

Current Settings

    Current Swap Location: /tmp
    Undo Enabled: 1
    Undo Stack Limit: 30
    Use OpenGL: 1
    Use OpenGL Texture Buffer: 1
    Use AMD Vectorization Workaround: 0
    Canvas State: OPENGL_SUCCESS
    Autosave Interval: 600
    Use Backup Files: 1
    Number of Backups Kept: 1
    Backup File Suffix: ~
    Backup Location: Same Folder as the File
    Use Win8 Pointer Input: 0
    Use RightMiddleTabletButton Workaround: 0
    Levels of Detail Enabled: 0
    Use Zip64: 0
Comment 1 Halla Rempt 2020-03-17 09:52:09 UTC
I'm not sure what we could do about this. I've tried to reproduce on a large image with Qt 5.12 building with -j16 on an 8-core laptop. Maybe that's because I'm using kwin with compositing disabled -- it simply looks like something is going wrong with the textures inside the GPU.
Comment 2 Tiar 2021-05-19 00:41:19 UTC
Might be related to bug 437306.
Comment 3 Dmitry Kazakov 2021-05-20 13:41:40 UTC
Hi, Anna!

Could you please test this AppImage? I have fixed several bugs, that look very related to this issue. I guess it should be fixed as well. I cannot reproduce that even by loading the system with stress-ng. Both modes, in-stack preview and overlay preview seem to work fine.

https://disk.yandex.ru/d/x7jjJQAj5eSsbg
Comment 4 Anna Medonosova 2021-05-21 15:00:23 UTC
Hi, Dmitry,

with your appimage I couldn't reproduce the issue anymore (while it shows up quite consistently on the 4.4.3 appimage).
Comment 5 Dmitry Kazakov 2021-05-24 08:21:21 UTC
Hi, Anna!

Thanks a lot! Then it should be considered as fixed! :)