Summary: | krita crashes when switching the order of layers | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | wickedmic <bugreport> |
Component: | General | Assignee: | Dmitry Kazakov <dimula73> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | dimula73, halla |
Priority: | NOR | Keywords: | drkonqi |
Version: | 5.0.2 | ||
Target Milestone: | --- | ||
Platform: | Debian unstable | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/graphics/krita/commit/2e9c60d35aa02e0e4d5881ddbd6b64c94d762a35 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | krita-file as minimal crash example for bug report 450957 |
Description
wickedmic
2022-02-28 10:30:51 UTC
Can you check whether this also happens with the appimage instead of the distribution build? I tried krita-5.0.2-alpha-b0dc7adc07-x86_64.appimage and krita-5.1.0-prealpha-c824707a38-x86_64.appimage, and was able to reproduce the crash in both versions. I did some tests and found that this is only happening in one of my kra-files. All other files I tested did not produce this crash. So for that file I tried to successively remove layers to see if the problem goes away. When I removed all layers, which used transform masks, the crash did not occur anymore (not once after using krita for 1 or 2 hours). Also note: sometimes the crash does not happen immediately after clicking the 'Move layer or mask down', but after switching the layer back and forth a few times. Could you attach the file that shows the crash, or make it available for download? Thanks for your comment! Automatically switching the status of this bug to REPORTED so that the KDE team knows that the bug is ready to get confirmed. In the future you may also do this yourself when providing needed information. I can reproduce a crash when moving a layer with a transform mask attached using Ctrl+PgUp/PgDown shortcuts. It doesn't assert here, just crashed. But that is kind of expected. Created attachment 147254 [details]
krita-file as minimal crash example for bug report 450957
I was able to reduce my krita file down to a few layers so that the crash still occurs.
I can reproduce the crash with the attached file by swapping the layers named 'swap me for crash' a few times.
Hope that helps
Hi, wickedmic! Thank you for the test file! It makes it really easy to reproduce the bug here! :) Git commit 2e9c60d35aa02e0e4d5881ddbd6b64c94d762a35 by Dmitry Kazakov. Committed on 10/03/2022 at 16:09. Pushed by dkazakov into branch 'master'. Fix threading issues in the scheduler when manipulating layers After several iterations of changes to KisNode::changeRect() definition, KisBaseRectsWalker::changeRect() now means **not** the rect of the canvas that is changed by the walker on any layer, but only a rect that will be changed in the end of the merge operation. It means that two merge operations may still overlap on the intermediate layers if the layer stack has nodes with weird change/needRect(). And that can cause breakage of the tile manager's invariants, because two threads would write into overlapping areas. This patch fixes it in a suboptimal approach. Now the scheduler just checks if accessRect of the walkers intersect. That means that the scheduler now also blocks walkers with overlapping **read** rects, which are totally legal. M +7 -2 libs/image/kis_updater_context.cpp https://invent.kde.org/graphics/krita/commit/2e9c60d35aa02e0e4d5881ddbd6b64c94d762a35 Git commit 827c03d5ddd74a4f18f55ed892f49e391ec2ecc1 by Dmitry Kazakov. Committed on 10/03/2022 at 16:09. Pushed by dkazakov into branch 'master'. Make sure that actions that modify layers stack are exclusive If a layer gets removed while an update is running, the update may assert in some cases. M +16 -8 libs/ui/kis_node_juggler_compressed.cpp https://invent.kde.org/graphics/krita/commit/827c03d5ddd74a4f18f55ed892f49e391ec2ecc1 Git commit e465267b6b29d7ff53f1ee73b90d7b64858134f6 by Dmitry Kazakov. Committed on 16/03/2022 at 13:46. Pushed by dkazakov into branch 'master'. Fix KisRefreshSubtreeWalker to skip hidden layers when merging The test file in the referenced bug showed really slow updates because KisRefreshSubtreeWalker took the hidden transform masks into account when calculating update rect. M +1 -1 libs/image/kis_async_merger.cpp M +1 -1 libs/image/kis_refresh_subtree_walker.h https://invent.kde.org/graphics/krita/commit/e465267b6b29d7ff53f1ee73b90d7b64858134f6 Git commit d39f8a675b5fe6604dd4e9d64c7c0f76d4f68724 by Dmitry Kazakov. Committed on 16/03/2022 at 13:46. Pushed by dkazakov into branch 'master'. Do not recalculate entire group when a layer is moved When we move a layer inside a group, we need to only recompose the pregenerated layers. We don't need to regenerate all the projections of all the layers inside. The other layers may have complex masks, e.g. transformation masks. M +2 -2 libs/image/commands/kis_image_layer_move_command.cpp M +1 -0 libs/image/kis_base_rects_walker.h M +8 -3 libs/image/kis_full_refresh_walker.h M +14 -10 libs/image/kis_image.cc M +4 -4 libs/image/kis_image.h M +12 -4 libs/image/kis_image_interfaces.h M +2 -1 libs/image/kis_projection_updates_filter.cpp M +3 -2 libs/image/kis_projection_updates_filter.h M +25 -5 libs/image/kis_refresh_subtree_walker.h M +2 -1 libs/image/kis_regenerate_frame_stroke_strategy.cpp M +8 -0 libs/image/kis_simple_update_queue.cpp M +1 -0 libs/image/kis_simple_update_queue.h M +36 -6 libs/image/kis_suspend_projection_updates_stroke_strategy.cpp M +6 -0 libs/image/kis_update_scheduler.cpp M +1 -0 libs/image/kis_update_scheduler.h M +4 -1 libs/image/tests/kis_simple_update_queue_test.cpp M +2 -2 libs/ui/kis_node_juggler_compressed.cpp https://invent.kde.org/graphics/krita/commit/d39f8a675b5fe6604dd4e9d64c7c0f76d4f68724 Git commit 9b26379212cee78220e0f9c26e2e1668f2474327 by Dmitry Kazakov. Committed on 31/03/2022 at 13:43. Pushed by dkazakov into branch 'krita/5.0'. Make sure that actions that modify layers stack are exclusive If a layer gets removed while an update is running, the update may assert in some cases. M +16 -8 libs/ui/kis_node_juggler_compressed.cpp https://invent.kde.org/graphics/krita/commit/9b26379212cee78220e0f9c26e2e1668f2474327 Git commit 2d832ae6086921764b1db1bb470ae248aeb57465 by Dmitry Kazakov. Committed on 31/03/2022 at 13:43. Pushed by dkazakov into branch 'krita/5.0'. Do not recalculate entire group when a layer is moved When we move a layer inside a group, we need to only recompose the pregenerated layers. We don't need to regenerate all the projections of all the layers inside. The other layers may have complex masks, e.g. transformation masks. M +2 -2 libs/image/commands/kis_image_layer_move_command.cpp M +1 -0 libs/image/kis_base_rects_walker.h M +8 -3 libs/image/kis_full_refresh_walker.h M +14 -10 libs/image/kis_image.cc M +4 -4 libs/image/kis_image.h M +12 -4 libs/image/kis_image_interfaces.h M +2 -1 libs/image/kis_projection_updates_filter.cpp M +3 -2 libs/image/kis_projection_updates_filter.h M +25 -5 libs/image/kis_refresh_subtree_walker.h M +2 -1 libs/image/kis_regenerate_frame_stroke_strategy.cpp M +8 -0 libs/image/kis_simple_update_queue.cpp M +1 -0 libs/image/kis_simple_update_queue.h M +36 -6 libs/image/kis_suspend_projection_updates_stroke_strategy.cpp M +6 -0 libs/image/kis_update_scheduler.cpp M +1 -0 libs/image/kis_update_scheduler.h M +4 -1 libs/image/tests/kis_simple_update_queue_test.cpp M +2 -2 libs/ui/kis_node_juggler_compressed.cpp https://invent.kde.org/graphics/krita/commit/2d832ae6086921764b1db1bb470ae248aeb57465 Git commit 5c85897c73ea1e50ad15e14b3376f069a9b52687 by Dmitry Kazakov. Committed on 31/03/2022 at 13:43. Pushed by dkazakov into branch 'krita/5.0'. Fix KisRefreshSubtreeWalker to skip hidden layers when merging The test file in the referenced bug showed really slow updates because KisRefreshSubtreeWalker took the hidden transform masks into account when calculating update rect. M +1 -1 libs/image/kis_async_merger.cpp M +1 -1 libs/image/kis_refresh_subtree_walker.h https://invent.kde.org/graphics/krita/commit/5c85897c73ea1e50ad15e14b3376f069a9b52687 |