Bug 435633

Summary: removeNode() and removeChildNode() methods randomly crash
Product: [Applications] krita Reporter: Thibaut Richard <richardthibaut5>
Component: ScriptingAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED WORKSFORME    
Severity: crash CC: dimula73
Priority: NOR    
Version First Reported In: 4.4.3   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Stacktrace from kritacrash.log
Script to color a single frame with a color mask

Description Thibaut Richard 2021-04-11 21:47:35 UTC
SUMMARY


STEPS TO REPRODUCE
1. Have a project containing a paint layer
2. Create a Python script removing the child (either by calling remove() on the layer OR removeChildNode() on the root node)
3. 

OBSERVED RESULT


EXPECTED RESULT


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

ADDITIONAL INFORMATION
Comment 1 Thibaut Richard 2021-04-11 21:53:25 UTC
Created attachment 137516 [details]
Stacktrace from kritacrash.log

Relevant fragment of the most recent crash
Comment 2 Thibaut Richard 2021-04-11 22:07:50 UTC
Did not mean to submit this so quickly. Accidentally hit Enter.
Ignore the reproduction steps in the description. It's not possible to reproduce from a blank project.

Here is the actual setup:
1. Have a project containing at least a paint layer (animated), and a colorize mask as child.
2. Select the colorize mask
3. Run the script in attachment (colorFrame.py)

OBSERVED RESULT:
Program crashes. Sometimes. Appears to be random.

EXPECTED RESULT:
Script should convert color mask to paint layer, then merge it with its parent, therefore coloring a single frame of animation.
Comment 3 Thibaut Richard 2021-04-11 22:08:59 UTC
Created attachment 137517 [details]
Script to color a single frame with a color mask
Comment 4 Dmitry Kazakov 2021-08-10 14:24:42 UTC
Hi, Thibaut!

Could you please check if you can still reproduce the problem in 4.4.7 and Krita 5.0-nightly?

Please also make sure that you add `doc.waitForDone()` right after this line `k.action("convert_to_paint_layer").trigger()`. The action is asynchronous, so there is a race condition in the next line.
Comment 5 Bug Janitor Service 2021-08-25 04:36:37 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 6 Bug Janitor Service 2021-09-09 04:36:12 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!