Krita 5.0 is EXTREMELY unstable, constant crashes

If you want exactly 5.0.2, then you need to checkout the tag v5.0.2.
krita/5.0 is what’s going to be 5.0.3 (and gets built daily as “Krita Plus”) and master is what will be 5.1 (“Krita Next”).

I don’t use 5.0 lately, but master sure has some stability issues too, and the backtraces are often useless because they only show what Qt tries to do after the damage was already done…as Deevad said, ASAN may be necessary to figure out what’s going on…

1 Like

Thank you for clarifying. Then I think I will hold off a little building Krita on my own.
Maybe if I find a file and/or way to replicate the crashes I could test Krita Plus and see if changes anything.

Cheers.

@Lynx3d I tried the krita-5.0.2-alpha-6edabfa864-x86_64 (Krita Plus) image from the website. It ended up crashing again. So I guess the bug you were referring to isn’t the cause here :cry:

Another crash log. I removed most of the threads (~10) since they were identical to the ones here. This was a little odd because it is one of the rare cases when it happened in the middle of using the brush, without any other input.

Short backtrace

Thread 14667 (Thread 0x7fff79ffe700 (LWP 50102)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fff79ffdcd0, clockid=<optimized out>, expected=0, futex_word=0x7fff8ecd9230) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fff79ffdcd0, clockid=<optimized out>, mutex=0x7fff8ecd91e0, cond=0x7fff8ecd9208) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x7fff8ecd9208, mutex=0x7fff8ecd91e0, abstime=0x7fff79ffdcd0) at pthread_cond_wait.c:656
#3  0x00007ffff58bca7c in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff58bcbcb in QWaitCondition::wait(QMutex*, unsigned long) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff58ba171 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff58b69d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff354f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#8  0x00007ffff5528163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2195 (Thread 0x7fff73228700 (LWP 24414)):
#0  0x00007ffff551b9cf in __GI___poll (fds=0x55555d0b00a0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff2d3f36e in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff2d3f4a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffa5fac99d in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007ffff2d68ad1 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff354f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007ffff5528163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 44 (Thread 0x7fffa5b1e700 (LWP 20896)):
#0  0x00007ffff54e626f in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffa5b1ddc0, rem=0x7fffa5b1ddc0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
#1  0x00007ffff54ebef7 in __GI___nanosleep (requested_time=<optimized out>, remaining=<optimized out>) at nanosleep.c:27
#2  0x00007ffff5ad5d75 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff6e21d0a in KisTileDataSwapper::run (this=0x7ffff7379d60 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at /home/andrea/Desktop/krita-5.0.2/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:85
#4  0x00007ffff58b69d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff354f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007ffff5528163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff06476c0 (LWP 20330)):
#0  0x00007fff5b7870e0 in ?? ()
#1  0x00007ffff5a8764e in QMetaObject::cast(QObject const*) const () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007ffff6605c20 in QMdiArea::eventFilter(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#3  0x00007ffff5a7e3eb in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff6496aa0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#5  0x00007ffff64a00f0 in QApplication::notify(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x00007ffff7c3fe7e in KisApplication::notify (this=0x7fffffffddd0, receiver=0x7fff450120e0, event=0x7fff5b6acbc0) at /home/andrea/Desktop/krita-5.0.2/libs/ui/KisApplication.cpp:768
#7  0x00007ffff5a7e80a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff5a81488 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff5ad6e37 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff2d3f17d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff2d3f400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff2d3f4a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff5ad6435 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff5a7d3ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff5a85116 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x000055555555d60f in main (argc=<optimized out>, argv=<optimized out>) at /home/andrea/Desktop/krita-5.0.2/krita/main.cc:698

Long Backtrace

Thread 14667 (Thread 0x7fff79ffe700 (LWP 50102)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fff79ffdcd0, clockid=<optimized out>, expected=0, futex_word=0x7fff8ecd9230) at ../sysdeps/nptl/futex-internal.h:320
        __ret = -516
        clockbit = <optimized out>
        op = <optimized out>
        __ret = <optimized out>
        oldtype = 0
        err = <optimized out>
        oldtype = <optimized out>
        err = <optimized out>
        __ret = <optimized out>
        clockbit = <optimized out>
        op = <optimized out>
        __ret = <optimized out>
        resultvar = <optimized out>
        __arg6 = <optimized out>
        __arg5 = <optimized out>
        __arg4 = <optimized out>
        __arg3 = <optimized out>
        __arg2 = <optimized out>
        __arg1 = <optimized out>
        _a6 = <optimized out>
        _a5 = <optimized out>
        _a4 = <optimized out>
        _a3 = <optimized out>
        _a2 = <optimized out>
        _a1 = <optimized out>
#1  __pthread_cond_wait_common (abstime=0x7fff79ffdcd0, clockid=<optimized out>, mutex=0x7fff8ecd91e0, cond=0x7fff8ecd9208) at pthread_cond_wait.c:520
        spin = 0
        buffer = {__routine = 0x7ffff3556050 <__condvar_cleanup_waiting>, __arg = 0x7fff79ffdc50, __canceltype = 1615563624, __prev = 0x0}
        cbuffer = {wseq = 104, cond = 0x7fff8ecd9208, mutex = 0x7fff8ecd91e0, private = 0}
        err = <optimized out>
        g = 0
        flags = <optimized out>
        g1_start = <optimized out>
        maxspin = 0
        signals = <optimized out>
        result = 0
        wseq = 104
        seq = 52
        private = <optimized out>
        maxspin = <optimized out>
        err = <optimized out>
        result = <optimized out>
        wseq = <optimized out>
        g = <optimized out>
        seq = <optimized out>
        flags = <optimized out>
        private = <optimized out>
        signals = <optimized out>
        g1_start = <optimized out>
        spin = <optimized out>
        buffer = <optimized out>
        cbuffer = <optimized out>
        s = <optimized out>
#2  __pthread_cond_timedwait (cond=0x7fff8ecd9208, mutex=0x7fff8ecd91e0, abstime=0x7fff79ffdcd0) at pthread_cond_wait.c:656
        flags = <optimized out>
        clockid = <optimized out>
#3  0x00007ffff58bca7c in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#4  0x00007ffff58bcbcb in QWaitCondition::wait(QMutex*, unsigned long) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#5  0x00007ffff58ba171 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#6  0x00007ffff58b69d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#7  0x00007ffff354f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140735240201984, 5854563849036597026, 140735383091534, 140735383091535, 140735383091728, 140735240199936, -5854286771085670622, -5854555938034710750}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#8  0x00007ffff5528163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.

Thread 2195 (Thread 0x7fff73228700 (LWP 24414)):
#0  0x00007ffff551b9cf in __GI___poll (fds=0x55555d0b00a0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
        sc_ret = <optimized out>
#1  0x00007ffff2d3f36e in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#2  0x00007ffff2d3f4a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x00007fffa5fac99d in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
No symbol table info available.
#4  0x00007ffff2d68ad1 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#5  0x00007ffff354f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140735125030656, 5854563849036597026, 140737488335870, 140737488335871, 140737488336016, 140735125028608, -5854274303869352158, -5854555938034710750}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff5528163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.

Thread 44 (Thread 0x7fffa5b1e700 (LWP 20896)):
#0  0x00007ffff54e626f in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffa5b1ddc0, rem=0x7fffa5b1ddc0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
        sc_cancel_oldtype = 0
        sc_ret = <optimized out>
        r = <optimized out>
#1  0x00007ffff54ebef7 in __GI___nanosleep (requested_time=<optimized out>, remaining=<optimized out>) at nanosleep.c:27
        ret = <optimized out>
#2  0x00007ffff5ad5d75 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#3  0x00007ffff6e21d0a in KisTileDataSwapper::run (this=0x7ffff7379d60 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at /home/andrea/Desktop/krita-5.0.2/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:85
No locals.
#4  0x00007ffff58b69d2 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#5  0x00007ffff354f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140735973287680, 5854563849036597026, 140737488341294, 140737488341295, 140737488341488, 140735973285632, -5854435772091103454, -5854555938034710750}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff5528163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.

Thread 1 (Thread 0x7ffff06476c0 (LWP 20330)):
#0  0x00007fff5b7870e0 in ?? ()
No symbol table info available.
#1  0x00007ffff5a8764e in QMetaObject::cast(QObject const*) const () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#2  0x00007ffff6605c20 in QMdiArea::eventFilter(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#3  0x00007ffff5a7e3eb in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#4  0x00007ffff6496aa0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#5  0x00007ffff64a00f0 in QApplication::notify(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#6  0x00007ffff7c3fe7e in KisApplication::notify (this=0x7fffffffddd0, receiver=0x7fff450120e0, event=0x7fff5b6acbc0) at /home/andrea/Desktop/krita-5.0.2/libs/ui/KisApplication.cpp:768
        guard = {m_info = 0x5555562291b0}
        result = true
        info = @0x5555562291b0: {eventRecursionCount = 1, postponedSynchronizationEvents = {c = {<std::_Deque_base<KisSynchronizedConnectionEvent, std::allocator<KisSynchronizedConnectionEvent> >> = {_M_impl = {<std::allocator<KisSynchronizedConnectionEvent>> = {<__gnu_cxx::new_allocator<KisSynchronizedConnectionEvent>> = {<No data fields>}, <No data fields>}, _M_map = 0x5555560ef440, _M_map_size = 8, _M_start = {_M_cur = 0x555555fe19c0, _M_first = 0x555555fe18d0, _M_last = 0x555555fe1ab0, _M_node = 0x5555560ef468}, _M_finish = {_M_cur = 0x555555fe19c0, _M_first = 0x555555fe18d0, _M_last = 0x555555fe1ab0, _M_node = 0x5555560ef468}}}, <No data fields>}}}
        __PRETTY_FUNCTION__ = "virtual bool KisApplication::notify(QObject*, QEvent*)"
#7  0x00007ffff5a7e80a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#8  0x00007ffff5a81488 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#9  0x00007ffff5ad6e37 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#10 0x00007ffff2d3f17d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#11 0x00007ffff2d3f400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#12 0x00007ffff2d3f4a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#13 0x00007ffff5ad6435 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#14 0x00007ffff5a7d3ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#15 0x00007ffff5a85116 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#16 0x000055555555d60f in main (argc=<optimized out>, argv=<optimized out>) at /home/andrea/Desktop/krita-5.0.2/krita/main.cc:698
        runningInKDE = false
        key = {d = 0x555555e94810}
        configPath = {d = 0x555555e948c0}
        kritarc = <incomplete type>
        enableOpenGLDebug = <optimized out>
        openGLDebugSynchronous = <optimized out>
        logUsage = <optimized out>
        root = {d = 0x555555eed540}
        language = {d = 0x555555f4d8e0}
        __PRETTY_FUNCTION__ = "int main(int, char**)"
        rightToLeft = false
        app = {<QtSingleApplication> = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7ffff6997620 <QApplication::staticMetaObject>, stringdata = 0x7ffff7d6b0a0 <qt_meta_stringdata_QtSingleApplication>, data = 0x7ffff7d6af80 <qt_meta_data_QtSingleApplication>, static_metacall = 0x7ffff76f0950 <QtSingleApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, firstPeer = -1, instances = 0x5555560a0d90, pidPeer = 0x5555560798e0, actWin = 0x0, appId = {d = 0x555555e94810}, block = false}, static staticMetaObject = {d = {superdata = 0x7ffff7f8d440 <QtSingleApplication::staticMetaObject>, stringdata = 0x7ffff7d88d60 <qt_meta_stringdata_KisApplication>, data = 0x7ffff7d88c80 <qt_meta_data_KisApplication>, static_metacall = 0x7ffff76f43f0 <KisApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, d = {d = 0x55555608bc20}}
        args = {d = {d = 0x555556144340}}
        state = <optimized out>

I realize that there is probably no way to figure this bug out just from the backtrace. I don’t want to be a bother, especially since I have no idea how time consuming it is, but in case any developer is willing to create an ASAN build as Deevad suggested to try and narrow down the problem I’d be really grateful. Or point me to anything else that would be needed to solve this. This bug has been plaguing me for months now and I really want to get to the bottom of it.

I would gladly use an ASAN build as well to help narrow down this issue. I believe there is another user who recently reported these random crashes under Pop! OS.

Dmitry was so kind to make an ASAN build of 5.0.6 (thanks to the various store issues that always mandate a new version for uploads, that’s going to be the next after 5.0.2):

Though a small warning ahead, ASAN builds are much slower, painting with it will be a bit of a pain…

4 Likes

Perfect! Thank you so much Lynx and thanks to Dmitri for the build.

I ran and it just crashed, here is the report:

Replacing libstdc++.so.6 with the fallback version: libstdc++.so.6.0.28 -> libstdc++.so.6.0.29
KoColor debug runtime checks are active.
Old schema: "0.0.15" New schema: 0.0.16
Going to update indices
krita.lib.resources: Created index "tags"
krita.lib.resources: Created index "resources"
krita.lib.resources: Created index "tag_translations"
krita.lib.resources: Created index "resource_tags"
krita.lib.resources: Filled version table
QObject::startTimer: Timers cannot have negative intervals
/tmp/.mount_krita-LOTowt/usr/lib/krita-python-libs/krita added to PYTHONPATH
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 25620, resource id: 10520003, major code: 40 (TranslateCoords), minor code: 0
Numeric mode unsupported in the posix collation implementation
Numeric mode unsupported in the posix collation implementation
Numeric mode unsupported in the posix collation implementation
AddressSanitizer:DEADLYSIGNAL
=================================================================
==11800==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7f5e9a8a71ff bp 0x603000a5f280 sp 0x7fff51ef9eb0 T0)
==11800==The signal is caused by a READ memory access.
==11800==Hint: this fault was caused by a dereference of a high value address (see register values below).  Dissassemble the provided pc to learn which register was used.
    #0 0x7f5e9a8a71ff in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Widgets.so.5+0x1681ff)
    #1 0x7f5ea7567799 in KisApplication::notify(QObject*, QEvent*) (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libkritaui.so.17+0x1a69799)
    #2 0x7f5e99d149e1 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Core.so.5+0x2949e1)
    #3 0x7f5e99d17834 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Core.so.5+0x297834)
    #4 0x7f5e99d69f12  (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Core.so.5+0x2e9f12)
    #5 0x7f5e97a3017c in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x5217c)
    #6 0x7f5e97a303ff  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x523ff)
    #7 0x7f5e97a304a2 in g_main_context_iteration (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x524a2)
    #8 0x7f5e99d69546 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Core.so.5+0x2e9546)
    #9 0x7f5e99d1349a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Core.so.5+0x29349a)
    #10 0x7f5e99d1b381 in QCoreApplication::exec() (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Core.so.5+0x29b381)
    #11 0x5565739145b4 in main (/tmp/.mount_krita-LOTowt/usr/bin/krita+0x165b4)
    #12 0x7f5e9933b0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
    #13 0x556573918a39 in _start (/tmp/.mount_krita-LOTowt/usr/bin/krita+0x1aa39)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/tmp/.mount_krita-LOTowt/usr/bin/../lib/libQt5Widgets.so.5+0x1681ff) in QApplicationPrivate::notify_helper(QObject*, QEvent*)
==11800==ABORTING
2 Likes

Argh…“AddressSanitizer can not provide additional info.” was not the desired result. :frowning:
It’s basically just ASAN telling us that the program crashed for unknown reason in the same place we already knew.

The idea was that it can either tell us what object this address used to belong to, or catch something fishy that may be the origin of this invalid address.
Looks like the fault originates from Qt then…

Btw. relevant bug report, in case anyone has new info: 447985 – Crash when painting during extended sessions

1 Like

Oh shoot! I didn’t even notice that! That isn’t good… That sounds like a really nasty bug.

It sounds weird though, I mean if it’s something in Qt then why is 5.0 crashing so much when 4.4.8 isn’t? I have been using 4.4.8 all day on Sunday in a streaming session and it didn’t crash once.

I guess I will be reporting new findings in the bug report then… Thanks everyone for the help and patience so far.

Hi, all!

Could you please check this updated AppImage? It has Qt built with ASAN as well, so we might manage to actually catch the error. Make sure that you set the special environment variable before starting the appimage (otherwise it’ll crash right on start):

export ASAN_OPTIONS='new_delete_type_mismatch=0,detect_leaks=0'
./krita-5.1.0-x86_64-qt-asan-dk1.appimage

Here is the link: krita-5.1.0-x86_64-qt-asan-dk1.appimage — Яндекс.Диск

3 Likes

Btw, if you have message "libasan.so.4: cannot open shared object files: No such file or directory", then just create a symlink to the version you have, e.g. libasan.so.6. I have failed to embed the needed one :frowning:

Thank you for the build! This is going pretty deep it seems! I didn’t get the error you mentioned, it worked out of the box.

Here is a fresh crash log

=================================================================
==8929==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b000414c40 at pc 0x7f265306835f bp 0x7ffed11481a0 sp 0x7ffed1148190
READ of size 1 at 0x60b000414c40 thread T0
    #0 0x7f265306835e in QObject::isWindowType() const ../../include/QtCore/../../src/corelib/kernel/qobject.h:143
    #1 0x7f265306835e in QApplication::notify(QObject*, QEvent*) kernel/qapplication.cpp:2907
    #2 0x7f2658c52285 in KisApplication::notify(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x1a5a285)
    #3 0x7f2651544728 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7d3728)
    #4 0x7f2651545034 in QCoreApplication::sendEvent(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7d4034)
    #5 0x7f265154eaf9 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7ddaf9)
    #6 0x7f2651551114 in QCoreApplication::sendPostedEvents(QObject*, int) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7e0114)
    #7 0x7f26516a5820  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x934820)
    #8 0x7f264935717c in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x5217c)
    #9 0x7f26493573ff  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x523ff)
    #10 0x7f26493574a2 in g_main_context_iteration (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x524a2)
    #11 0x7f26516a28af in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x9318af)
    #12 0x7f264296ebe5 in QXcbGlibEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /home/appimage/appimage-workspace/deps-build/ext_qt/ext_qt-prefix/src/ext_qt/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:143
    #13 0x7f265153c93d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7cb93d)
    #14 0x7f265153da76 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7cca76)
    #15 0x7f265155d351 in QCoreApplication::exec() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7ec351)
    #16 0x7f2651ea4f77 in QGuiApplication::exec() kernel/qguiapplication.cpp:1784
    #17 0x7f2653040f48 in QApplication::exec() kernel/qapplication.cpp:2858
    #18 0x55baf37cfbb1 in main /home/appimage/persistent/krita/krita/main.cc:702
    #19 0x7f26509a40b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
    #20 0x55baf37d3e99 in _start (/tmp/.mount_krita-vTK5Hn/usr/bin/krita+0x1ae99)

0x60b000414c40 is located 32 bytes inside of 112-byte region [0x60b000414c20,0x60b000414c90)
freed by thread T122 (Thread (pooled)) here:
    #0 0x7f2659c0b7d8 in operator delete(void*, unsigned long) (/lib/x86_64-linux-gnu/libasan.so.4+0xe27d8)
    #1 0x7f26515f236d in QObjectPrivate::~QObjectPrivate() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x88136d)
    #2 0x7f265160e5f3 in QObject::~QObject() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x89d5f3)
    #3 0x7f264ca9f2f6 in KisUndoStore::~KisUndoStore() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x3b2f6)
    #4 0x7f264ca9f439 in KisSurrogateUndoStore::~KisSurrogateUndoStore() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x3b439)
    #5 0x7f264ec990d0 in KoShapeCreateCommand::~KoShapeCreateCommand() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaflake.so.18+0x3e50d0)
    #6 0x7f264ec99190 in KoShapeCreateCommand::~KoShapeCreateCommand() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaflake.so.18+0x3e5190)
    #7 0x7f264ca7e9fb in KUndo2Command::~KUndo2Command() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x1a9fb)
    #8 0x7f264ca7ed70 in KUndo2Command::~KUndo2Command() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x1ad70)
    #9 0x7f265581c3d1 in KisTransactionBasedCommand::~KisTransactionBasedCommand() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0x8283d1)
    #10 0x7f26582e49ba  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x10ec9ba)
    #11 0x7f2658b506c8  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x19586c8)
    #12 0x7f2655a2a14a  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xa3614a)
    #13 0x7f26557d53a5 in KisSavedMacroCommand::~KisSavedMacroCommand() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0x7e13a5)
    #14 0x7f26557d56b0 in KisSavedMacroCommand::~KisSavedMacroCommand() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0x7e16b0)
    #15 0x7f264ca80739 in KUndo2QStack::checkUndoLimit() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x1c739)
    #16 0x7f264ca8f179 in KUndo2QStack::push(KUndo2Command*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x2b179)
    #17 0x7f2658c814fd in KisDocument::addCommand(KUndo2Command*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x1a894fd)
    #18 0x7f2658b4fb95 in KisDocumentUndoStore::addCommand(KUndo2Command*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x1957b95)
    #19 0x7f26564214d2 in KisPostExecutionUndoAdapter::addCommand(QSharedPointer<KUndo2Command>) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0x142d4d2)
    #20 0x7f2655eafb10  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xebbb10)
    #21 0x7f2655cef8d5 in non-virtual thunk to KisRunnableStrokeJobData::run() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xcfb8d5)
    #22 0x7f2655ceb444 in KisRunnableBasedStrokeStrategy::doStrokeCallback(KisStrokeJobData*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xcf7444)
    #23 0x7f265841c142 in FreehandStrokeStrategy::doStrokeCallback(KisStrokeJobData*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x1224142)
    #24 0x7f2655ce417a  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xcf017a)
    #25 0x7f26554e495b  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0x4f095b)
    #26 0x7f2650ee5456  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x174456)
    #27 0x7f2650ed7d11  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x166d11)
    #28 0x7f2650955608 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8608)

previously allocated by thread T0 here:
    #0 0x7f2659c0a258 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.4+0xe1258)
    #1 0x7f265160eecc in QObject::QObject(QObject*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x89decc)
    #2 0x7f264ca9f2a2 in KisUndoStore::KisUndoStore() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x3b2a2)
    #3 0x7f264ca9f6ee in KisSurrogateUndoStore::KisSurrogateUndoStore() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritacommand.so.18+0x3b6ee)
    #4 0x7f264ec984af in KoShapeCreateCommand::KoShapeCreateCommand(KoShapeControllerBase*, QList<KoShape*>, KoShapeContainer*, KUndo2Command*, KUndo2MagicString const&) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaflake.so.18+0x3e44af)
    #5 0x7f264ec9891f in KoShapeCreateCommand::KoShapeCreateCommand(KoShapeControllerBase*, QList<KoShape*>, KoShapeContainer*, KUndo2Command*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaflake.so.18+0x3e491f)
    #6 0x7f264eafe193 in KoShapeController::addShapesDirect(QList<KoShape*>, KoShapeContainer*, KUndo2Command*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaflake.so.18+0x24a193)
    #7 0x7f26582f4475  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x10fc475)
    #8 0x7f265581c232 in KisTransactionBasedCommand::redo() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0x828232)
    #9 0x7f2658b50899  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x1958899)
    #10 0x7f265785ad7b  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x662d7b)
    #11 0x7f26515e8a82 in QMetaCallEvent::placeMetaCall(QObject*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x877a82)
    #12 0x7f26515f5b45 in QObject::event(QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x884b45)
    #13 0x7f26530410b7 in QApplicationPrivate::notify_helper(QObject*, QEvent*) kernel/qapplication.cpp:3650
    #14 0x7f265306022d in QApplication::notify(QObject*, QEvent*) kernel/qapplication.cpp:3600
    #15 0x7f2658c52285 in KisApplication::notify(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x1a5a285)
    #16 0x7f2651544728 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7d3728)
    #17 0x7f2651545034 in QCoreApplication::sendEvent(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7d4034)
    #18 0x7f265154eaf9 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7ddaf9)
    #19 0x7f2651551114 in QCoreApplication::sendPostedEvents(QObject*, int) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7e0114)
    #20 0x7f26516a5820  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x934820)
    #21 0x7f264935717c in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x5217c)

Thread T122 (Thread (pooled)) created by T120 (Thread (pooled)) here:
    #0 0x7f2659b61b3f in pthread_create (/lib/x86_64-linux-gnu/libasan.so.4+0x38b3f)
    #1 0x7f2650ed572a in QThread::start(QThread::Priority) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x16472a)
    #2 0x7f2650ee85fa in QThreadPoolPrivate::tryStart(QRunnable*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x1775fa)
    #3 0x7f2650ee9fb5 in QThreadPool::start(QRunnable*, int) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x178fb5)
    #4 0x7f2655cd37f0 in KisUpdaterContext::startThread(int) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xcdf7f0)
    #5 0x7f2655cd63f5 in KisUpdaterContext::addStrokeJob(KisStrokeJob*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xce23f5)
    #6 0x7f2655d1728c in KisStrokesQueue::processOneJob(KisUpdaterContext&, bool) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd2328c)
    #7 0x7f2655d1742d in KisStrokesQueue::processQueue(KisUpdaterContext&, bool) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd2342d)
    #8 0x7f2655d3ebb1 in KisUpdateScheduler::processQueues() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd4abb1)
    #9 0x7f2655d40c18 in KisUpdateScheduler::spareThreadAppeared() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd4cc18)
    #10 0x7f2655cccf06 in KisUpdaterContext::jobFinished() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xcd8f06)
    #11 0x7f26554e4b48  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0x4f0b48)
    #12 0x7f2650ee5456  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x174456)
    #13 0x7f2650ed7d11  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x166d11)
    #14 0x7f2650955608 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8608)

Thread T120 (Thread (pooled)) created by T0 here:
    #0 0x7f2659b61b3f in pthread_create (/lib/x86_64-linux-gnu/libasan.so.4+0x38b3f)
    #1 0x7f2650ed572a in QThread::start(QThread::Priority) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x16472a)
    #2 0x7f2650ee85fa in QThreadPoolPrivate::tryStart(QRunnable*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x1775fa)
    #3 0x7f2650ee9fb5 in QThreadPool::start(QRunnable*, int) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x178fb5)
    #4 0x7f2655cd37f0 in KisUpdaterContext::startThread(int) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xcdf7f0)
    #5 0x7f2655cd63f5 in KisUpdaterContext::addStrokeJob(KisStrokeJob*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xce23f5)
    #6 0x7f2655d1728c in KisStrokesQueue::processOneJob(KisUpdaterContext&, bool) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd2328c)
    #7 0x7f2655d1742d in KisStrokesQueue::processQueue(KisUpdaterContext&, bool) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd2342d)
    #8 0x7f2655d3ebb1 in KisUpdateScheduler::processQueues() (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd4abb1)
    #9 0x7f2655d40cac in KisUpdateScheduler::startStroke(KisStrokeStrategy*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xd4ccac)
    #10 0x7f2655e03145 in KisImage::startStroke(KisStrokeStrategy*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xe0f145)
    #11 0x7f2655dfd2d4 in KisImage::startIsolatedMode(KisSharedPtr<KisNode>, bool, bool) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaimage.so.18+0xe092d4)
    #12 0x7f2657f82353 in KisNodeManager::changeIsolationMode(bool, bool) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0xd8a353)
    #13 0x7f2657f8261c in KisNodeManager::setIsolateActiveLayerMode(bool) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0xd8a61c)
    #14 0x7f26578810f5  (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x6890f5)
    #15 0x7f26515f3406 in QMetaObject::activate(QObject*, int, int, void**) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x882406)
    #16 0x7f26515f499d in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x88399d)
    #17 0x7f265302a446 in QAction::toggled(bool) .moc/moc_qaction.cpp:393
    #18 0x7f2653032994 in QAction::setChecked(bool) kernel/qaction.cpp:982
    #19 0x7f2653032dfd in QAction::activate(QAction::ActionEvent) kernel/qaction.cpp:1163
    #20 0x7f265303523b in QAction::event(QEvent*) kernel/qaction.cpp:1092
    #21 0x7f265318fd60 in QWidgetAction::event(QEvent*) kernel/qwidgetaction.cpp:232
    #22 0x7f26530410b7 in QApplicationPrivate::notify_helper(QObject*, QEvent*) kernel/qapplication.cpp:3650
    #23 0x7f265306022d in QApplication::notify(QObject*, QEvent*) kernel/qapplication.cpp:3600
    #24 0x7f2658c52285 in KisApplication::notify(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libkritaui.so.18+0x1a5a285)
    #25 0x7f2651544728 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7d3728)
    #26 0x7f2651545034 in QCoreApplication::sendEvent(QObject*, QEvent*) (/tmp/.mount_krita-vTK5Hn/usr/bin/../lib/libQt5Core.so.5+0x7d4034)
    #27 0x7f2651f85379 in QShortcutMap::dispatchEvent(QKeyEvent*) kernel/qshortcutmap.cpp:707
    #28 0x7f2651f85603 in QShortcutMap::tryShortcut(QKeyEvent*) kernel/qshortcutmap.cpp:351
    #29 0x7f2651e3eca6 in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) kernel/qwindowsysteminterface.cpp:470
    #30 0x7f2651ebfe11 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) kernel/qguiapplication.cpp:2270
    #31 0x7f2651ed55a7 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) kernel/qguiapplication.cpp:1904
    #32 0x7f2651e2c63b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) kernel/qwindowsysteminterface.cpp:1157
    #33 0x7f264296e15d in xcbSourceDispatch /home/appimage/appimage-workspace/deps-build/ext_qt/ext_qt-prefix/src/ext_qt/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
    #34 0x7f264935717c in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x5217c)

SUMMARY: AddressSanitizer: heap-use-after-free ../../include/QtCore/../../src/corelib/kernel/qobject.h:143 in QObject::isWindowType() const
Shadow bytes around the buggy address:
  0x0c168007a930: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa
  0x0c168007a940: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c168007a950: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c168007a960: fd fd fd fd fd fd fa fa fa fa fa fa fa fa fd fd
  0x0c168007a970: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
=>0x0c168007a980: fa fa fa fa fd fd fd fd[fd]fd fd fd fd fd fd fd
  0x0c168007a990: fd fd fa fa fa fa fa fa fa fa fd fd fd fd fd fd
  0x0c168007a9a0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
  0x0c168007a9b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c168007a9c0: fa fa fa fa fa fa fd fd fd fd fd fd fd fd fd fd
  0x0c168007a9d0: fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==8929==ABORTING
3 Likes

Hi, @fullmontis!

Thanks a lot for this backtrace! It looks extremely useful! :slight_smile:

Hi, all!

I think I have a fix for the bug (thanks to the report from @fullmontis!). Could you please help me with testing the fix?

I need two rounds of testing (with the same package). Firstly, run the package in the following way:

export ASAN_OPTIONS='new_delete_type_mismatch=0,detect_leaks=0,alloc_dealloc_mismatch=0'
./krita-5.1.0-prealpha-a08a1e5c997-x86_64.appimage

If nothing is found, try to enable “slow signal delivery” option, which introduces an artificial delay for signal delivery and makes the bugs of this type more easy to trigger a crash :wink:

export KRITA_SLOW_SIGNAL_DELIVERY=1
export ASAN_OPTIONS='new_delete_type_mismatch=0,detect_leaks=0,alloc_dealloc_mismatch=0'
./krita-5.1.0-prealpha-a08a1e5c997-x86_64.appimage

The second version should run significantly slower than normal Krita, but it is easier to crash it :slight_smile:

Test Plan

The original crash happens when an undo command for vector object creation was deleted. Therefore, to make the situation more difficult to Krita make sure you do the follwoing:

  1. Reduce undo stack limit to some lower value, e.g. 30.
  2. Make sure that while testing you also use vector objects and/or vector selections.

Package Link

AppImage: krita-5.1.0-prealpha-a08a1e5c997-x86_64.appimage — Яндекс Диск

4 Likes

Thank you for all the hard work. I hadn’t much time this week, but this next couple of days I will have some time free to make some tests.

I never ran Krita while hunting for bugs, so I don’t really understand the procedure.
Should I just run the .appimage directly from the terminal, or should I follow the Krita docs and run it by using gbd first?

Cheers.

You need to run the appimage directly from the terminal, but please use the commands Dmitry wrote above.

First the first one quoted, with just one “export” line, and then if nothing is found, the second one with two “export” lines before the appimage execution line.

1 Like

Thanks. I will do and report back.

YES! This is so amazing! I have been using the build all evening, and not a single crash! First time this has happened since version 5.0 came out. And I used just 10 undo limit just to be on the safe side.
I haven’t tried yet the slow signal version of the build, but I plan to use it tomorrow. However, I feel very confident that it’s fixed for good!

It makes sense that I would be affected so much by this bug, I don’t use vector objects, but I use vector selection basically once every handful of brushstrokes. To be honest, I’m shocked that it didn’t crash much more than it did. I guess that having a high undo limit kinda buffered the crashes, which in turn made it much harder to spot. No wonder it was such an insidious bug!

Thank you so much for this @dkazakov and everyone else, you have no idea how happy and grateful I am! This made my week!

When is this going to be implemented in a nightly build?

6 Likes

Hi, @fullmontis!

Thank you for your feedback! I have merge the fix into Krita-Nightly and Krita-Stable-Nightly. Here are the links to the builds (they are still building, so you should wait):

But please give at least a short test to the “slow-signal” version of the package [0]. It might be that we have the same issue in some other places I missed. It is really important to catch them as well.

[0] - Nightly builds from the binary factory neither have ASAN, nor “slow-signal” switch. That is available only in my custom packages.

6 Likes

@dkazakov Thank you! This was quick!

I did test the build with the slow signal option for a few hours, and it never crashed. At least on my side it seems to have been solved for good.

Thanks again for all your hard work.

2 Likes