Created attachment 144622 [details] Backtrace of the bug Hi, it's a bug I discussed on IRC and where dmitryK built a appimage with ASAN for helping me to detect. To reproduce: =========== 1. Open Krita, create a new document 2. Drag'n'drop an external jpg (or a kra, png) picture from file browser into the canvas , and choose → insert as a new layer. 3. Then right click on the layer of the imported picture and select on the menu: Add → Add a Transparency Mask. Result: ====== A dialog appears: SAFE ASSERT (krita): "qAbs(row) < 0x7FFF && qAbs(col) < 0x7FFF" in file /home/appimage/persistent/krita/libs/image/tiles3/kis_tile_hash_table2.h, line 151 It looks like that: https://www.peppercarrot.com/extras/temp/2021-12-17_screenshot_114756_net.jpg Info: ==== A backtrace is attached to this report and it's 100% reproducable. The appimage is 2021-12-17_krita-5.1.0-prealpha-7793838-ASAN-x86_64.appimage , from Krita git~master. It was tested in a vanilla new environment, Kubtuntu Linux 20.04LTS.
Git commit eae06ae046f65537c3a11577fa586ccf873ef7d1 by Dmitry Kazakov. Committed on 17/12/2021 at 12:59. Pushed by dkazakov into branch 'master'. Fix a crash after D&D of a layer into Krita and adding a mask The problem happened because the paint device of a pasted layer belonged to two different images at the same time. And the temporary image reset the image link during its destruction. M +11 -2 libs/image/kis_image.cc M +5 -2 libs/ui/kis_import_catcher.cc https://invent.kde.org/graphics/krita/commit/eae06ae046f65537c3a11577fa586ccf873ef7d1
Git commit 042134137f7889cb019f6271f6657de7cd834078 by Dmitry Kazakov. Committed on 17/12/2021 at 13:00. Pushed by dkazakov into branch 'krita/5.0'. Fix a crash after D&D of a layer into Krita and adding a mask The problem happened because the paint device of a pasted layer belonged to two different images at the same time. And the temporary image reset the image link during its destruction. (cherry picked from commit eae06ae046f65537c3a11577fa586ccf873ef7d1) M +11 -2 libs/image/kis_image.cc M +5 -2 libs/ui/kis_import_catcher.cc https://invent.kde.org/graphics/krita/commit/042134137f7889cb019f6271f6657de7cd834078
Git commit cb39296cd45c18d5c3b532266a8fe93680933d6e by Dmitry Kazakov. Committed on 17/12/2021 at 13:09. Pushed by dkazakov into branch 'krita/5.0'. [not for master] Remove a sanity check from Krita 5.0 It is safer to disable the resetting of the image link in the image's destructor for Krita 5.0, because there might be unexpected crashes like in the bug below. M +6 -3 libs/image/kis_image.cc https://invent.kde.org/graphics/krita/commit/cb39296cd45c18d5c3b532266a8fe93680933d6e
Git commit a9fc8fa7b270871996924e19ba7456cccab452b5 by Dmitry Kazakov. Committed on 17/12/2021 at 13:26. Pushed by dkazakov into branch 'master'. Remove a sanity check from master as well It breaks a lot of unittests on master (It is safer to disable the resetting of the image link in the image's destructor for Krita 5.0, because there might be unexpected crashes like in the bug below) (cherry picked from commit cb39296cd45c18d5c3b532266a8fe93680933d6e) M +6 -3 libs/image/kis_image.cc https://invent.kde.org/graphics/krita/commit/a9fc8fa7b270871996924e19ba7456cccab452b5