Bug 424638 - Crash when using move tool on the transform mask
Summary: Crash when using move tool on the transform mask
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
: 423126 423695 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-25 08:34 UTC by acc4commissions
Modified: 2020-08-03 22:26 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description acc4commissions 2020-07-25 08:34:18 UTC
SUMMARY
git 2f76eb4

The title says it all. Although we're not supposed to use it that way it shouldn't crash.


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

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2020-07-25 11:19:55 UTC
Backtrace:

ASSERT: "d" in file /home/boud/dev/krita/libs/global/kis_shared_ptr.h, line 180

Thread 94 "Thread (pooled)" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff2a7fc700 (LWP 3321)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff275ff47 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff27618b1 in __GI_abort () at abort.c:79
#2  0x00007ffff318c68b in qt_message_fatal (context=..., message=<synthetic pointer>...)
    at global/qlogging.cpp:1914
#3  0x00007ffff318c68b in QMessageLogger::fatal(char const*, ...) const
    (this=this@entry=0x7fff2a7fba30, msg=msg@entry=0x7ffff348c9a0 "ASSERT: \"%s\" in file %s, line %d")
    at global/qlogging.cpp:893
#4  0x00007ffff318be81 in qt_assert(char const*, char const*, int)
    (assertion=assertion@entry=0x7ffff6d9d1ef "d", file=file@entry=0x7ffff6d9db28 "/home/boud/dev/krita/libs/global/kis_shared_ptr.h", line=line@entry=180) at global/qglobal.cpp:3342
#5  0x00007ffff6b2b078 in KisSharedPtr<KisNode>::operator->() (this=<optimized out>)
    at /home/boud/dev/krita/libs/global/kis_shared_ptr.h:180
#6  0x00007ffff6b2b078 in MoveStrokeStrategy::<lambda()>::operator()(void) const (__closure=<optimized out>)
    at /home/boud/dev/krita/libs/ui/tool/strokes/move_stroke_strategy.cpp:150
#7  0x00007ffff54e74bb in KisStrokeStrategyUndoCommandBased::doStrokeCallback(KisStrokeJobData*)
    (this=0x7fffc000aa80, data=0x7fff2c089210)
    at /home/boud/dev/krita/libs/image/kis_stroke_strategy_undo_command_based.cpp:134
#8  0x00007ffff6b2a313 in non-virtual thunk to MoveStrokeStrategy::doStrokeCallback(KisStrokeJobData*) ()
    at /home/boud/dev/krita/libs/ui/tool/strokes/move_stroke_strategy.cpp:238
#9  0x00007ffff5339eeb in KisStrokeJob::run() (this=<optimized out>)
    at /home/boud/dev/krita/libs/image/kis_stroke_job.h:44
#10 0x00007ffff5339eeb in KisUpdateJobItem::run() (this=0x55555c277c50)
    at /home/boud/dev/krita/libs/image/kis_update_job_item.h:102
#11 0x00007ffff31b4382 in QThreadPoolThread::run() (this=0x7fff34018d20) at thread/qthreadpool.cpp:99
#12 0x00007ffff31b0c2c in QThreadPrivate::start(void*) (arg=0x7fff34018d20) at thread/qthread_unix.cpp:342
#13 0x00007fffec06e6db in start_thread (arg=0x7fff2a7fc700) at pthread_create.c:463
#14 0x00007ffff2842a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Comment 2 Tiar 2020-07-26 12:18:03 UTC
> Although we're not supposed to use it that way it shouldn't crash.

Move Tool did work on a transform mask some time ago (like a year or so).
Comment 3 Tiar 2020-07-27 21:12:47 UTC
*** Bug 423695 has been marked as a duplicate of this bug. ***
Comment 4 Tiar 2020-07-31 16:54:13 UTC
*** Bug 423126 has been marked as a duplicate of this bug. ***
Comment 5 Dmitry Kazakov 2020-08-03 22:15:22 UTC
Git commit 26c61baafcad95a3d6dcd40d0b7af53073b1fa63 by Dmitry Kazakov.
Committed on 03/08/2020 at 22:10.
Pushed by dkazakov into branch 'master'.

Fix crash when moving a Transform Mask with the Move Tool

The patch does two things:

1) MoveStrokeStrategy should not try to request node->projection()
   unconditionally, because transform masks don't have them. Instead,
   the strategy should request current level of detail directly from
   the image.

2) The patch also fixes image() pointer in the masks. The pointer
   should be passed directly in the mask's constructor.

M  +3    -3    libs/image/kis_effect_mask.cc
M  +1    -1    libs/image/kis_effect_mask.h
M  +2    -2    libs/image/kis_filter_mask.cpp
M  +1    -1    libs/image/kis_filter_mask.h
M  +3    -3    libs/image/kis_mask.cc
M  +1    -1    libs/image/kis_mask.h
M  +8    -13   libs/image/kis_selection_mask.cpp
M  +0    -2    libs/image/kis_selection_mask.h
M  +2    -2    libs/image/kis_transform_mask.cpp
M  +1    -1    libs/image/kis_transform_mask.h
M  +3    -3    libs/image/kis_transparency_mask.cc
M  +1    -1    libs/image/kis_transparency_mask.h
M  +9    -4    libs/image/lazybrush/kis_colorize_mask.cpp
M  +1    -1    libs/image/lazybrush/kis_colorize_mask.h
M  +3    -3    libs/image/tests/kis_async_merger_test.cpp
M  +1    -1    libs/image/tests/kis_colorize_mask_test.cpp
M  +1    -1    libs/image/tests/kis_crop_processing_visitor_test.cpp
M  +16   -29   libs/image/tests/kis_filter_mask_test.cpp
M  +0    -1    libs/image/tests/kis_filter_mask_test.h
M  +1    -1    libs/image/tests/kis_image_test.cpp
M  +1    -1    libs/image/tests/kis_layer_style_projection_plane_test.cpp
M  +3    -3    libs/image/tests/kis_layer_test.cpp
M  +10   -7    libs/image/tests/kis_mask_test.cpp
M  +2    -2    libs/image/tests/kis_paint_layer_test.cpp
M  +6    -20   libs/image/tests/kis_projection_leaf_test.cpp
M  +10   -19   libs/image/tests/kis_transform_mask_test.cpp
M  +1    -6    libs/image/tests/kis_transparency_mask_test.cpp
M  +0    -1    libs/image/tests/kis_transparency_mask_test.h
M  +10   -10   libs/image/tests/kis_walkers_test.cpp
M  +3    -3    libs/libkis/Document.cpp
M  +1    -2    libs/libkis/FilterMask.cpp
M  +1    -1    libs/ui/dialogs/kis_dlg_filter.cpp
M  +4    -5    libs/ui/kis_mask_manager.cc
M  +1    -1    libs/ui/tests/KisPaintOnTransparencyMaskTest.cpp
M  +2    -6    libs/ui/tests/kis_file_layer_test.cpp
M  +6    -12   libs/ui/tests/util.h
M  +2    -1    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +1    -1    plugins/impex/libkra/kis_kra_load_visitor.cpp
M  +10   -10   plugins/impex/libkra/kis_kra_loader.cpp
M  +3    -3    plugins/impex/libkra/kis_kra_loader.h
M  +2    -2    plugins/impex/libkra/tests/kis_kra_saver_test.cpp
M  +7    -14   plugins/impex/libkra/tests/util.h
M  +1    -2    plugins/impex/psd/psd_loader.cpp
M  +1    -1    plugins/impex/xcf/kis_xcf_import.cpp
M  +1    -1    plugins/tools/tool_transform2/tests/test_animated_transform_parameters.cpp
M  +1    -1    sdk/tests/empty_nodes_test.h
M  +1    -2    sdk/tests/qimage_based_test.h

https://invent.kde.org/graphics/krita/commit/26c61baafcad95a3d6dcd40d0b7af53073b1fa63
Comment 6 Dmitry Kazakov 2020-08-03 22:26:19 UTC
Git commit a7ca30f3688db13cfe9ea4fec7ced2e3b98a7279 by Dmitry Kazakov.
Committed on 03/08/2020 at 22:19.
Pushed by dkazakov into branch 'krita/4.3'.

Fix crash when moving a Transform Mask with the Move Tool

The patch does two things:

1) MoveStrokeStrategy should not try to request node->projection()
   unconditionally, because transform masks don't have them. Instead,
   the strategy should request current level of detail directly from
   the image.

2) The patch also fixes image() pointer in the masks. The pointer
   should be passed directly in the mask's constructor.

# Conflicts:
#	libs/image/kis_filter_mask.cpp
#	libs/image/tests/kis_filter_mask_test.cpp

M  +3    -3    libs/image/kis_effect_mask.cc
M  +1    -1    libs/image/kis_effect_mask.h
M  +2    -3    libs/image/kis_filter_mask.cpp
M  +1    -1    libs/image/kis_filter_mask.h
M  +3    -3    libs/image/kis_mask.cc
M  +1    -1    libs/image/kis_mask.h
M  +8    -13   libs/image/kis_selection_mask.cpp
M  +0    -2    libs/image/kis_selection_mask.h
M  +2    -2    libs/image/kis_transform_mask.cpp
M  +1    -1    libs/image/kis_transform_mask.h
M  +3    -3    libs/image/kis_transparency_mask.cc
M  +1    -1    libs/image/kis_transparency_mask.h
M  +9    -4    libs/image/lazybrush/kis_colorize_mask.cpp
M  +1    -1    libs/image/lazybrush/kis_colorize_mask.h
M  +3    -3    libs/image/tests/kis_async_merger_test.cpp
M  +1    -1    libs/image/tests/kis_colorize_mask_test.cpp
M  +1    -1    libs/image/tests/kis_crop_processing_visitor_test.cpp
M  +15   -29   libs/image/tests/kis_filter_mask_test.cpp
M  +0    -1    libs/image/tests/kis_filter_mask_test.h
M  +1    -1    libs/image/tests/kis_image_test.cpp
M  +1    -1    libs/image/tests/kis_layer_style_projection_plane_test.cpp
M  +3    -3    libs/image/tests/kis_layer_test.cpp
M  +10   -7    libs/image/tests/kis_mask_test.cpp
M  +2    -2    libs/image/tests/kis_paint_layer_test.cpp
M  +6    -20   libs/image/tests/kis_projection_leaf_test.cpp
M  +10   -19   libs/image/tests/kis_transform_mask_test.cpp
M  +1    -6    libs/image/tests/kis_transparency_mask_test.cpp
M  +0    -1    libs/image/tests/kis_transparency_mask_test.h
M  +10   -10   libs/image/tests/kis_walkers_test.cpp
M  +3    -3    libs/libkis/Document.cpp
M  +1    -2    libs/libkis/FilterMask.cpp
M  +1    -1    libs/ui/dialogs/kis_dlg_filter.cpp
M  +4    -5    libs/ui/kis_mask_manager.cc
M  +1    -1    libs/ui/tests/KisPaintOnTransparencyMaskTest.cpp
M  +2    -6    libs/ui/tests/kis_file_layer_test.cpp
M  +6    -12   libs/ui/tests/util.h
M  +2    -1    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +1    -1    plugins/impex/libkra/kis_kra_load_visitor.cpp
M  +10   -10   plugins/impex/libkra/kis_kra_loader.cpp
M  +3    -3    plugins/impex/libkra/kis_kra_loader.h
M  +2    -2    plugins/impex/libkra/tests/kis_kra_saver_test.cpp
M  +7    -14   plugins/impex/libkra/tests/util.h
M  +1    -2    plugins/impex/psd/psd_loader.cpp
M  +1    -1    plugins/impex/xcf/kis_xcf_import.cpp
M  +1    -1    plugins/tools/tool_transform2/tests/test_animated_transform_parameters.cpp
M  +1    -1    sdk/tests/empty_nodes_test.h
M  +1    -2    sdk/tests/qimage_based_test.h

https://invent.kde.org/graphics/krita/commit/a7ca30f3688db13cfe9ea4fec7ced2e3b98a7279