Bug 417233

Summary: Transforming&copy-pasting vector shapes > Wait a while > Krita goes unresponsive. ("Krita.exe is not responding...")
Product: [Applications] krita Reporter: acc4commissions
Component: Layers/VectorAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73
Priority: NOR    
Version First Reported In: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description acc4commissions 2020-02-06 13:10:34 UTC
SUMMARY
git e050fb6

It's hard to catch when exactly it happens, but it doesn't seem random.

I'll post more as I get more informations.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Dmitry Kazakov 2020-02-06 13:40:31 UTC
Hi, acc4commissions!

Thank you for the report! I'm working on a fix atm. Please be careful, in the current version of master you will not be able to save the image with vector shapes, it'll most probably hang up :(
Comment 2 Dmitry Kazakov 2020-02-06 16:47:24 UTC
Git commit 45fa9fb936bb00faa75865b8663d20bbb0785ea3 by Dmitry Kazakov.
Committed on 06/02/2020 at 16:46.
Pushed by dkazakov into branch 'master'.

Fix possible deadlocks in KisShapeLayer and KisShapeLayerCanvas

Using Qt::BlockingQueuedConnection is dangerous. The GUI thread may
easily block on KisImage::barrierLock()/waitForDone() and the worker
thread will become blocked in the deadlock.

To overcome this issue KisBusyWaitBroker class was introduced. It
tracks all the locks of KisImage and breaks the tie of the deadlock
in favour of the worker thread, when needed.

The code that runs in a context of a worker thread and needs to pass a
blocking signal should utilize KisSafeBlockingQueueConnectionProxy class.
It passes the signal in a safe way, breaking the tie with KisBusyWaitBroker
if needed.

M  +1    -0    libs/global/kis_signal_compressor_with_param.cpp
M  +37   -4    libs/global/kis_signal_compressor_with_param.h
M  +2    -0    libs/image/CMakeLists.txt
A  +111  -0    libs/image/KisBusyWaitBroker.cpp     [License: GPL (v2+)]
A  +71   -0    libs/image/KisBusyWaitBroker.h     [License: GPL (v2+)]
C  +20   -2    libs/image/KisSafeBlockingQueueConnectionProxy.cpp [from: libs/global/kis_signal_compressor_with_param.cpp - 052% similarity]
A  +124  -0    libs/image/KisSafeBlockingQueueConnectionProxy.h     [License: GPL (v2+)]
M  +9    -0    libs/image/kis_image.cc
M  +0    -2    libs/image/kis_legacy_undo_adapter.cpp
M  +11   -0    libs/ui/KisPart.cpp
M  +12   -6    libs/ui/flake/kis_shape_layer.cc
M  +2    -8    libs/ui/flake/kis_shape_layer.h
M  +3    -3    libs/ui/flake/kis_shape_layer_canvas.cpp
M  +2    -3    libs/ui/flake/kis_shape_layer_canvas.h

https://invent.kde.org/kde/krita/commit/45fa9fb936bb00faa75865b8663d20bbb0785ea3