Bug 426384

Summary: Krita crashes when closed
Product: [Applications] krita Reporter: thomas.bockman
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: crash CC: ghevan, halla, kde, silocoder
Priority: NOR Keywords: drkonqi
Version: 4.2.9   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description thomas.bockman 2020-09-10 20:37:44 UTC
Application: krita (4.2.9)

Qt Version: 5.12.8
Frameworks Version: 5.68.0
Operating System: Linux 5.4.0-47-lowlatency x86_64
Windowing system: X11
Distribution: Ubuntu 20.04.1 LTS

-- Information about the crash:
- What I was doing when the application crashed:

When I open Krita, wait for it to load fully, and then close it, it crashes. It doesn't seem to matter what else I do in between opening and closing it.

The crash can be reproduced every time.

-- Backtrace:
Application: Krita (krita), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fc8a6700800 (LWP 23342))]

Thread 3 (Thread 0x7fc88e49a700 (LWP 23351)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fc8ab5f50b0 in QtLinuxFutex::_q_futex (val3=0, addr2=0x0, val2=0, val=<optimized out>, op=0, addr=<optimized out>) at thread/qfutex_p.h:105
#2  QtLinuxFutex::futexWait<QBasicAtomicInteger<unsigned int> > (expectedValue=<optimized out>, futex=...) at thread/qfutex_p.h:107
#3  futexSemaphoreTryAcquire_loop<true> (u=..., curValue=<optimized out>, nn=8589934593, timeout=timeout@entry=-1) at thread/qsemaphore.cpp:219
#4  0x00007fc8ab5f4f16 in futexSemaphoreTryAcquire<true> (timeout=<optimized out>, n=1, u=...) at /usr/include/c++/9/bits/atomic_base.h:539
#5  QSemaphore::tryAcquire (this=0x55e9755d7200, n=n@entry=1, timeout=timeout@entry=-1) at thread/qsemaphore.cpp:484
#6  0x00007fc8acab87c7 in KisTileDataSwapper::waitForWork (this=this@entry=0x7fc8acdee000 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at ./libs/image/tiles3/swap/kis_tile_data_swapper.cpp:86
#7  0x00007fc8acab89aa in KisTileDataSwapper::run (this=0x7fc8acdee000 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at ./libs/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#8  0x00007fc8ab5f29d2 in QThreadPrivate::start (arg=0x7fc8acdee000 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at thread/qthread_unix.cpp:361
#9  0x00007fc8a95c9609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fc8ab268103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fc89d10d700 (LWP 23348)):
#0  __GI___libc_read (nbytes=16, buf=0x7fc89d10cb60, fd=21) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=21, buf=0x7fc89d10cb60, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007fc8a8e0289f in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fc8a8db9cfe in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fc8a8dba152 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fc8a8dba2e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007fc8ab812583 in QEventDispatcherGlib::processEvents (this=0x7fc898000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#7  0x00007fc8ab7b94db in QEventLoop::exec (this=this@entry=0x7fc89d10cd70, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#8  0x00007fc8ab5f1785 in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#9  0x00007fc8a95fcefa in ?? () from /lib/x86_64-linux-gnu/libQt5DBus.so.5
#10 0x00007fc8ab5f29d2 in QThreadPrivate::start (arg=0x7fc8a967fd80) at thread/qthread_unix.cpp:361
#11 0x00007fc8a95c9609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#12 0x00007fc8ab268103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fc8a6700800 (LWP 23342)):
[KCrash Handler]
#6  std::__atomic_base<int>::load (__m=std::memory_order_relaxed, this=0x360030) at /usr/include/c++/9/bits/atomic_base.h:413
#7  QAtomicOps<int>::load<int> (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:227
#8  QBasicAtomicInteger<int>::load (this=0x360030) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:103
#9  QtPrivate::RefCount::ref (this=0x360030) at ../../include/QtCore/../../src/corelib/tools/qrefcount.h:55
#10 QList<QGesture*>::QList (this=0x55e976464e58, l=...) at ../../include/QtCore/../../src/corelib/tools/qlist.h:812
#11 0x00007fc8ac22c44e in QMapData<QGestureManager::ObjectGesture, QList<QGesture*> >::createNode (left=false, parent=0x0, v=..., k=..., this=0x55e96d6a5f50) at /usr/include/c++/9/new:174
#12 QMapNode<QGestureManager::ObjectGesture, QList<QGesture*> >::copy (this=0x55e975b4cce0, d=d@entry=0x55e96d6a5f50) at ../../include/QtCore/../../src/corelib/tools/qmap.h:258
#13 0x00007fc8ac22c474 in QMapNode<QGestureManager::ObjectGesture, QList<QGesture*> >::copy (this=0x7fc8ab331c10 <main_arena+144>, d=d@entry=0x55e96d6a5f50) at ../../include/QtCore/../../src/corelib/tools/qmap.h:97
#14 0x00007fc8ac22c474 in QMapNode<QGestureManager::ObjectGesture, QList<QGesture*> >::copy (this=0x55e9770368f0, d=d@entry=0x55e96d6a5f50) at ../../include/QtCore/../../src/corelib/tools/qmap.h:97
#15 0x00007fc8ac22c509 in QMap<QGestureManager::ObjectGesture, QList<QGesture*> >::detach_helper (this=this@entry=0x55e974ce1420) at ../../include/QtCore/../../src/corelib/tools/qmap.h:242
#16 0x00007fc8ac2213dc in QMap<QGestureManager::ObjectGesture, QList<QGesture*> >::detach (this=0x55e974ce1420) at ../../include/QtCore/../../src/corelib/tools/qrefcount.h:102
#17 QMap<QGestureManager::ObjectGesture, QList<QGesture*> >::begin (this=0x55e974ce1420) at ../../include/QtCore/../../src/corelib/tools/qmap.h:557
#18 QGestureManager::cleanupCachedGestures (this=this@entry=0x55e974ce13f0, target=target@entry=0x55e975a42b70, type=Qt::PanGesture) at kernel/qgesturemanager.cpp:171
#19 0x00007fc8ac210908 in QWidget::~QWidget (this=0x55e975a42b70, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qmap.h:541
#20 0x00007fc8ac210e1d in QWidget::~QWidget (this=0x55e975a42b70, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1558
#21 0x00007fc8ab7e401e in QObjectPrivate::deleteChildren (this=this@entry=0x55e977032d40) at kernel/qobject.cpp:2017
#22 0x00007fc8ac210c29 in QWidget::~QWidget (this=0x55e977032d00, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1696
#23 0x00007fc8ac2e4931 in QComboBoxListView::~QComboBoxListView (this=0x55e977032d00, __in_chrg=<optimized out>) at ../../include/QtWidgets/5.12.8/QtWidgets/private/../../../../../src/widgets/widgets/qcombobox_p.h:85
#24 QComboBoxListView::~QComboBoxListView (this=0x55e977032d00, __in_chrg=<optimized out>) at ../../include/QtWidgets/5.12.8/QtWidgets/private/../../../../../src/widgets/widgets/qcombobox_p.h:85
#25 0x00007fc8ab7e401e in QObjectPrivate::deleteChildren (this=this@entry=0x55e9770370f0) at kernel/qobject.cpp:2017
#26 0x00007fc8ac210c29 in QWidget::~QWidget (this=0x55e977037050, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1696
#27 0x00007fc8ac2e6df8 in QComboBoxPrivateContainer::~QComboBoxPrivateContainer (this=0x55e977037050, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qbasictimer.h:56
#28 QComboBoxPrivateContainer::~QComboBoxPrivateContainer (this=0x55e977037050, __in_chrg=<optimized out>) at ../../include/QtWidgets/5.12.8/QtWidgets/private/../../../../../src/widgets/widgets/qcombobox_p.h:218
#29 0x00007fc8ab7e401e in QObjectPrivate::deleteChildren (this=this@entry=0x55e97605c040) at kernel/qobject.cpp:2017
#30 0x00007fc8ac210c29 in QWidget::~QWidget (this=0x55e975f636f0, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1696
#31 0x00007fc88ccd725d in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-38-x86_64-linux-gnu.so
#32 0x00007fc88d50f3f5 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#33 0x00007fc88d6ebb60 in ?? () from /usr/lib/python3/dist-packages/sip.cpython-38-x86_64-linux-gnu.so
#34 0x00007fc88d50f0a0 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#35 0x00007fc88d9a4d16 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#36 0x00007fc88d9ed3cc in PyVectorcall_Call () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#37 0x00007fc88d855cf7 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#38 0x00007fc88d8da635 in Py_FinalizeEx () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#39 0x00007fc8942aaaf9 in PyKrita::Python::maybeFinalize () at ./plugins/extensions/pykrita/plugin/utilities.cpp:468
#40 PyKrita::Python::maybeFinalize () at ./plugins/extensions/pykrita/plugin/utilities.cpp:460
#41 0x00007fc8942aac90 in PyKrita::finalize () at ./plugins/extensions/pykrita/plugin/utilities.cpp:141
#42 0x00007fc8942a7d1b in KritaPyQtPlugin::~KritaPyQtPlugin (this=0x55e975cc9480, __in_chrg=<optimized out>) at ./plugins/extensions/pykrita/plugin/plugin.cpp:95
#43 KritaPyQtPlugin::~KritaPyQtPlugin (this=0x55e975cc9480, __in_chrg=<optimized out>) at ./plugins/extensions/pykrita/plugin/plugin.cpp:97
#44 0x00007fc8ab7e401e in QObjectPrivate::deleteChildren (this=this@entry=0x55e96cae3c80) at kernel/qobject.cpp:2017
#45 0x00007fc8ab7ee5ef in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1033
#46 0x00007fc8ab7bcaae in QCoreApplication::~QCoreApplication (this=0x7ffff595ef80, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qstringlist.h:99
#47 0x00007fc8ac1d349e in QApplication::~QApplication (this=0x7ffff595ef80, __in_chrg=<optimized out>) at kernel/qapplication.cpp:841
#48 0x00007fc8add9074f in QtSingleApplication::~QtSingleApplication (this=0x7ffff595ef80, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/atomic_base.h:326
#49 0x000055e96a453bdc in main (argc=<optimized out>, argv=0x7ffff595f0f8) at ./krita/main.cc:554
[Inferior 1 (process 23342) detached]

Possible duplicates by query: bug 425205, bug 422092, bug 420495, bug 417542, bug 414147.

Reported using DrKonqi
Comment 1 vanyossi 2020-09-11 00:03:00 UTC
Is the krita version correct? can you please update to latest krita stable (4.3.0) or better yet krita plus and confirm this is still the case?
Comment 2 thomas.bockman 2020-09-11 02:04:01 UTC
(In reply to vanyossi from comment #1)
> Is the krita version correct?
Yes.

> can you please update to latest krita stable (4.3.0)
Done. It still crashes with an extremely similar stack trace.
Comment 3 thomas.bockman 2020-09-11 02:29:36 UTC
I tried the appimage versions of Krita 4.3.0, and it works.

Perhaps the problem is an incompatibility with the version of some dependency currently being used by the Ubuntu packages.
Comment 4 Bug Janitor Service 2020-09-11 04:33:11 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 5 Halla Rempt 2020-09-11 08:50:35 UTC
*** Bug 426390 has been marked as a duplicate of this bug. ***
Comment 6 silocoder 2020-09-11 12:23:29 UTC
Also referenced *** Bug 426390 has been marked as a duplicate of this bug. ***

I can confirm that this close crash issue no longer exists in version below.
https://binary-factory.kde.org/job/Krita_Stable_Appimage_Build/
Last Successful Artifacts
	gmic_krita_qt-x86_64.appimage	30.52 MB	 view
	krita-4.4.0-alpha-c00326b-x86_64.appimage	215.27 MB	 view
	Krita-Plus-x86_64.appimage.zsync	377.06 KB	 view

When will this make it to Ubuntu KDE repository?

Thanks
Comment 7 Halla Rempt 2020-09-11 12:26:05 UTC
Same answer as for your other report; though when a distribution will actually package a release and for which update, that's not up to us. We recommend using the appimage in any case, because those use a heavily patched version of Qt.
Comment 8 thomas.bockman 2020-09-11 17:54:48 UTC
I don't think its the newer version fixing it. The 4.3.0 appimage works correctly, BUT the 4.3.0 Ubuntu package does not.

So is this now "resolved fixed" just because the appimage versions work? Are the Ubuntu packages unsupported?
Comment 9 Halla Rempt 2020-09-11 18:01:35 UTC
We do not support distribution packages; we cannot control what version of Qt, which Qt patches are in -- so, yes, only the appimages are supported by the krita team.
Comment 10 thomas.bockman 2020-09-11 18:45:38 UTC
(In reply to Boudewijn Rempt from comment #9)
> We do not support distribution packages

OK. Thanks for explaining. Shouldn't the status be "resolved downstream" then? Because this certainly hasn't been "fixed".
Comment 11 Halla Rempt 2020-09-11 18:46:43 UTC
Well, maybe. It's not like downstream is reading these reports :-)
Comment 12 thomas.bockman 2020-09-11 18:48:11 UTC
(In reply to Boudewijn Rempt from comment #11)
> Well, maybe. It's not like downstream is reading these reports :-)

Sure. It's just that it's confusing as a user to find a bug report marked as "fixed" when nothing was actually directly done about the problem.
Comment 13 Roland 2020-12-22 19:34:44 UTC
Created attachment 134270 [details]
New crash information added by DrKonqi

krita (4.2.9) using Qt 5.12.8

- What I was doing when the application crashed:
just looked at a png file and put it on the clipboard

- Unusual behavior I noticed:
none

- Custom settings of the application:
none

-- Backtrace (Reduced):
#12 0x00007fcb035f2908 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007fcb035f2e1d in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007fcb02bc601e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007fcb035f2c29 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
[...]
#17 0x00007fcb02bc601e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5