Bug 420612 - Krita: Segmentation fault when closing
Summary: Krita: Segmentation fault when closing
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.2.9
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: drkonqi
: 424105 424840 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-04-26 10:02 UTC by Matiee
Modified: 2021-04-22 14:25 UTC (History)
7 users (show)

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


Attachments
krita master with ubuntu 20.04 libs + breeze theme (5.52 KB, text/plain)
2020-04-26 20:19 UTC, Lynx3d
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matiee 2020-04-26 10:02:48 UTC
Application: krita (4.2.9)

Qt Version: 5.12.8
Frameworks Version: 5.68.0
Operating System: Linux 5.4.0-26-generic x86_64
Windowing system: X11
Distribution: Ubuntu 20.04 LTS

-- Information about the crash:
- What I was doing when the application crashed:
nothing: just installed the application, then opened (just to see if the installation was ok), then closed normally.
- Unusual behavior I noticed:
nothing
- Custom settings of the application:
none

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 0x7f7be2b2f800 (LWP 6440))]

Thread 7 (Thread 0x7f7bbc92f700 (LWP 6465)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f7be7a220b0 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007f7be7a21f16 in QSemaphore::tryAcquire(int, int) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007f7be8ee59aa in KisTileDataSwapper::run() () from /lib/x86_64-linux-gnu/libkritaimage.so.18
#4  0x00007f7be7a1f9d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f7be59f6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007f7be7695103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7f7bcf7fe700 (LWP 6462)):
#0  __GI___libc_read (nbytes=16, buf=0x7f7bcf7fdb60, fd=12) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=12, buf=0x7f7bcf7fdb60, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007f7be522f89f in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f7be51e6cfe in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f7be51e7152 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f7be51e72e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f7be7c3f583 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f7be7be64db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f7be7a1e785 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f7be5a29efa in ?? () from /lib/x86_64-linux-gnu/libQt5DBus.so.5
#10 0x00007f7be7a1f9d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f7be59f6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#12 0x00007f7be7695103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7f7bcffff700 (LWP 6461)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f7bc0003788) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7f7bc0003738, cond=0x7f7bc0003760) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7f7bc0003760, mutex=0x7f7bc0003738) at pthread_cond_wait.c:638
#3  0x00007f7bdadff3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007f7bdadfefeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007f7be59f6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007f7be7695103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7f7bd6733700 (LWP 6460)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f7bc0003788) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7f7bc0003738, cond=0x7f7bc0003760) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7f7bc0003760, mutex=0x7f7bc0003738) at pthread_cond_wait.c:638
#3  0x00007f7bdadff3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007f7bdadfefeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007f7be59f6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007f7be7695103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7f7bcdf32700 (LWP 6459)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f7bc0003788) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7f7bc0003738, cond=0x7f7bc0003760) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7f7bc0003760, mutex=0x7f7bc0003738) at pthread_cond_wait.c:638
#3  0x00007f7bdadff3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007f7bdadfefeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007f7be59f6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007f7be7695103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f7bd5f32700 (LWP 6458)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f7bc0003788) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7f7bc0003738, cond=0x7f7bc0003760) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7f7bc0003760, mutex=0x7f7bc0003738) at pthread_cond_wait.c:638
#3  0x00007f7bdadff3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007f7bdadfefeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007f7be59f6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007f7be7695103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f7be2b2f800 (LWP 6440)):
[KCrash Handler]
#6  0x00007f7be8659435 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00007f7be8659474 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007f7be8659474 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007f7be8659509 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007f7be864e3dc in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007f7be863d908 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007f7be863de1d in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007f7be7c1101e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007f7be863dc29 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007f7be8711931 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007f7be7c1101e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007f7be863dc29 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007f7be8713df8 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007f7be7c1101e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007f7be863dc29 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007f7baacab25d in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-38-x86_64-linux-gnu.so
#22 0x00007f7bab5233f5 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#23 0x00007f7bab73fb60 in ?? () from /usr/lib/python3/dist-packages/sip.cpython-38-x86_64-linux-gnu.so
#24 0x00007f7bab5230a0 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#25 0x00007f7babbd8d16 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#26 0x00007f7babc213cc in PyVectorcall_Call () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#27 0x00007f7baba89cf7 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#28 0x00007f7babb0e635 in Py_FinalizeEx () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#29 0x00007f7babefeaf9 in ?? () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritapykrita.so
#30 0x00007f7babefec90 in ?? () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritapykrita.so
#31 0x00007f7babefbd1b in ?? () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritapykrita.so
#32 0x00007f7be7c1101e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007f7be7c1b5ef in QObject::~QObject() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007f7be7be9aae in QCoreApplication::~QCoreApplication() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007f7be860049e in QApplication::~QApplication() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#36 0x00007f7bea1bd74f in QtSingleApplication::~QtSingleApplication() () from /lib/x86_64-linux-gnu/libkritaui.so.18
#37 0x00005632323a3bdc in main ()
[Inferior 1 (process 6440) detached]

Possible duplicates by query: bug 418530, bug 417465, bug 414728, bug 413345, bug 408889.

Reported using DrKonqi
Comment 1 Lynx3d 2020-04-26 13:41:02 UTC
Interesting, I just upgraded to 20.04 too and compiled krita master with system Qt, and got exactly the same crash. Then I built my own Qt again and no crash.

I have a feeling it has to do with the breeze theme, running krita (built with system Qt) with -style=fusion gave me no crash on a few tries, with the default breeze it seems to crash every time, either with this backtrace or when unloading pykrita.
Comment 2 Lynx3d 2020-04-26 20:19:48 UTC
Created attachment 127904 [details]
krita master with ubuntu 20.04 libs + breeze theme
Comment 3 Lynx3d 2020-04-26 20:28:57 UTC
Should have read the above backtrace more carefully, it always seems to happen when unloading pykrita plugin, the other threads don't matter.

And after plenty of tries, it always crashes with the Breeze style here, and never with the Fusion style.

Since tiar had a hard time finding a crash that turned out to be caused by incorrectly usage of a style object in KisColorFilterCombo I tested if that fix also works for this crash, but unfortunately not...I don't really have a clue what might be happening here, I couldn't find similar mistakes elsewhere (yet).
Comment 4 kevinmathieu2020 2020-04-30 13:12:34 UTC
hello, I have a similar bug, except that unlike my friends above, I have no script installed and my installation is totally new, the bug exists on virtual machine and also live on kubuntu 20.04, I didn't try the other distributions. I'm pretty new on linux, I don't want to venture too much in dark places.

I get the same error message at closing, segmentation fault.

The terminal gives me its information here:

[ QBasicTimer::start: QBasicTimer can only be used with threads started with QThread
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = krita path = /usr/bin pid = 1080
KCrash: Arguments: /usr/bin/krita 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0
QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
QSocketNotifier: Invalid socket 16 and type 'Read', disabling...
QSocketNotifier: Invalid socket 14 and type 'Read', disabling...
Unable to start Dr. Konqi
Re-raising signal for core dump handling. ]

Dr.Konqi this : 

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 0x7fbddd17c800 (LWP 1103))]

Thread 3 (Thread 0x7fbdc5b39700 (LWP 1136)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fbde206f0b0 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fbde206ef16 in QSemaphore::tryAcquire(int, int) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007fbde35329aa in KisTileDataSwapper::run() () from /lib/x86_64-linux-gnu/libkritaimage.so.18
#4  0x00007fbde206c9d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fbde0043609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fbde1ce2103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fbdcfdb0700 (LWP 1108)):
#0  0x00007fbde228c57c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007fbde22334db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fbde206b785 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007fbde0076efa in ?? () from /lib/x86_64-linux-gnu/libQt5DBus.so.5
#4  0x00007fbde206c9d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fbde0043609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fbde1ce2103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fbddd17c800 (LWP 1103)):
[KCrash Handler]
#6  0x00007fbde2c96b1a in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00007fbde2ca644e in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007fbde2ca6474 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007fbde2ca6509 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007fbde2c9b3dc in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007fbde2c8a908 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007fbde2c8ae1d in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007fbde225e01e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007fbde2c8ac29 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007fbde2d5e931 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007fbde225e01e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fbde2c8ac29 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007fbde2d60df8 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007fbde225e01e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007fbde2c8ac29 in QWidget::~QWidget() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007fbdb7ddc25d in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-38-x86_64-linux-gnu.so
#22 0x00007fbdc475c3f5 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#23 0x00007fbdc4978b60 in ?? () from /usr/lib/python3/dist-packages/sip.cpython-38-x86_64-linux-gnu.so
#24 0x00007fbdc475c0a0 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#25 0x00007fbdc4e11d16 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#26 0x00007fbdc4e5a3cc in PyVectorcall_Call () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#27 0x00007fbdc4cc2cf7 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#28 0x00007fbdc4d47635 in Py_FinalizeEx () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#29 0x00007fbdc5131af9 in ?? () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritapykrita.so
#30 0x00007fbdc5131c90 in ?? () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritapykrita.so
#31 0x00007fbdc512ed1b in ?? () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritapykrita.so
#32 0x00007fbde225e01e in QObjectPrivate::deleteChildren() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007fbde22685ef in QObject::~QObject() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007fbde2236aae in QCoreApplication::~QCoreApplication() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007fbde2c4d49e in QApplication::~QApplication() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#36 0x00007fbde480a74f in QtSingleApplication::~QtSingleApplication() () from /lib/x86_64-linux-gnu/libkritaui.so.18
#37 0x00005591bf4d4bdc in main ()
[Inferior 1 (process 1103) detached]
Comment 5 Halla Rempt 2020-04-30 13:21:17 UTC
This is all with the distribution packages, right? The appimages don't crash like this for anyone?
Comment 6 kevinmathieu2020 2020-04-30 13:55:55 UTC
yes, I just tried appimage, the app close without giving errors
Comment 7 Lynx3d 2020-04-30 19:48:11 UTC
For me it is krita built from source with all dependencies from Ubuntu packages.

Since using system-wide Qt seems the only practical way to have the Breeze style engine, I don't really know any alternative to test besides Ubuntu packages and compiles that should be equivalent to those.

However I just went through all the Python plugins, and the "Comics Project Managment Tools" seems to cause the crash for me, after disabling this plugin I can use the Breeze style without crashes.
Comment 8 Lynx3d 2020-07-11 23:29:19 UTC
*** Bug 424105 has been marked as a duplicate of this bug. ***
Comment 9 Lynx3d 2020-07-31 00:51:26 UTC
*** Bug 424840 has been marked as a duplicate of this bug. ***
Comment 10 Tiar 2021-04-22 14:13:25 UTC
Git commit e7bd37c699944a78cde620b52118d254a254b708 by Agata Cacko.
Committed on 22/04/2021 at 14:13.
Pushed by tymond into branch 'master'.

Fix crash on exit by setting styleSheet only on QTabBar

Before this commit, Krita would crash on exit on Qt 5.12.8
with segfault in the destructor for the Python plugin
widgets. It turned out that this crash was introduced in
8a7bae681a1f992, and the reason turned out to be
a method setStyleSheet() with non-empty string.
Setting empty stylesheet later (on closing) didn't make a difference.
However setting the stylesheet on just the widget
that needs it (QTabBar that keeps the document tabs)
fixes/prevents the crash.

Alternative fix would be to find the widget for the Python plugin
and explicitely set empty stylesheet after every non-empty
stylesheet set for the whole application. It wasn't tested,
but in case more widgets need non-empty stylesheet, it sounds
like it should work.
Related: bug 427137

M  +10   -6    libs/ui/KisMainWindow.cpp

https://invent.kde.org/graphics/krita/commit/e7bd37c699944a78cde620b52118d254a254b708
Comment 11 Tiar 2021-04-22 14:25:02 UTC
@kd3 
@Lynx3D 
@kevin

Can you please check if e7bd37c699944a fixes the crash on startup for you? I have the same Qt version and I was getting the same backtrace, so I hope it did fix/prevent it.

If you don't build your own Krita, please check Krita Next #1228, which should contain this change. You can run it from the terminal or bst, through gdb, to see the crash.