https://bugs.kde.org/show_bug.cgi?id=420317

            Bug ID: 420317
           Summary: Python wrapper creates a non-None Node for null parent
                    (which causes an assert)
           Product: krita
           Version: git master
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Scripting
          Assignee: krita-bugs-n...@kde.org
          Reporter: tamtamy.tym...@gmail.com
  Target Milestone: ---

SUMMARY
In cpp part of Krita, the parentNode() of the root layer will be null. In
Python wrapper, it will return a non-None Node with "" as name() etc.


STEPS TO REPRODUCE
1. Open an image with one layer.
2. Access the parentNode() of that layer.
3. Access the parentNode() of the parentNode()

OBSERVED RESULT
There will be an assert thrown:
ASSERT: "d" in file /home/tymon/kritadev/krita/libs/global/kis_shared_ptr.h,
line 180

EXPECTED RESULT
No assert. The parentNode() at some point will return None, signalising the end
of the hierarchy (instead of non-Nones all the way up :) )

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.0-prealpha (git 54b7496) (last upstream: 3145ca0914)
 Languages: pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.11.1
  Version (loaded): 5.11.1

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.3.7-050307-generic
  Pretty Productname: Linux Mint 19.3
  Product Type: linuxmint
  Product Version: 19.3
  Desktop: X-Cinnamon

ADDITIONAL INFORMATION
Relevant part of the backtrace:

#0  0x00007ffff3ef6ed7 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff3ed8535 in __GI_abort () at abort.c:79
#2  0x00007ffff46c08d7 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff46bfd59 in qt_assert_x(char const*, char const*, char const*,
int) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fffcd3cd7f5 in KisSharedPtr<KisNode>::operator->() (this=<optimized
out>) at /home/tymon/kritadev/krita/libs/global/kis_shared_ptr.h:180
#5  0x00007fffcd3f2d29 in Node::createNode(KisSharedPtr<KisImage>,
KisSharedPtr<KisNode>, QObject*) (image=..., node=..., parent=0x0) at
/home/tymon/kritadev/krita/libs/libkis/Node.cpp:87
#6  0x00007fffcd3f3556 in Node::parentNode() const (this=0x555563c2d0a0) at
/home/tymon/kritadev/krita/libs/global/kis_shared_ptr.h:179
#7  0x00007fffcceaa003 in meth_Node_parentNode(PyObject*, PyObject*)
(sipSelf=<optimized out>, sipArgs=<optimized out>) at
/home/tymon/kritadev/build/plugins/extensions/pykrita/sip/./krita/sipkritapart0.cpp:19504

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to