Bug 404707 - When scaling mode is Nearest Neighbour, I can't preview animation
Summary: When scaling mode is Nearest Neighbour, I can't preview animation
Status: RESOLVED WORKSFORME
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 4.1.7
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-02-22 19:09 UTC by Geoffroy
Modified: 2019-05-30 04:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffroy 2019-02-22 19:09:54 UTC
SUMMARY

On Intel i3 skylake, when trying to preview my animation by pressing play in the animation docker, I can't see the animation everything turns black. Changing the Scaling Mode to High Quality Filtering, everything works fine. 


STEPS TO REPRODUCE
1. Import images for animation
2. Create few frame copying that original image
3. Press play in the animation docker

OBSERVED RESULT

I can only see a black image.

EXPECTED RESULT

Seeing an animation or having an alert that tells me that I should change my Scaling mode. 

SOFTWARE/OS VERSIONS
Archlinux
Linux/KDE Plasma: 4.1.7.101
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version:
Comment 1 Geoffroy 2019-02-22 19:10:53 UTC
Krita
  Version: 4.1.7.101

Qt
  Version (compiled): 5.12.0
  Version (loaded): 5.12.1

OS Information
  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.20.4-arch1-1-ARCH
  Pretty Productname: Arch Linux
  Product Type: arch
  Product Version: unknown

OpenGL Info
  **OpenGL not initialized**
Comment 2 wolthera 2019-04-08 14:48:17 UTC
ooh, I get an address sanitizer(type of debugger) crash when I try to reproduce this!

------------------------------------------------------------------------------
QLayout: Attempting to add QLayout "" to KisShortcutsDialog "", which already has a layout
Failed to fetch display info: "current platform doesn't support fetching display information"
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 9004, resource id: 35653242, major code: 40 (TranslateCoords), minor code: 0
Entering "KisAsyncAnimationRenderDialogBase::Result KisAsyncAnimationRenderDialogBase::regenerateRange()" numWorkers = 4 numThreadsPerWorker = 2
Entering "KisAsyncAnimationRenderDialogBase::Result KisAsyncAnimationRenderDialogBase::regenerateRange()" Copying done in 49
=================================================================
==5079==ERROR: AddressSanitizer: heap-use-after-free on address 0x60600128cd24 at pc 0x7f88499fb9e9 bp 0x7f87d44701e0 sp 0x7f87d44701d0
READ of size 4 at 0x60600128cd24 thread T30 (Thread (pooled))
    #0 0x7f88499fb9e8 in QArrayData::data() const (/home/wolthera/krita/inst/lib/x86_64-linux-gnu/libkritaui.so.18+0x2adf9e8)
    #1 0x7f8849a2f91d in QTypedArrayData<QRect>::data() const /usr/include/x86_64-linux-gnu/qt5/QtCore/qarraydata.h:209
    #2 0x7f8849a2e0ed in QTypedArrayData<QRect>::constBegin(QTypedArrayData<QRect>::const_iterator) const /usr/include/x86_64-linux-gnu/qt5/QtCore/qarraydata.h:215
    #3 0x7f8849a816c2 in QVector<QRect>::begin(QTypedArrayData<QRect>::const_iterator) const /usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h:215
    #4 0x7f8849ca862e in QtPrivate::QForeachContainer<QVector<QRect> >::QForeachContainer(QVector<QRect>&&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:977
    #5 0x7f8849ca6f4e in QtPrivate::QForeachContainer<std::decay<QVector<QRect> >::type> QtPrivate::qMakeForeachContainer<QVector<QRect> >(QVector<QRect>&&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1004
    #6 0x7f884a77ae3f in KisAnimationFrameCache::fetchFrameData(int, KisSharedPtr<KisImage>, QRegion const&) const /home/wolthera/krita/src/libs/ui/kis_animation_frame_cache.cpp:324
    #7 0x7f884a78894d in KisAsyncAnimationCacheRenderer::frameCompletedCallback(int, QRegion const&) /home/wolthera/krita/src/libs/ui/KisAsyncAnimationCacheRenderer.cpp:52
    #8 0x7f884a787bca in KisAsyncAnimationRendererBase::slotFrameRegenerationFinished(int) /home/wolthera/krita/src/libs/ui/KisAsyncAnimationRendererBase.cpp:116
    #9 0x7f884a7c4b31 in KisAsyncAnimationRendererBase::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/wolthera/krita/build/libs/ui/kritaui_autogen/EWIEGA46WW/moc_KisAsyncAnimationRendererBase.cpp:103
    #10 0x7f88435afe24 in QMetaObject::activate(QObject*, int, int, void**) (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2afe24)
    #11 0x7f88463d8225 in KisImageAnimationInterface::sigFrameReady(int) /home/wolthera/krita/build/libs/image/kritaimage_autogen/EWIEGA46WW/moc_kis_image_animation_interface.cpp:260
    #12 0x7f8845dcd65d in KisImageAnimationInterface::notifyFrameReady() /home/wolthera/krita/src/libs/image/kis_image_animation_interface.cpp:334
    #13 0x7f8845e34a2c in KisRegenerateFrameStrokeStrategy::finishStrokeCallback() /home/wolthera/krita/src/libs/image/kis_regenerate_frame_stroke_strategy.cpp:168
    #14 0x7f8845d5ba94 in SimpleStrokeJobStrategy::run(KisStrokeJobData*) /home/wolthera/krita/src/libs/image/kis_simple_stroke_strategy.cpp:44
    #15 0x7f8845d71390 in KisStrokeJob::run() /home/wolthera/krita/src/libs/image/kis_stroke_job.h:44
    #16 0x7f88463e54ca in KisUpdateJobItem::run() /home/wolthera/krita/build/libs/image/kritaimage_autogen/EWIEGA46WW/../../../../../src/libs/image/kis_update_job_item.h:91
    #17 0x7f88433ac351  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xac351)
    #18 0x7f88433a7bc1  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xa7bc1)
    #19 0x7f884234a6da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
    #20 0x7f8842a8f88e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x12188e)

0x60600128cd24 is located 4 bytes inside of 56-byte region [0x60600128cd20,0x60600128cd58)
freed by thread T34 (Thread (pooled)) here:
    #0 0x7f884f1497b8 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7b8)
    #1 0x7f8843e34744  (/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x3ff744)

previously allocated by thread T30 (Thread (pooled)) here:
    #0 0x7f884f149b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f88433b5071 in QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>) (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xb5071)

Thread T30 (Thread (pooled)) created by T0 here:
    #0 0x7f884f0a2d2f in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x37d2f)
    #1 0x7f88433a723d in QThread::start(QThread::Priority) (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xa723d)

Thread T34 (Thread (pooled)) created by T0 here:
    #0 0x7f884f0a2d2f in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x37d2f)
    #1 0x7f88433a723d in QThread::start(QThread::Priority) (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xa723d)

SUMMARY: AddressSanitizer: heap-use-after-free (/home/wolthera/krita/inst/lib/x86_64-linux-gnu/libkritaui.so.18+0x2adf9e8) in QArrayData::data() const
Shadow bytes around the buggy address:
  0x0c0c80249950: fa fa fa fa fa fa fa fa fa fa fa fa fd fd fd fd
  0x0c0c80249960: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fa
  0x0c0c80249970: fa fa fa fa fd fd fd fd fd fd fd fa fa fa fa fa
  0x0c0c80249980: fa fa fa fa fa fa fa fa fa fa fa fa fd fd fd fd
  0x0c0c80249990: fd fd fd fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x0c0c802499a0: fa fa fa fa[fd]fd fd fd fd fd fd fa fa fa fa fa
  0x0c0c802499b0: fd fd fd fd fd fd fd fa fa fa fa fa fd fd fd fd
  0x0c0c802499c0: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fa
  0x0c0c802499d0: fa fa fa fa fd fd fd fd fd fd fd fa fa fa fa fa
  0x0c0c802499e0: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
  0x0c0c802499f0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==5079==ABORTING
wolthera@Euthenia:~/krita/src$

Cannot reproduce it with this appimage though:

Krita

  Version: 4.2.0-pre-alpha (git be454f9)

Qt

  Version (compiled): 5.10.0
  Version (loaded): 5.10.0

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.15.0-46-generic
  Pretty Productname: KDE neon User Edition 5.15
  Product Type: neon
  Product Version: 18.04

OpenGL Info
 
  Vendor:  Intel Open Source Technology Center 
  Renderer:  "Mesa DRI Intel(R) UHD Graphics 620 (Kabylake GT2) " 
  Version:  "3.0 Mesa 18.2.8" 
  Shading language:  1.30 
  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, colorSpace QSurfaceFormat::ColorSpace(DefaultColorSpace), profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
  Current format:    QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, colorSpace QSurfaceFormat::ColorSpace(DefaultColorSpace), profile  QSurfaceFormat::OpenGLContextProfile(NoProfile)) 
     Version: 3.0
     Supports deprecated functions true 
     is OpenGL ES: false 
08 Apr 2019 16:45:48 +0200: Importing image/svg+xml to application/x-krita. Location: /home/wolthera/Downloads/Krita_gradient/vector.svg. Real location: /home/wolthera/Downloads/Krita_gradient/vector.svg. Batchmode: 0

Hardware Information

  GPU Acceleration: auto
  Memory: 7725 Mb
  Number of Cores: 8
  Swap Location: /tmp

I guess I'll set it to confirmed either how, there's something fishy going on here!
Comment 3 Halla Rempt 2019-04-30 10:27:44 UTC
Um, that must be completely unrelated -- the original report means that the opengl drivers on the reporter's system have problems with the nearest neighbour scaling algorithm (which is built into the driver), but not with our own shader-based implementation.

What would be interesting is whether Geoffrey can also reproduce this issue with the latest appimage: https://binary-factory.kde.org/job/Krita_Nightly_Appimage_Build/
Comment 4 Bug Janitor Service 2019-05-15 04:33:07 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2019-05-30 04:33:10 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!