Bug 391992 - crash on close
Summary: crash on close
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.0
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 392215 392326 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-18 11:44 UTC by Antonio Rojas
Modified: 2018-05-22 08:54 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
CMakeCache (98.12 KB, text/plain)
2018-03-18 14:01 UTC, Antonio Rojas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2018-03-18 11:44:20 UTC
Krita 4.0.0 crashes when closing it. Using sip 4.19.8, PyQt 5.10.1

Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
0x00007fffee4a2e39 in sem_wait@@GLIBC_2.2.5 () from /usr/lib/libpthread.so.0
(gdb) bt
#0  0x00007fffee4a2e39 in sem_wait@@GLIBC_2.2.5 () at /usr/lib/libpthread.so.0
#1  0x00007fffb68acf26 in PyThread_acquire_lock_timed () at /usr/lib/libpython3.6m.so.1.0
#2  0x00007fffb69a30cd in  () at /usr/lib/libpython3.6m.so.1.0
#3  0x00007fffb6839d56 in  () at /usr/lib/libpython3.6m.so.1.0
#4  0x00007fffb5e9c345 in  () at /usr/lib/python3.6/site-packages/sip.so
#5  0x00007fffb5bfbce7 in sipDockWidgetFactoryBase::~sipDockWidgetFactoryBase() (this=0x5555600102d0, __in_chrg=<optimized out>)
    at /build/krita/src/build/plugins/extensions/pykrita/sip/./krita/sipkritapart0.cpp:30662
#6  0x00007fffb5bfbd0a in sipDockWidgetFactoryBase::~sipDockWidgetFactoryBase() (this=0x5555600102d0, __in_chrg=<optimized out>)
    at /build/krita/src/build/plugins/extensions/pykrita/sip/./krita/sipkritapart0.cpp:30663
#7  0x00007ffff196867e in qDeleteAll<QList<KoDockFactoryBase*>::const_iterator>(QList<KoDockFactoryBase*>::const_iterator, QList<KoDockFactoryBase*>::const_iterator) (end=..., begin=...) at /usr/include/qt/QtCore/qalgorithms.h:320
#8  0x00007ffff196867e in qDeleteAll<QList<KoDockFactoryBase*> >(QList<KoDockFactoryBase*> const&) (c=...) at /usr/include/qt/QtCore/qalgorithms.h:328
#9  0x00007ffff196867e in KoDockRegistry::~KoDockRegistry() (this=0x7ffff1d40080 <_ZZN12_GLOBAL__N_116Q_QGS_s_instance13innerFunctionEvE6holder>, __in_chrg=<optimized out>) at /build/krita/src/krita-4.0.0/libs/flake/KoDockRegistry.cpp:52
#10 0x00007ffff196879a in (anonymous namespace)::Q_QGS_s_instance::Holder::~Holder() (this=<optimized out>, __in_chrg=<optimized out>)
    at /build/krita/src/krita-4.0.0/libs/flake/KoDockRegistry.cpp:31
#11 0x00007ffff479f448 in __run_exit_handlers () at /usr/lib/libc.so.6
#12 0x00007ffff479f49a in  () at /usr/lib/libc.so.6
#13 0x00007ffff4788f51 in __libc_start_main () at /usr/lib/libc.so.6
#14 0x00005555558462fa in _start ()
Comment 1 Halla Rempt 2018-03-18 13:00:29 UTC
I cannot reproduce that either on Ubuntu or OpenSUSE (or Windows or macOS), so I suspect it's something specific to arch or how Krita is build on arch. Are you building from git, or from the as-yet unreleased Krita 4.0.0 tarball?
Comment 2 Antonio Rojas 2018-03-18 13:43:53 UTC
From the tarball
Comment 3 Halla Rempt 2018-03-18 13:49:53 UTC
Then it must be something to do with the build options... Could you attach the cmakecache.txt file?
Comment 4 Antonio Rojas 2018-03-18 14:01:28 UTC
Created attachment 111481 [details]
CMakeCache
Comment 5 Halla Rempt 2018-03-18 14:19:21 UTC
Hm... Could you check whether the crash goes away if you specify a build type? It's unspecified at, probably defaults to fulldebug or something like that. Try RelWithDebInfo or KritaDevs or Release.
Comment 6 Quiralta 2018-03-18 16:58:01 UTC
I can reproduce this too, its been present for the last two weeks, I just assumed its some update in Archlinux (as Krita often looks for a previous version of some libraries) but this time I can't tell what is causing the crash, which happens every close.

GDB gives me exactly the same error as Antonio, I'm building from the git master, also on Arch/Plasma system, full clean builds.

my build command:
cmake -DCMAKE_INSTALL_PREFIX=$HOME/Downloads/Krita-git/inst $HOME/Downloads/Krita-git/src -DWITH_GMIC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPACKAGERS_BUILD=ON -DBUILD_TESTING=OFF -DPYTHON_EXECUTABLE=/usr/bin/python -DPYQT_SIP_DIR_OVERRIDE=/usr/share/sip/PyQt5 -Wno-dev
Comment 7 Antonio Rojas 2018-03-18 18:57:45 UTC
Downgrading sip to 4.19.7 fixes the problem
Comment 8 Antonio Rojas 2018-03-18 19:01:03 UTC
This is the only significant change in sip 4.19.8

https://www.riverbankcomputing.com/hg/sip/rev/71bfa703c4ee
Comment 9 Halla Rempt 2018-03-18 20:54:20 UTC
Looks like you've found the issue :-) Now we'll have to tell Phil about it!
Comment 10 Halla Rempt 2018-03-19 12:37:54 UTC
Notified the PyQt mailing list
Comment 11 Antonio Rojas 2018-03-23 07:30:40 UTC
*** Bug 392215 has been marked as a duplicate of this bug. ***
Comment 12 Halla Rempt 2018-03-28 14:32:10 UTC
*** Bug 392326 has been marked as a duplicate of this bug. ***
Comment 13 Halla Rempt 2018-03-28 14:33:23 UTC
It doesn't seem like the issue is in sip, maybe we're really doing something wrong. reopening.
Comment 14 Halla Rempt 2018-04-03 10:59:01 UTC
Git commit ddf8e6b7fee6afc0bf4e3e05f6ea7d3a7cc3e94b by Boudewijn Rempt.
Committed on 03/04/2018 at 10:57.
Pushed by rempt into branch 'master'.

Leak the dock widget factories for now

For some reason, deleting these item causes crashes with certain
versions of sip. Probably because the order of destruction of
registries is undefined and can happen after Python is destroyed.

M  +5    -3    libs/flake/KoDockRegistry.cpp

https://commits.kde.org/krita/ddf8e6b7fee6afc0bf4e3e05f6ea7d3a7cc3e94b
Comment 15 Halla Rempt 2018-04-03 11:47:50 UTC
Git commit a5bf320844ad14945b17e883821b8cf81b24111e by Boudewijn Rempt.
Committed on 03/04/2018 at 11:21.
Pushed by rempt into branch 'krita/4.0'.

Leak the dock widget factories for now

For some reason, deleting these item causes crashes with certain
versions of sip. Probably because the order of destruction of
registries is undefined and can happen after Python is destroyed.
(cherry picked from commit ddf8e6b7fee6afc0bf4e3e05f6ea7d3a7cc3e94b)

M  +5    -3    libs/flake/KoDockRegistry.cpp

https://commits.kde.org/krita/a5bf320844ad14945b17e883821b8cf81b24111e