Bug 447851

Summary: Finishing transform sometimes fails when user forget to approve (press Enter)
Product: [Applications] krita Reporter: hcorwin
Component: Tools/TransformAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: dimula73, halla
Priority: NOR    
Version First Reported In: 5.0.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description hcorwin 2022-01-02 18:23:35 UTC
SUMMARY
If big area (selection/layer/group) is being transformed and user decide to switch to another tool/operation, the transform sometimes cancels and area become blank, instead of finishing transforming. Krita also may crash after this. This behavior was observed on versions 4.4.1, 4.4.3, 5.0.0b1, 5.0.0b2 (maybe other betas) and 5.0.0 release. It also is hard to be produced in beginning of work and may be linked with high usage of memory.

STEPS TO REPRODUCE
1. Select some big bunch of pixels (with freehand select tool or without). Also observed when transforming groups.
2. Transform of any kind (slight/more, seems if it doesn't matter)
3. Attempt to perform some not-transform related actions (brush strokes, deselect, change current layer, etc)

OBSERVED RESULT
Crash, or visually nothing happened. Then user discovers that the layer being transformed is empty, but document show it's content until redraw of layer contents. Revealed by moving other layer over it, brush strokes, etc.

EXPECTED RESULT
Current normal behavior (forced approve transform, as if pressed Enter). This way krita work most time.

SOFTWARE/OS VERSIONS
Windows 8.1 MC or 10
Debian 10 Cinnamon

ADDITIONAL INFORMATION
Crash log: https://pastebin.com/q2W2E7wF
Comment 1 Halla Rempt 2022-01-04 09:01:50 UTC
Error occurred on Wednesday, December 29, 2021 at 10:28:27.
 
krita.exe caused an Access Violation at location 00007FFFA60955F2 in module libkritacommand.dll Reading from location 0000002300000021.
 
AddrPC           Params
00007FFFA60955F2 00000000711BA190 0000000071E7CE20 0000000000000000  libkritacommand.dll!0x55f2 KUndo2QStack::push+0x172
00007FFF7F23E3AB 000000001F10FEA0 00007FFF7F25361D 0000000000000001  libkritaimage.dll!0x13e3ab KisStrokeStrategyUndoCommandBased::finishStrokeCallback+0x10b
00007FFF7D24FC33 000000001F10FEA0 0000000015448410 00000000151CA560  libkritaui.dll!0x23fc33 MoveStrokeStrategy::finishStrokeCallback+0x433
00007FFF7F449D80 0000000000000010 000000001CF89B70 000000000CFE6A70  libkritaimage.dll!0x349d80 KisUpdateJobItem::run+0x90
00007FFF7EAF8A90 000000006F5E7AE0 000000000CFE6A00 0000000000000000  Qt5Core.dll!0x28a90 QThreadPool::tryStart+0x520
00007FFF7EAF1AAF 0000000000000000 0000000000000000 0000000000000000  Qt5Core.dll!0x21aaf QThread::qt_metacall+0x69f
00007FFFABF513D2 00007FFFABF513B0 0000000000000000 0000000000000000  KERNEL32.DLL!0x13d2 BaseThreadInitThunk+0x22
00007FFFAE7E03C4 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!0x703c4 RtlUserThreadStart+0x34
Comment 2 Dmitry Kazakov 2022-01-05 07:12:27 UTC
Hi, hcorwin!

The backtrace shows that Krita actually crashed in the Move Tool. Could you clarify a few questions?

1) Did you use Move Tool right after the transformation? Or you used the Move Tool for the transformation itself?
2) What are your settings in Settings->Performance->Instant Preview? Do you use "in-stack preview" for the transform tool? And do you have forced Instant Preview enabled for both Move and Transform tool?

PS:
By now I couldn't reproduce this issue, and answers to questions above might give some clues
Comment 3 hcorwin 2022-01-06 07:07:22 UTC
   Hello, unfortunately I don't remember clearly. I usually do not use
   Transform for moving.If Krita freezes, I often attempting to toggle
   current layer visibility on/off.In Performance->Instant preview all 4
   checkboxes are enabled (use in-stack, force, move tool, filters).

   05.01.2022, 16:12, "Dmitry Kazakov" <bugzilla_noreply@kde.org>:

     https://bugs.kde.org/show_bug.cgi?id=447851

     Dmitry Kazakov < dimula73@gmail.com[1]> changed:

     What |Removed |Added
     ----------------------------------------------------------------------------
     CC| | dimula73@gmail.com[1]

     --- Comment #2 from Dmitry Kazakov < dimula73@gmail.com[1]> ---
     Hi, hcorwin!

     The backtrace shows that Krita actually crashed in the Move Tool.
     Could you
     clarify a few questions?

     1) Did you use Move Tool right after the transformation? Or you
     used the Move
     Tool for the transformation itself?
     2) What are your settings in Settings->Performance->Instant
     Preview? Do you use
     "in-stack preview" for the transform tool? And do you have forced
     Instant
     Preview enabled for both Move and Transform tool?

     PS:
     By now I couldn't reproduce this issue, and answers to questions
     above might
     give some clues

     --
     You are receiving this mail because:
     You reported the bug.

   

   1. mailto:dimula73@gmail.com
Comment 4 Dmitry Kazakov 2022-07-18 07:21:37 UTC
Hi, hcorwin!

Thanks for your replies. I'll check what I can do with that :)

The actually relevant piece of the crash log:

Error occurred on Saturday, January 1, 2022 at 12:31:35.
 
krita.exe caused an Access Violation at location 00007FFF7BD35E00 in module libkritaimage.dll Reading from location 0000000000000018.
 
AddrPC           Params
00007FFF7BD35E00 0000000000000000 00007FFF7C00B800 000000003FF678A0  libkritaimage.dll!0x1f5e00 KisSelection::pixelSelection+0x0
00007FFF7B59220F 000000003FF67620 000000003FF67620 0000000011CE5B40  libkritaui.dll!0x32220f KisSelectAllActionFactory::run(KisViewManager*)::SelectAll::paint+0x2f
00007FFF7BBC392C 00000000175B9550 00007FFF7BC919B5 000000001783113C  libkritaimage.dll!0x8392c KisTransactionBasedCommand::redo+0x2c
00007FFF7BC7EA06 0000000325B1E700 00007FFF7AE3A3BD 0000000000000100  libkritaimage.dll!0x13ea06 KisStrokeStrategyUndoCommandBased::doStrokeCallback+0x76
00007FFF7BE89D80 0000000000000010 0000000025B1E700 000000003EBD74F0  libkritaimage.dll!0x349d80 KisUpdateJobItem::run+0x90
00007FFF7AC68A90 0000000036126F90 000000003EBD7400 0000000000000000  Qt5Core.dll!0x28a90 QThreadPool::tryStart+0x520
00007FFF7AC61AAF 0000000000000000 0000000000000000 0000000000000000  Qt5Core.dll!0x21aaf QThread::qt_metacall+0x69f
00007FFFABF513D2 00007FFFABF513B0 0000000000000000 0000000000000000  KERNEL32.DLL!0x13d2 BaseThreadInitThunk+0x22
00007FFFAE7E03C4 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!0x703c4 RtlUserThreadStart+0x34
Comment 5 Dmitry Kazakov 2022-07-18 07:24:06 UTC
This crash has been fixed as a part of bug 449122 with commit https://invent.kde.org/graphics/krita/-/commit/6cef8b54a8adfc4f7643bec6b261c5ff7b644213