Bug 407665 - Using selections crashes Krita
Summary: Using selections crashes Krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Selection (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR critical
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression, release_blocker
Depends on:
Blocks:
 
Reported: 2019-05-17 21:05 UTC by Storm Engineer
Modified: 2019-05-21 07:23 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Storm Engineer 2019-05-17 21:05:01 UTC
Using selections crashes Krita.


Reproduce:
 - Open or create a file
 - Try to use the rectangular selection tool


Krita

 Version: 4.2.0-beta (git fb226d0)
 Languages: en_US
 Hidpi: false

Qt

  Version (compiled): 5.12.3
  Version (loaded): 5.12.3

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.0.13-arch1-1-ARCH
  Pretty Productname: Arch Linux
  Product Type: arch
  Product Version: unknown


Hardware Information

  GPU Acceleration: auto
  Memory: 16006 Mb
  Number of Cores: 8
  Swap Location: /tmp
Comment 1 Halla Rempt 2019-05-17 21:13:06 UTC
Backtrace: 

SAFE ASSERT (krita): "allowAsChild(newNode)" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 499
SAFE ASSERT (krita): "m_d->rootLayer->selectionMask()" in file /home/boud/dev/krita/libs/image/kis_image.cc, line 489
ASSERT: "d" in file /home/boud/dev/krita/libs/global/kis_shared_ptr.h, line 180

Thread 29 "Thread (pooled)" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffc55a6700 (LWP 21127)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff42bd535 in __GI_abort () at abort.c:79
#2  0x00007ffff46ab8d7 in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff46aad59 in qt_assert(char const*, char const*, int) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff6e85400 in KisSharedPtr<KisSelection>::operator-> (this=<optimized out>) at /usr/include/c++/8/bits/atomic_base.h:303
#5  KisSelectionToolHelper::ClearPixelSelection::paint (this=<optimized out>)
    at /home/boud/dev/krita/libs/ui/tool/kis_selection_tool_helper.cpp:180
#6  0x00007ffff5bcd655 in KisTransactionBasedCommand::redo (this=0x5555605984b0)
    at /home/boud/dev/krita/libs/image/commands_new/kis_transaction_based_command.cpp:34
#7  0x00007ffff5cc0f01 in KisStrokeStrategyUndoCommandBased::doStrokeCallback (this=0x55555b64bae0, data=<optimized out>)
    at /usr/include/c++/8/bits/atomic_base.h:295
#8  0x00007ffff5ed7813 in non-virtual thunk to KisUpdateJobItem::run() () from /home/boud/dev/i-krita/lib/x86_64-linux-gnu/libkritaimage.so.18
#9  0x00007ffff46e4f71 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff46ecc87 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff2114164 in start_thread (arg=<optimized out>) at pthread_create.c:486
#12 0x00007ffff43b5def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Comment 2 M 2019-05-17 21:20:48 UTC
My GDB output:

[New Thread 0x7fffdc96b700 (LWP 25947)]
QObject::startTimer: Timers cannot have negative intervals
[New Thread 0x7fffd5b1d700 (LWP 25948)]
[New Thread 0x7fffd531c700 (LWP 25949)]
/home/snu/Applications/kritadev/install/lib64/krita-python-libs/krita added to PYTHONPATH
[New Thread 0x7fffc6ecb700 (LWP 25950)]
[New Thread 0x7fffc5ba0700 (LWP 25951)]
[New Thread 0x7fffc535f700 (LWP 25952)]
[New Thread 0x7fffc4b5e700 (LWP 25953)]
[New Thread 0x7fffb7a97700 (LWP 25954)]
[New Thread 0x7fffb7296700 (LWP 25955)]
[New Thread 0x7fffb6a95700 (LWP 25956)]
[New Thread 0x7fffb6294700 (LWP 25957)]
[New Thread 0x7fffb5a93700 (LWP 25958)]
[New Thread 0x7fffb5292700 (LWP 25959)]
[New Thread 0x7fffb4a91700 (LWP 25960)]
[New Thread 0x7fff93fff700 (LWP 25961)]
[New Thread 0x7fff937fe700 (LWP 25962)]
[New Thread 0x7fff92ffd700 (LWP 25963)]
[New Thread 0x7fff927fc700 (LWP 25964)]
[New Thread 0x7fff91ffb700 (LWP 25965)]
[Thread 0x7fff91ffb700 (LWP 25965) exited]
[Thread 0x7fff927fc700 (LWP 25964) exited]
[Thread 0x7fff92ffd700 (LWP 25963) exited]
[Thread 0x7fff937fe700 (LWP 25962) exited]
[New Thread 0x7fff92ffd700 (LWP 25966)]
[Thread 0x7fff92ffd700 (LWP 25966) exited]
[New Thread 0x7fff92ffd700 (LWP 25968)]
[Thread 0x7fff92ffd700 (LWP 25968) exited]
[New Thread 0x7fff92ffd700 (LWP 25969)]

Thread 32 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff92ffd700 (LWP 25969)]
KisSelection::pixelSelection (this=0x0) at /home/snu/Applications/kritadev/krita/libs/image/kis_selection.cc:203
203         return m_d->pixelSelection;
(gdb) thread apply all backtrace

Thread 32 (Thread 0x7fff92ffd700 (LWP 25969)):
#0  KisSelection::pixelSelection (this=0x0) at /home/snu/Applications/kritadev/krita/libs/image/kis_selection.cc:203
#1  0x00007ffff6fb37c8 in KisSelectionToolHelper::ClearPixelSelection::paint (this=<optimized out>)
    at /home/snu/Applications/kritadev/krita/libs/ui/tool/kis_selection_tool_helper.cpp:180
Backtrace stopped: Cannot access memory at address 0x7fff92ffcc58

Thread 25 (Thread 0x7fff93fff700 (LWP 25961)):
Python Exception <class 'gdb.error'> Couldn't get registers: No such process.: 
Couldn't get registers: No such process.
Comment 3 Halla Rempt 2019-05-17 21:24:38 UTC
This broke in  ad3649935d0a2a7c9b6e4f6fecc421c69e53c3ca -- so, Dmitry, please fix this ASAP.
Comment 4 Halla Rempt 2019-05-18 08:52:18 UTC
Git commit d2a01862bee1e67a531c8fe7042ce4a9b6a3e8d4 by Boudewijn Rempt.
Committed on 18/05/2019 at 08:51.
Pushed by rempt into branch 'master'.

Revert "Add a workaround for reinitializing rotation/mirroring options after reloading the preset"

This reverts commit 756991435ecdf2c1af8aabb137beec4cd39ba277.

Revert this for now so the builds made during the weekend are not
so very broken.
Related: bug 407375

M  +0    -15   libs/ui/kis_paintop_box.cc

https://invent.kde.org/kde/krita/commit/d2a01862bee1e67a531c8fe7042ce4a9b6a3e8d4
Comment 5 Halla Rempt 2019-05-19 15:39:25 UTC
Git commit fef5185cb436f3499659e444dc959eec765c800e by Boudewijn Rempt.
Committed on 18/05/2019 at 12:36.
Pushed by rempt into branch 'master'.

Revert "Recover forbidding rule for adding masks to the root layer"

This reverts commit ad3649935d0a2a7c9b6e4f6fecc421c69e53c3ca.

    Revert this for now so the builds made during the weekend are not
    so very broken.
Related: bug 407375

M  +0    -8    libs/image/kis_group_layer.cc
M  +0    -12   libs/image/kis_image.cc
M  +0    -12   libs/image/kis_image.h
M  +0    -1    libs/ui/kis_mimedata.cpp

https://invent.kde.org/kde/krita/commit/fef5185cb436f3499659e444dc959eec765c800e
Comment 6 Dmitry Kazakov 2019-05-20 12:33:53 UTC
Git commit ad31625eae8f9701e5de65b11d79065139ce3741 by Dmitry Kazakov.
Committed on 20/05/2019 at 12:33.
Pushed by dkazakov into branch 'master'.

One more try to fix restriction for adding masks to the root layer

We should not allow adding a mask to normal root layers. It makes
painters confused. But for clipboard contents is it perfectly okay,
so just add an option for it.

It the previous version the check for the presence of a global
selection mask was incorrect.
Related: bug 397796, bug 407375

BACKPORT:krita/4.2

M  +15   -3    libs/image/kis_group_layer.cc
M  +12   -0    libs/image/kis_image.cc
M  +12   -0    libs/image/kis_image.h
M  +1    -0    libs/ui/kis_mimedata.cpp
M  +5    -2    libs/ui/tool/kis_selection_tool_helper.cpp

https://invent.kde.org/kde/krita/commit/ad31625eae8f9701e5de65b11d79065139ce3741
Comment 7 Halla Rempt 2019-05-21 07:23:38 UTC
Git commit 1b932bd47ad00202e9d22c37396582c34bd2b4de by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 21/05/2019 at 07:23.
Pushed by rempt into branch 'krita/4.2'.

One more try to fix restriction for adding masks to the root layer

We should not allow adding a mask to normal root layers. It makes
painters confused. But for clipboard contents is it perfectly okay,
so just add an option for it.

It the previous version the check for the presence of a global
selection mask was incorrect.
Related: bug 397796, bug 407375

BACKPORT:krita/4.2

M  +15   -3    libs/image/kis_group_layer.cc
M  +12   -0    libs/image/kis_image.cc
M  +12   -0    libs/image/kis_image.h
M  +1    -0    libs/ui/kis_mimedata.cpp
M  +5    -2    libs/ui/tool/kis_selection_tool_helper.cpp

https://invent.kde.org/kde/krita/commit/1b932bd47ad00202e9d22c37396582c34bd2b4de
Comment 8 Halla Rempt 2019-05-21 07:23:38 UTC
Git commit 421cf05f37c1a1e74173e35d5f405c3f2c09faf1 by Boudewijn Rempt.
Committed on 21/05/2019 at 07:23.
Pushed by rempt into branch 'krita/4.2'.

Revert "Recover forbidding rule for adding masks to the root layer"

This reverts commit ad3649935d0a2a7c9b6e4f6fecc421c69e53c3ca.

    Revert this for now so the builds made during the weekend are not
    so very broken.
Related: bug 407375

M  +0    -8    libs/image/kis_group_layer.cc
M  +0    -12   libs/image/kis_image.cc
M  +0    -12   libs/image/kis_image.h
M  +0    -1    libs/ui/kis_mimedata.cpp

https://invent.kde.org/kde/krita/commit/421cf05f37c1a1e74173e35d5f405c3f2c09faf1