Bug 412740 - Krita leaks memory on exporting multiple pages from the comics manager
Summary: Krita leaks memory on exporting multiple pages from the comics manager
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.2.6
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 419020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-08 20:25 UTC by Ragnar Brynjúlsson
Modified: 2022-09-14 08:26 UTC (History)
4 users (show)

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


Attachments
A python script that tests creating documents (4.17 KB, text/x-python)
2020-05-05 12:57 UTC, Halla Rempt
Details
A diff that adds output showing objects being created and deleted (5.62 KB, patch)
2020-05-05 12:58 UTC, Halla Rempt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ragnar Brynjúlsson 2019-10-08 20:25:49 UTC
SUMMARY

When exporting multiple pages from the Comics Manager, Krita does not free up the memory used by each page. This becomes problematic when you have 30 plus high resolution pages, as Krita will run out of memory and likely crash.

I suspect that this is not a problem with the Comics Manager, but with Krita itself.


STEPS TO REPRODUCE
1. Create a new comics
2. Populate it with a bunch of pages (4000x6000)
3. I've been using ACBF option, and have "panels" Vector layer, but I'm not sure it's relevant 
4. Export the comic to CBZ
5. Watch as the memory slowly gets eaten up

OBSERVED RESULT
For each page exported, the memory usage gradually increases. If you have enough pages, your machine will eventually run out, and Krita crashes.


EXPECTED RESULT
Krita should free up the memory used after exporting each page.


SOFTWARE/OS VERSIONS
Ubuntu: 18.04
Tested with both Ubuntu/Gnome DE and OpenBox

ADDITIONAL INFORMATION
Tested in 4.2.6, as 4.2.7 was very slow at opening pages. This bug has been around since the Comics Manager was first introduced, so I suspect it's still in 4.2.7. :)

Setting the Settings>Configure Krita>Performance>Memory Limit higher will let you export more pages. I have it set to 90% on my 24 gig machine, which can manage around 55 pages at 4000x6000 resolution, before I have no RAM left.
Comment 1 wolthera 2019-10-09 13:54:35 UTC
Yes, I've seen this too, and what it actually should do is that it deletes the old documents when the memory is full(and Krita pools the memory). I myself cannot do anything here as I don't know enough about the way Krita handles memory...
Comment 2 Halla Rempt 2019-10-10 08:43:48 UTC
Does the comics manager try to load all images at the same time when exporting, or one by one? If one by one, closing the images as we go, we've got a bug in our memory handling. If all at the same time, a workaround could be to just open the .kra files as zip files and get the projection png, and use that when exporting.
Comment 3 wolthera 2019-10-10 11:12:54 UTC
It's one by one in a for loop.
Comment 4 wolthera 2019-10-10 12:25:14 UTC
Ah, also, that workaround won't work, really. The problem is that I use all sorts of layer data and remove layers the user has set to 'remove' before merging everything and cropping+resizing. The documents get closed after being processed.

I haven't seen an out-of-memory crash myself, and I think it's due to the pooling applied to Krita, as following the code trail leads to a 'delete later' type of object deletion.
Comment 5 wkg28406 2019-12-03 03:47:20 UTC
(In reply to wolthera from comment #4)
> I haven't seen an out-of-memory crash myself, and I think it's due to the
> pooling applied to Krita, as following the code trail leads to a 'delete
> later' type of object deletion.

Any objects that are created in a python script will only be freed when the script ends AFAIK. In the case of an extension, it is always running, so it continues to increase memory until Krita is closed.

This is easily reproducible with any extension/script that does 'Krita.openDocument()' and 'Document.close()' repeatedly on files in a directory.

Running 'gc.collect()' or 'del <object>' in python doesn't seem to do anything.

Would a solution be to add a call to qt 'processEvents()' in something like 'Document.close()'? Seems like it would be a bad idea to force deletion (if it's even possible) if it wasn't limited to python scripting.
Comment 6 wkg28406 2019-12-04 05:08:50 UTC
(In reply to bugs from comment #5)
> Any objects that are created in a python script will only be freed when the
> script ends AFAIK. In the case of an extension, it is always running, so it
> continues to increase memory until Krita is closed.


I did more testing and this is incorrect. Memory is properly freed on close. The issue occurs because of loops.

One solution is to use a QTimer instead of for, with a guard to see if already processing. It's not that elegant, but it will free memory immediately on 'Document.close()' because it's not in a loop and can return to let qt garbage collection run.
Comment 7 wolthera 2019-12-04 11:49:30 UTC
Hot damn, thanks!

I'll do some experiments when I have free time then.
Comment 8 Halla Rempt 2020-03-17 14:39:51 UTC
Git commit 7183b4ae5118976f223549d882b489ed08ad5902 by Boudewijn Rempt.
Committed on 17/03/2020 at 14:39.
Pushed by rempt into branch 'master'.

Fix ownership issues with the Document wrapper

If the Document is created from python, it needs to be
deleted.

M  +0    -2    libs/image/kis_image.cc
M  +10   -4    libs/libkis/Document.cpp
M  +1    -1    libs/libkis/Document.h
M  +4    -4    libs/libkis/Krita.cpp
M  +5    -1    libs/libkis/Notifier.cpp
M  +1    -1    libs/libkis/View.cpp
M  +5    -5    libs/libkis/tests/TestDocument.cpp
M  +2    -2    libs/libkis/tests/TestFilter.cpp
M  +2    -1    libs/ui/KisPart.cpp

https://invent.kde.org/kde/krita/commit/7183b4ae5118976f223549d882b489ed08ad5902
Comment 9 wolthera 2020-03-19 14:34:38 UTC
*** Bug 419020 has been marked as a duplicate of this bug. ***
Comment 10 wolthera 2020-03-19 14:36:23 UTC
Reopening because 1. we still leak documents, and 2. there's now an interesting plethora of crashes related to the document not being found.

Crash while batch exporting:
=============================================================
Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
0x00007ffff6b2cb1a in KisView::document (this=0x0) at /home/wolthera/krita/src/libs/ui/KisView.cpp:623
623         return d->document;
(gdb) thread apply all backtrace

Thread 818 (Thread 0x7fff6dffb700 (LWP 16056)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff6dffabf0, expected=0, 
    futex_word=0x7fff68e83bc4) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff6dffaca0, mutex=0x7fff68e83b70, cond=0x7fff68e83b98) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x7fff68e83b98, mutex=0x7fff68e83b70, abstime=0x7fff6dffaca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff6dffb700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 817 (Thread 0x7fff6f7fe700 (LWP 16055)):
#0  0x00007fffeb4dc9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55556663c464)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x55556663c410, cond=0x55556663c438) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x55556663c438, mutex=0x55556663c410) at pthread_cond_wait.c:655
#3  0x00007ffff2e79d9b in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79f19 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e74386 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e7528e in QReadWriteLock::tryLockForRead(int) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff500949d in QReadLocker::relock (this=0x7fff6f7fd730)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qreadwritelock.h:106
#8  0x00007ffff5009521 in QReadLocker::QReadLocker (this=0x7fff6f7fd730, 
    areadWriteLock=0x7ffff5939ab8 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+216>)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qreadwritelock.h:125
#9  0x00007ffff500c538 in KisTileDataStore::registerTileData (
    this=0x7ffff59399e0 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>, td=0x7fff61a9eeb0)
    at /home/wolthera/krita/src/libs/image/tiles3/kis_tile_data_store.cc:142
#10 0x00007ffff500c72d in KisTileDataStore::duplicateTileData (
    this=0x7ffff59399e0 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>, rhs=0x5555679da6d0)
    at /home/wolthera/krita/src/libs/image/tiles3/kis_tile_data_store.cc:196
#11 0x00007ffff50061e7 in KisTileData::clone (this=0x5555679da6d0)
    at /home/wolthera/krita/src/libs/image/tiles3/kis_tile_data.h:88
#12 0x00007ffff50055ea in KisTile::lockForWrite (this=0x7fff61aa2310)
    at /home/wolthera/krita/src/libs/image/tiles3/kis_tile.cc:251
#13 0x00007ffff5017e84 in KisTileDataWrapper::KisTileDataWrapper (this=0x7fff6f7fd8e0, dm=0x5555679e9480, x=1024, y=3072, 
    type=KisTileDataWrapper::WRITE) at /home/wolthera/krita/src/libs/image/tiles3/kis_tile_data_wrapper.h:62
#14 0x00007ffff5013652 in KisTiledDataManager::writeBytesBody (this=0x5555679e9480, data=0x7fff61a16db0 "", x=1024, y=3072, 
    width=256, height=256, dataRowStride=1024) at /home/wolthera/krita/src/libs/image/tiles3/kis_tiled_data_manager_p.h:61
#15 0x00007ffff5016a44 in KisTiledDataManager::writeBytes (this=0x5555679e9480, data=0x7fff61a16db0 "", x=1024, y=3072, 
    width=256, height=256, dataRowStride=-1) at /home/wolthera/krita/src/libs/image/tiles3/kis_tiled_data_manager.cc:698
#16 0x00007ffff5342e22 in KisDataManager::writeBytes (this=0x5555679e9480, data=0x7fff61a16db0 "", x=1024, y=3072, w=256, 
    h=256, dataRowStride=-1) at /home/wolthera/krita/src/libs/image/kis_datamanager.h:277
#17 0x00007ffff534a524 in KisPaintDevice::Private::KisPaintDeviceStrategy::writeBytesImpl (this=0x5555665f7a80, 
    data=0x7fff61a16db0 "", rect=..., dataRowStride=-1)
    at /home/wolthera/krita/src/libs/image/kis_paint_device_strategies.h:173
#18 0x00007ffff534a0e1 in KisPaintDevice::Private::KisPaintDeviceStrategy::writeBytes (this=0x5555665f7a80, 
---Type <return> to continue, or q <return> to quit---
    data=0x7fff61a16db0 "", rect=...) at /home/wolthera/krita/src/libs/image/kis_paint_device_strategies.h:151
#19 0x00007ffff53409cc in KisPaintDevice::writeBytes (this=0x55555f485c80, data=0x7fff61a16db0 "", rect=...)
    at /home/wolthera/krita/src/libs/image/kis_paint_device.cc:1950
#20 0x00007ffff5340977 in KisPaintDevice::writeBytes (this=0x55555f485c80, data=0x7fff61a16db0 "", x=1024, y=3072, w=256, 
    h=256) at /home/wolthera/krita/src/libs/image/kis_paint_device.cc:1945
#21 0x00007ffff6763914 in KisShapeLayerCanvas::repaint (this=0x55555fa57a80)
    at /home/wolthera/krita/src/libs/ui/flake/kis_shape_layer_canvas.cpp:383
#22 0x00007ffff67663f6 in KisRepaintShapeLayerLayerJob::run (this=0x5555603172c0)
    at /home/wolthera/krita/src/libs/ui/flake/kis_shape_layer_canvas.cpp:180
#23 0x00007ffff54ac907 in KisUpdateJobItem::run (this=0x555563f08000)
    at /home/wolthera/krita/build/libs/image/kritaimage_autogen/EWIEGA46WW/../../../../../src/libs/image/kis_update_job_item.h:102
#24 0x00007ffff2e76f42 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007fffeb4d66db in start_thread (arg=0x7fff6f7fe700) at pthread_create.c:463
#27 0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 816 (Thread 0x7fff84ffb700 (LWP 16054)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff84ffabf0, expected=0, 
    futex_word=0x7fff68e66570) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff84ffaca0, mutex=0x7fff68e66520, cond=0x7fff68e66548) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x7fff68e66548, mutex=0x7fff68e66520, abstime=0x7fff84ffaca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff84ffb700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 815 (Thread 0x7fff85ffd700 (LWP 16053)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff85ffcbf0, expected=0, 
    futex_word=0x7fff68e4be20) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff85ffcca0, mutex=0x7fff68e4bdd0, cond=0x7fff68e4bdf8) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x7fff68e4bdf8, mutex=0x7fff68e4bdd0, abstime=0x7fff85ffcca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff85ffd700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 814 (Thread 0x7fff6e7fc700 (LWP 16052)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff6e7fbbf0, expected=0, 
    futex_word=0x7fff68e52280) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff6e7fbca0, mutex=0x7fff68e52230, cond=0x7fff68e52258) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x7fff68e52258, mutex=0x7fff68e52230, abstime=0x7fff6e7fbca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff6e7fc700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 813 (Thread 0x7fff6effd700 (LWP 16051)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff6effcbf0, expected=0, 
    futex_word=0x7fff7d2f54a4) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff6effcca0, mutex=0x7fff7d2f5450, cond=0x7fff7d2f5478) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x7fff7d2f5478, mutex=0x7fff7d2f5450, abstime=0x7fff6effcca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff6effd700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 812 (Thread 0x7fff6ffff700 (LWP 16050)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff6fffebf0, expected=0, 
    futex_word=0x7fff68ef5614) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff6fffeca0, mutex=0x7fff68ef55c0, cond=0x7fff68ef55e8) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x7fff68ef55e8, mutex=0x7fff68ef55c0, abstime=0x7fff6fffeca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff6ffff700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 811 (Thread 0x7fff857fc700 (LWP 16049)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff857fbbf0, expected=0, 
    futex_word=0x555569802160) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff857fbca0, mutex=0x555569802110, cond=0x555569802138) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x555569802138, mutex=0x555569802110, abstime=0x7fff857fbca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff857fc700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 16 (Thread 0x7fff9b4cf700 (LWP 10963)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fff8c002de0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff9b4cf700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 15 (Thread 0x7fff9bcd0700 (LWP 10955)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fff94006c90, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffd4c4ca86 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#7  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fffeb4d66db in start_thread (arg=0x7fff9bcd0700) at pthread_create.c:463
#9  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 14 (Thread 0x7fffb0ebc700 (LWP 10946)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fff9c0029e0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffd47b7605 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fffeb4d66db in start_thread (arg=0x7fffb0ebc700) at pthread_create.c:463
#9  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 13 (Thread 0x7fffabfff700 (LWP 10907)):
#0  0x00007ffff5009db9 in ConcurrentMap<int, KisTileData*, DefaultKeyTraits<int>, DefaultValueTraits<KisTileData*> >::Iterator::next (this=0x7fffa4003e08) at /home/wolthera/krita/src/libs/image/3rdparty/lock_free_map/concurrent_map.h:335
#1  0x00007ffff5009a5e in KisTileDataStoreIterator::next (this=0x7fffa4003e00)
    at /home/wolthera/krita/src/libs/image/tiles3/kis_tile_data_store_iterators.h:58
#2  0x00007ffff5038ce0 in KisTileDataSwapper::pass<SoftSwapStrategy> (
    this=0x7ffff5939a20 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>, needToFreeMetric=860379)
    at /home/wolthera/krita/src/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:207
#3  0x00007ffff5038619 in KisTileDataSwapper::doJob (
    this=0x7ffff5939a20 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>)
    at /home/wolthera/krita/src/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:133
#4  0x00007ffff5038519 in KisTileDataSwapper::run (
    this=0x7ffff5939a20 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>)
    at /home/wolthera/krita/src/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:99
#5  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffeb4d66db in start_thread (arg=0x7fffabfff700) at pthread_create.c:463
#7  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
---Type <return> to continue, or q <return> to quit---

Thread 11 (Thread 0x7fffb3803700 (LWP 10895)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fffac002de0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fffb3803700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 10 (Thread 0x7fffcccfa700 (LWP 10661)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fffc801d530, nfds=4, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffe8bdf555 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fffeb4d66db in start_thread (arg=0x7fffcccfa700) at pthread_create.c:463
#9  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 9 (Thread 0x7fffdfe64700 (LWP 10660)):
#0  0x00007fffeb4dc9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x555557449d08)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x555557449cb8, cond=0x555557449ce0) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x555557449ce0, mutex=0x555557449cb8) at pthread_cond_wait.c:655
#3  0x00007fffdcb6fecb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fffdcb6fac7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fffeb4d66db in start_thread (arg=0x7fffdfe64700) at pthread_create.c:463
#6  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 8 (Thread 0x7fffd77ce700 (LWP 10655)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fffd77cdca8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe8e64747 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fffe8e6636a in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fffe2807cc0 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fffeb4d66db in start_thread (arg=0x7fffd77ce700) at pthread_create.c:463
#6  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff7f88800 (LWP 10465)):
#0  0x00007ffff6b2cb1a in KisView::document (this=0x0) at /home/wolthera/krita/src/libs/ui/KisView.cpp:623
---Type <return> to continue, or q <return> to quit---
#1  0x00007ffff68799f2 in KisStatusBar::updateMemoryStatus (this=0x55555dc46988)
    at /home/wolthera/krita/src/libs/ui/kis_statusbar.cc:334
#2  0x00007ffff6879012 in KisStatusBar::imageSizeChanged (this=0x55555dc46988)
    at /home/wolthera/krita/src/libs/ui/kis_statusbar.cc:255
#3  0x00007ffff6bbd0e7 in KisStatusBar::qt_static_metacall (_o=0x55555dc46988, _c=QMetaObject::InvokeMetaMethod, _id=3, 
    _a=0x7fffffffad00) at /home/wolthera/krita/build/libs/ui/kritaui_autogen/EWIEGA46WW/moc_kis_statusbar.cpp:119
#4  0x00007ffff309ddc9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff54a7dd5 in KisMemoryStatisticsServer::sigUpdateMemoryStatistics (
    this=0x7ffff594d990 <_ZZN12_GLOBAL__N_116Q_QGS_s_instance13innerFunctionEvE6holder>)
    at /home/wolthera/krita/build/libs/image/kritaimage_autogen/EWIEGA46WW/moc_kis_memory_statistics_server.cpp:141
#6  0x00007ffff54a7c0d in KisMemoryStatisticsServer::qt_static_metacall (
    _o=0x7ffff594d990 <_ZZN12_GLOBAL__N_116Q_QGS_s_instance13innerFunctionEvE6holder>, _c=QMetaObject::InvokeMetaMethod, 
    _id=0, _a=0x7fffffffae40)
    at /home/wolthera/krita/build/libs/image/kritaimage_autogen/EWIEGA46WW/moc_kis_memory_statistics_server.cpp:81
#7  0x00007ffff309ddc9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff4963a0f in KisSignalCompressor::timeout (this=0x55555d8b9ba0)
    at /home/wolthera/krita/build/libs/global/kritaglobal_autogen/EWIEGA46WW/moc_kis_signal_compressor.cpp:152
#9  0x00007ffff493d3e3 in KisSignalCompressor::tryEmitSignalSafely (this=0x55555d8b9ba0)
    at /home/wolthera/krita/src/libs/global/kis_signal_compressor.cpp:190
#10 0x00007ffff493d35f in KisSignalCompressor::tryEmitOnTick (this=0x55555d8b9ba0, isFromTimer=true)
    at /home/wolthera/krita/src/libs/global/kis_signal_compressor.cpp:167
#11 0x00007ffff493d454 in KisSignalCompressor::slotTimerExpired (this=0x55555d8b9ba0)
    at /home/wolthera/krita/src/libs/global/kis_signal_compressor.cpp:202
#12 0x00007ffff4963854 in KisSignalCompressor::qt_static_metacall (_o=0x55555d8b9ba0, _c=QMetaObject::InvokeMetaMethod, 
    _id=4, _a=0x7fffffffb060)
    at /home/wolthera/krita/build/libs/global/kritaglobal_autogen/EWIEGA46WW/moc_kis_signal_compressor.cpp:94
#13 0x00007ffff309ddc9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff30a1ba7 in QTimer::timeout(QTimer::QPrivateSignal) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff30a1f08 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff3095df3 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff3f4c8bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ffff3f53ac0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff6aaa695 in KisApplication::notify (this=0x7fffffffda00, receiver=0x55555db271c0, event=0x7fffffffb450)
    at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:705
#20 0x00007ffff3062db8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff30c1549 in QTimerInfoList::activateTimers() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007ffff30c1d11 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007fffe9bd8417 in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007fffe9bd8650 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007ffff673bcd7 in KisDelayedSaveDialog::blockIfImageIsBusy (this=0x7fffffffb690)
    at /home/wolthera/krita/src/libs/ui/dialogs/kis_delayed_save_dialog.cpp:97
#28 0x00007ffff6b1440b in (anonymous namespace)::busyWaitWithFeedback (image=...)
    at /home/wolthera/krita/src/libs/ui/KisPart.cpp:135
#29 0x00007ffff6b198ba in std::_Function_handler<void (KisSharedPtr<KisImage>), void (*)(KisSharedPtr<KisImage>)>::_M_invoke(s---Type <return> to continue, or q <return> to quit---
td::_Any_data const&, KisSharedPtr<KisImage>&&) (__functor=..., __args#0=...) at /usr/include/c++/7/bits/std_function.h:316
#30 0x00007ffff515cf95 in std::function<void (KisSharedPtr<KisImage>)>::operator()(KisSharedPtr<KisImage>) const (
    this=0x55555e63b548, __args#0=...) at /usr/include/c++/7/bits/std_function.h:706
#31 0x00007ffff515c9bd in KisBusyWaitBroker::notifyWaitOnImageStarted (
    this=0x7ffff5943890 <_ZZN12_GLOBAL__N_116Q_QGS_s_instance13innerFunctionEvE6holder>, image=0x555566674630)
    at /home/wolthera/krita/src/libs/image/KisBusyWaitBroker.cpp:69
#32 0x00007ffff5214ecb in KisImage::waitForDone (this=0x555566674630)
    at /home/wolthera/krita/src/libs/image/kis_image.cc:1670
#33 0x00007ffff5216017 in KisImage::initialRefreshGraph (this=0x555566674630)
    at /home/wolthera/krita/src/libs/image/kis_image.cc:1880
#34 0x00007ffff6acbf04 in KisDocument::setCurrentImage (this=0x555565e97a00, image=..., forceInitialUpdate=true)
    at /home/wolthera/krita/src/libs/ui/KisDocument.cpp:2269
#35 0x00007fff99a7140c in KraImport::convert (this=0x555566158990, document=0x555565e97a00, io=0x7fffffffb9d0)
    at /home/wolthera/krita/src/plugins/impex/kra/kra_import.cpp:45
#36 0x00007ffff6ae1608 in KisImportExportManager::doImport (this=0x555565d14900, location=..., filter=...)
    at /home/wolthera/krita/src/libs/ui/KisImportExportManager.cpp:634
#37 0x00007ffff6addeb9 in KisImportExportManager::convert (this=0x555565d14900, direction=KisImportExportManager::Import, 
    location=..., realLocation=..., mimeType=..., showWarnings=false, exportConfiguration=..., isAsync=false)
    at /home/wolthera/krita/src/libs/ui/KisImportExportManager.cpp:372
#38 0x00007ffff6adbbea in KisImportExportManager::importDocument (this=0x555565d14900, location=..., mimeType=...)
    at /home/wolthera/krita/src/libs/ui/KisImportExportManager.cpp:137
#39 0x00007ffff6ac6295 in KisDocument::openFile (this=0x555565e97a00)
    at /home/wolthera/krita/src/libs/ui/KisDocument.cpp:1537
#40 0x00007ffff6ac9ac4 in KisDocument::openUrlInternal (this=0x555565e97a00, url=...)
    at /home/wolthera/krita/src/libs/ui/KisDocument.cpp:2040
#41 0x00007ffff6ac5a9a in KisDocument::openUrl (this=0x555565e97a00, _url=..., flags=...)
    at /home/wolthera/krita/src/libs/ui/KisDocument.cpp:1436
#42 0x00007fffa8a5d453 in Krita::openDocument (this=0x5555620a5ac0, filename=...)
    at /home/wolthera/krita/src/libs/libkis/Krita.cpp:325
#43 0x00007fffa815ff01 in meth_Krita_openDocument (sipSelf=0x7fffa29053a8, sipArgs=0x7fffa006da58)
    at /home/wolthera/krita/build/plugins/extensions/pykrita/sip/./krita/sipkritapart0.cpp:21951
#44 0x00007fffa8f0477b in _PyCFunction_FastCallDict () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#45 0x00007fffa8e6d44c in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#46 0x00007fffa8e73563 in _PyEval_EvalFrameDefault () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#47 0x00007fffa8e6ba63 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#48 0x00007fffa8e6d51e in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#49 0x00007fffa8e73563 in _PyEval_EvalFrameDefault () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#50 0x00007fffa8e6ba63 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#51 0x00007fffa8e6d51e in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#52 0x00007fffa8e73563 in _PyEval_EvalFrameDefault () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#53 0x00007fffa8e6ba63 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#54 0x00007fffa8e6d085 in _PyFunction_FastCallDict () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#55 0x00007fffa8f58211 in _PyObject_FastCallDict () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#56 0x00007fffa8f5893d in _PyObject_Call_Prepend () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#57 0x00007fffa8f589a8 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#58 0x00007fffa3d0bc80 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-36m-x86_64-linux-gnu.so
#59 0x00007fffa3d0c158 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-36m-x86_64-linux-gnu.so
#60 0x00007fffa3d0c3e0 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-36m-x86_64-linux-gnu.so
#61 0x00007fffa3d0ce67 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-36m-x86_64-linux-gnu.so
---Type <return> to continue, or q <return> to quit---
#62 0x00007ffff309e0c9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#63 0x00007ffff4038552 in QAbstractButton::clicked(bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#64 0x00007ffff403876a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#65 0x00007ffff4039b4a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#66 0x00007ffff4039d3d in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#67 0x00007fffa31c5a83 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-36m-x86_64-linux-gnu.so
#68 0x00007ffff3f8d7f8 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#69 0x00007fffa31c7073 in ?? () from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-36m-x86_64-linux-gnu.so
#70 0x00007ffff3f4c8bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#71 0x00007ffff3f54908 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#72 0x00007ffff6aaa695 in KisApplication::notify (this=0x7fffffffda00, receiver=0x5555620de170, event=0x7fffffffcfd0)
    at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:705
#73 0x00007ffff3062db8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#74 0x00007ffff3f52f8f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#75 0x00007ffff3fa7eb1 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#76 0x00007ffff3faad1a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#77 0x00007ffff3f4c8bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#78 0x00007ffff3f53ac0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#79 0x00007ffff6aaa695 in KisApplication::notify (this=0x7fffffffda00, receiver=0x55555dc50c30, event=0x7fffffffd4e0)
    at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:705
#80 0x00007ffff3062db8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#81 0x00007ffff365ef95 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#82 0x00007ffff36600c5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#83 0x00007ffff363901b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#84 0x00007fffe2808c8a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#85 0x00007fffe9bd8417 in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#86 0x00007fffe9bd8650 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#87 0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#88 0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#89 0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#90 0x00007ffff306adb0 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#91 0x0000555555e523e6 in main (argc=1, argv=0x7fffffffdb68) at /home/wolthera/krita/src/krita/main.cc:597
(gdb)
Comment 11 wolthera 2020-03-19 14:37:50 UTC
Crash after making a text shape. This one also happens when you...

1. make a new document
2. then a text shape (this does not crash, as the new doc is made via krita cpp, not python)
3. then open a document via python.

================
Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
0x00007ffff0344bff in qHash<KoShape*> (t=<error reading variable>, seed=1882038691)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qhashfunctions.h:119
119     { return qHash(t) ^ seed; }
(gdb) thread apply all backtrace

Thread 165 (Thread 0x7fff8a7fc700 (LWP 28064)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff8a7fbbf0, expected=0, 
    futex_word=0x5555603c6bf0) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff8a7fbca0, mutex=0x5555603c6ba0, cond=0x5555603c6bc8) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x5555603c6bc8, mutex=0x5555603c6ba0, abstime=0x7fff8a7fbca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff8a7fc700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 162 (Thread 0x7fff8b7fe700 (LWP 28061)):
#0  0x00007fffeb4dced9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fff8b7fdbf0, expected=0, 
    futex_word=0x555560437a34) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7fff8b7fdca0, mutex=0x5555604379e0, cond=0x555560437a08) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=0x555560437a08, mutex=0x5555604379e0, abstime=0x7fff8b7fdca0) at pthread_cond_wait.c:667
#3  0x00007ffff2e79d2a in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff2e79ee6 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e77275 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff8b7fe700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 16 (Thread 0x7fff9b4cf700 (LWP 24574)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fff8c002de0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fff9b4cf700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 15 (Thread 0x7fff9bcd0700 (LWP 24565)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fff94006140, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffd4c4ca86 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#7  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
#8  0x00007fffeb4d66db in start_thread (arg=0x7fff9bcd0700) at pthread_create.c:463
#9  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 14 (Thread 0x7fffb0ebc700 (LWP 24556)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fff9c0029e0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffd47b7605 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fffeb4d66db in start_thread (arg=0x7fffb0ebc700) at pthread_create.c:463
#9  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 13 (Thread 0x7fffabfff700 (LWP 24522)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff2e76020 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007ffff2e75e92 in QSemaphore::tryAcquire(int, int) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff50384ca in KisTileDataSwapper::waitForWork (this=
    0x7ffff5939a20 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>)
    at /home/wolthera/krita/src/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:86
#4  0x00007ffff50384e6 in KisTileDataSwapper::run (
    this=0x7ffff5939a20 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>)
    at /home/wolthera/krita/src/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#5  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffeb4d66db in start_thread (arg=0x7fffabfff700) at pthread_create.c:463
#7  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 11 (Thread 0x7fffb3803700 (LWP 24508)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fffac002de0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fffeb4d66db in start_thread (arg=0x7fffb3803700) at pthread_create.c:463
#8  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 10 (Thread 0x7fffcccfa700 (LWP 24238)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fffc801d610, nfds=4, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe9bd85c9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff2e72317 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffe8bdf555 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fffeb4d66db in start_thread (arg=0x7fffcccfa700) at pthread_create.c:463
#9  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 9 (Thread 0x7fffdfe64700 (LWP 24237)):
#0  0x00007fffeb4dc9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x555557443c8c)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x555557443c38, cond=0x555557443c60) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x555557443c60, mutex=0x555557443c38) at pthread_cond_wait.c:655
#3  0x00007fffdcb6fecb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fffdcb6fac7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fffeb4d66db in start_thread (arg=0x7fffdfe64700) at pthread_create.c:463
#6  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 8 (Thread 0x7fffd77ce700 (LWP 24228)):
#0  0x00007ffff2543bf9 in __GI___poll (fds=0x7fffd77cdca8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe8e64747 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fffe8e6636a in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fffe2807cc0 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007ffff2e737ec in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fffeb4d66db in start_thread (arg=0x7fffd77ce700) at pthread_create.c:463
#6  0x00007ffff255088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff7f88800 (LWP 24040)):
#0  0x00007ffff0344bff in qHash<KoShape*> (t=<error reading variable>, seed=1882038691)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qhashfunctions.h:119
#1  0x00007ffff03442ba in QHash<KoShape*, QHashDummyValue>::findNode (this=0x7fffffffc470, akey=<error reading variable>, 
    ahp=0x7fffffffc2f4) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:950
#2  0x00007ffff03409b0 in QHash<KoShape*, QHashDummyValue>::insert (this=0x7fffffffc470, akey=<error reading variable>, 
    avalue=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:790
#3  0x00007ffff033d336 in QSet<KoShape*>::insert (this=0x7fffffffc470, value=<error reading variable>)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qset.h:208
#4  0x00007ffff03787de in QSet<KoShape*>::QSet<QList<KoShape*>::const_iterator, true> (this=0x7fffffffc470, first=..., 
    last=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qset.h:66
#5  0x00007ffff0371f37 in KoToolManager::Private::postSwitchTool (this=0x55555e53f4f0, temporary=false)
    at /home/wolthera/krita/src/libs/flake/KoToolManager.cpp:594
#6  0x00007ffff037178e in KoToolManager::Private::switchTool (this=0x55555e53f4f0, tool=0x555563b33970, temporary=false)
    at /home/wolthera/krita/src/libs/flake/KoToolManager.cpp:536
#7  0x00007ffff03719dd in KoToolManager::Private::switchTool (this=0x55555e53f4f0, id=..., temporary=false)
    at /home/wolthera/krita/src/libs/flake/KoToolManager.cpp:561
#8  0x00007ffff036fed1 in KoToolManager::switchToolRequested (
    this=0x7ffff080f770 <_ZZN12_GLOBAL__N_116Q_QGS_s_instance13innerFunctionEvE6holder>, id=...)
    at /home/wolthera/krita/src/libs/flake/KoToolManager.cpp:297
#9  0x00007fffb980408c in SvgTextTool::slotTextEditorClosed (this=0x55556666a990)
---Type <return> to continue, or q <return> to quit---
    at /home/wolthera/krita/src/plugins/tools/svgtexttool/SvgTextTool.cpp:255
#10 0x00007fffb9814a6e in SvgTextTool::qt_static_metacall (_o=0x55556666a990, _c=QMetaObject::InvokeMetaMethod, _id=1, 
    _a=0x7fffffffc700)
    at /home/wolthera/krita/build/plugins/tools/svgtexttool/krita_tool_svgtext_autogen/EWIEGA46WW/moc_SvgTextTool.cpp:93
#11 0x00007ffff309ddc9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007fffb98149e9 in SvgTextEditor::textEditorClosed (this=0x5555602d9040)
    at /home/wolthera/krita/build/plugins/tools/svgtexttool/krita_tool_svgtext_autogen/EWIEGA46WW/moc_SvgTextEditor.cpp:424
#13 0x00007fffb97f5676 in SvgTextEditor::slotCloseEditor (this=0x5555602d9040)
    at /home/wolthera/krita/src/plugins/tools/svgtexttool/SvgTextEditor.cpp:1249
#14 0x00007fffb9814225 in SvgTextEditor::qt_static_metacall (_o=0x5555602d9040, _c=QMetaObject::InvokeMetaMethod, _id=4, 
    _a=0x7fffffffc870)
    at /home/wolthera/krita/build/plugins/tools/svgtexttool/krita_tool_svgtext_autogen/EWIEGA46WW/moc_SvgTextEditor.cpp:285
#15 0x00007ffff309ddc9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff40dcdc8 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff309ddc9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff4038552 in QAbstractButton::clicked(bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff403876a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ffff4039b4a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff4039d3d in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff3f8d7f8 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff3f4c8bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff3f54908 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff6aaa695 in KisApplication::notify (this=0x7fffffffda00, receiver=0x55555f2b7dd0, event=0x7fffffffcfd0)
    at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:705
#26 0x00007ffff3062db8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007ffff3f52f8f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007ffff3fa7eb1 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007ffff3faad1a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#30 0x00007ffff3f4c8bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007ffff3f53ac0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007ffff6aaa695 in KisApplication::notify (this=0x7fffffffda00, receiver=0x555560438940, event=0x7fffffffd4e0)
    at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:705
#33 0x00007ffff3062db8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007ffff365ef95 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#35 0x00007ffff36600c5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#36 0x00007ffff363901b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#37 0x00007fffe2808c8a in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#38 0x00007fffe9bd8417 in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007fffe9bd8650 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007fffe9bd86dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#41 0x00007ffff30c20bc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#42 0x00007ffff306163a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#43 0x00007ffff306adb0 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#44 0x0000555555e523e6 in main (argc=1, argv=0x7fffffffdb68) at /home/wolthera/krita/src/krita/main.cc:597
(gdb)
Comment 12 Manga Tengu 2020-03-22 14:11:59 UTC
subscribing!
Comment 13 Halla Rempt 2020-05-05 12:57:20 UTC
Created attachment 128172 [details]
A python script that tests creating documents

The script includes the output from Krita that shows that the KisDocument and KisImage instances are deleted when the script has run. Deleting a KisDocument is done with deleteLater, which relies on events being handled.
Comment 14 Halla Rempt 2020-05-05 12:58:04 UTC
Created attachment 128174 [details]
A diff that adds output showing objects being created and deleted

With this patch, krita prints whenever a KisImage, a KisDocument or a Document is created or deleted.
Comment 15 Halla Rempt 2020-05-05 13:17:52 UTC
Git commit 7f973f64007637a2d4d175de5a4a2fab33bbc13c by Boudewijn Rempt.
Committed on 05/05/2020 at 12:59.
Pushed by rempt into branch 'krita/4.3'.

Add a notify parameter to KisPart::createDocument

When creating a document from libkis' Krita class, we don't want
the Notifier to go off and create spurious and pretty useless
documents.

M  +8    -3    libs/libkis/Krita.cpp
M  +5    -3    libs/ui/KisPart.cpp
M  +1    -1    libs/ui/KisPart.h

https://invent.kde.org/kde/krita/commit/7f973f64007637a2d4d175de5a4a2fab33bbc13c
Comment 16 Halla Rempt 2020-05-05 13:18:10 UTC
Git commit 64e4e0fead53e12137ca74a721bc8b0bd8783c29 by Boudewijn Rempt.
Committed on 05/05/2020 at 13:18.
Pushed by rempt into branch 'master'.

Add a notify parameter to KisPart::createDocument

When creating a document from libkis' Krita class, we don't want
the Notifier to go off and create spurious and pretty useless
documents.
(cherry picked from commit 7f973f64007637a2d4d175de5a4a2fab33bbc13c)

M  +8    -3    libs/libkis/Krita.cpp
M  +5    -3    libs/ui/KisPart.cpp
M  +1    -1    libs/ui/KisPart.h

https://invent.kde.org/kde/krita/commit/64e4e0fead53e12137ca74a721bc8b0bd8783c29
Comment 17 Halla Rempt 2020-05-05 13:18:11 UTC
Git commit 518eea7a0475a5b3723b973da41b07c3c715d18b by Boudewijn Rempt.
Committed on 05/05/2020 at 13:18.
Pushed by rempt into branch 'master'.

Delete documents created by libkis directly

Otherwise you will have to wait until the even loop kicks back
in before the images are really deleted, and that only happens
after the script is done running.
(cherry picked from commit 543565e9cb5d1ddd8fd46bbd65e98e46d059a507)

M  +7    -1    libs/libkis/Document.cpp
M  +4    -2    libs/ui/KisPart.cpp
M  +1    -1    libs/ui/KisPart.h

https://invent.kde.org/kde/krita/commit/518eea7a0475a5b3723b973da41b07c3c715d18b
Comment 18 Halla Rempt 2020-05-05 13:20:48 UTC
After these commits, the "owned" KisImage instances are deleted directly, instead of after the script is done.
Comment 19 Halla Rempt 2020-05-05 13:24:22 UTC
I cannot reproduce the second crash. I have created a document, added a text shape, then I ran the following script:

from krita import *
d = Application.activeDocument()
print(d)
d.close()
d = Application.createDocument(1000, 1000, "Test1", "RGBA", "U8", "", 120.0)
print(d)

Without any problems.
Comment 20 Halla Rempt 2020-05-05 13:36:31 UTC
When running the comic book manager export now, I do see that the images are directly deleted, but curiously enough, they seem to be created and deleted twice:

Created Document Document(0x55d62aa75dd0) KisDocument(0x7fd8180152a0, name = "document_21") owns false
Deleted Document Document(0x55d62aa75dd0) KisDocument(0x7fd8180152a0, name = "document_21") owns false
Created KisImage KisImage(0x55d62fa27fc0)
                Could not set current file 0 "hylti_p17/layers/layer2.shapelayer/content.svg"
                Could not set current file 0 "hylti_p17/layers/layer2.shapelayer//META-INF/manifest.xml"
Created Document Document(0x55d63054b1d0) KisDocument(0x7fd8180152a0, name = "document_21") owns true
Deleted Document Document(0x55d62f9c3530) QObject(0x0) owns true
Created Document Document(0x55d630553e00) KisDocument(0x55d630568550, name = "document_21") owns true
Deleted Document Document(0x55d62f9c2dd0) QObject(0x0) owns true
Document::close Document(0x55d630553e00) KisDocument(0x55d630568550, name = "document_21") true KisPart has: (KisDocument(0x7fd8180152a0, name = "document_21"))
Deleted KisImage KisImage(0x55d62fb4e320, name = "hylti_p17")
Document::close Document(0x55d63054b1d0) KisDocument(0x7fd8180152a0, name = "document_21") true KisPart has: (KisDocument(0x7fd8180152a0, name = "document_21"))
Deleted KisImage KisImage(0x55d62fa27fc0, name = "hylti_p17")
Comment 21 Halla Rempt 2020-05-05 13:38:49 UTC
Btw, the QTimer approach works, because that inserts invents in the global event loop, so the deleteLater that deletes the KisDocument event happens.
Comment 22 Halla Rempt 2020-05-05 14:51:00 UTC
(Though it's not necessary to use QTimer anymore, since commit 543565e9cb5d1ddd8fd46bbd65e98e46d059a507
Comment 23 wolthera 2022-01-15 11:52:13 UTC
I'm sorry, but this still happens. It also happens with the generate banners script: https://invent.kde.org/-/snippets/1972
Comment 24 Halla Rempt 2022-09-14 08:26:34 UTC
I'm not going to work on this, so unassigning.