Bug 410909

Summary: Krita crashes when opening file with vector layer
Product: [Applications] krita Reporter: Karl Ove Hufthammer <karl>
Component: Tools/VectorAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: File which makes Krita freeze
gdb backtrace

Description Karl Ove Hufthammer 2019-08-14 19:04:08 UTC
Created attachment 122120 [details]
File which makes Krita freeze

SUMMARY
Krita freezes when opening the attached file.
The bug was introduced in the commit ‘Fix crash when creating a bezier curve’:
https://invent.kde.org/kde/krita/commit/1e5db24a24c2e3413f5a533e5a6efd92d772d2ae


STEPS TO REPRODUCE
1. Open the attached .kra file.


OBSERVED RESULT
Krita freezes.


EXPECTED RESULT
Krita should open the file.


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20190809
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60.0
Qt Version: 5.13.0
Kernel Version: 5.2.5-1-default
OS Type: 64-bit
Comment 1 Karl Ove Hufthammer 2019-08-14 19:05:53 UTC
Created attachment 122121 [details]
gdb backtrace

gdb backtrace created using ‘thread apply all backtrace’ after ‘Ctrl + C’ in gdb when Krita froze.
Comment 2 Dmitry Kazakov 2019-08-14 19:42:46 UTC
Git commit 9fb8eddaf11f92cf0eb183c840028286b34d8bfe by Dmitry Kazakov.
Committed on 14/08/2019 at 19:41.
Pushed by dkazakov into branch 'krita/4.2'.

Revert "Fix crash when creating a bezier curve"

This reverts commit aed25510add2f046b4cd96f0c4b4719a4d00fae1.

It causes a freeze when opening files with vector layers

M  +0    -22   libs/flake/KoShapeManager.cpp
M  +0    -2    libs/flake/KoShapeManager_p.h
M  +1    -1    libs/ui/tool/kis_tool_shape.cc

https://invent.kde.org/kde/krita/commit/9fb8eddaf11f92cf0eb183c840028286b34d8bfe
Comment 3 Dmitry Kazakov 2019-08-15 13:56:33 UTC
Git commit 1ec268fac79b1e16d20cf84739febd3e7750821d by Dmitry Kazakov.
Committed on 15/08/2019 at 13:55.
Pushed by dkazakov into branch 'master'.

Fix deadlocks in KoShapeManager caused by bezier curve fix

1) Some shapes (e.g. Text Shape) may emit shape-changed signal right
   during painting. It would cause a deadlock.

2) add/removeShape methods should be more careful about locking
   because of their tail-recursion nature.
Related: bug 410572

M  +78   -45   libs/flake/KoShapeManager.cpp
M  +2    -1    libs/flake/KoShapeManager_p.h

https://invent.kde.org/kde/krita/commit/1ec268fac79b1e16d20cf84739febd3e7750821d
Comment 4 Dmitry Kazakov 2019-08-15 15:25:00 UTC
Git commit c2d3c64b9be35b9ade4658f7b26e0a86f38e9a7c by Dmitry Kazakov.
Committed on 15/08/2019 at 14:41.
Pushed by dkazakov into branch 'krita/4.2'.

Fix deadlocks in KoShapeManager caused by bezier curve fix

1) Some shapes (e.g. Text Shape) may emit shape-changed signal right
   during painting. It would cause a deadlock.

2) add/removeShape methods should be more careful about locking
   because of their tail-recursion nature.
Related: bug 410572

M  +78   -45   libs/flake/KoShapeManager.cpp
M  +2    -1    libs/flake/KoShapeManager_p.h

https://invent.kde.org/kde/krita/commit/c2d3c64b9be35b9ade4658f7b26e0a86f38e9a7c