Bug 444950

Summary: Crash loading incorrect file (backup file) as pattern resource.
Product: [Applications] krita Reporter: wolthera <griffinvalley>
Component: GeneralAssignee: Tiar <tamtamy.tymona>
Status: RESOLVED FIXED    
Severity: normal CC: amy, griffinvalley, tamtamy.tymona
Priority: NOR Keywords: drkonqi, regression, release_blocker
Version: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
Potential patch for tasksets

Description wolthera 2021-11-04 14:27:45 UTC
Application: krita (5.0.0-beta2 (git e610fb6))

Qt Version: 5.15.3
Frameworks Version: 5.87.0
Operating System: Linux 5.4.0-88-generic x86_64
Windowing System: X11
Distribution: KDE neon User Edition 5.22
DrKonqi: 5.23.0 [KCrashBackend]

-- Information about the crash:
Loading a backup png file as a pattern resource causes Krita to crash.

1. Have a file that ends in ~, so for example, sketch.png~
2. Import this as a pattern using the pattern docker dropdown.
3. This crash will happen.

The crash can be reproduced every time.

-- Backtrace:
Application: Krita (krita), signal: Aborted

[New LWP 2962496]
[New LWP 2962497]
[New LWP 2962498]
[New LWP 2962499]
[New LWP 2962500]
[New LWP 2962792]
[New LWP 2962798]
[New LWP 2962807]
[New LWP 2962808]
[New LWP 2962826]
[New LWP 2962827]
[New LWP 3068985]
[New LWP 3071192]
[New LWP 3071193]
[New LWP 3071222]
[New LWP 3071223]
[New LWP 3071468]
[New LWP 3071469]
[New LWP 3071470]
[New LWP 3071471]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fd6d5a1baff in __GI___poll (fds=0x7ffc81ef16f8, nfds=1, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
__preamble__
[Current thread is 1 (Thread 0x7fd6d064cf80 (LWP 2962475))]

Thread 21 (Thread 0x7fd650dfa700 (LWP 3071471)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd650df9c90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9b5a9f0) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd650df9c90, clockid=<optimized out>, mutex=0x55f5e9b5a9a0, cond=0x55f5e9b5a9c8) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9b5a9c8, mutex=0x55f5e9b5a9a0, abstime=0x7fd650df9c90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 20 (Thread 0x7fd6527fd700 (LWP 3071470)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd6527fcc90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9b2ac84) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd6527fcc90, clockid=<optimized out>, mutex=0x55f5e9b2ac30, cond=0x55f5e9b2ac58) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9b2ac58, mutex=0x55f5e9b2ac30, abstime=0x7fd6527fcc90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 19 (Thread 0x7fd653fff700 (LWP 3071469)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd653ffec90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9c7e3d0) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd653ffec90, clockid=<optimized out>, mutex=0x55f5e9c7e380, cond=0x55f5e9c7e3a8) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9c7e3a8, mutex=0x55f5e9c7e380, abstime=0x7fd653ffec90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 18 (Thread 0x7fd6a5e0c700 (LWP 3071468)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd6a5e0bc90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9b2ccd0) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd6a5e0bc90, clockid=<optimized out>, mutex=0x55f5e9b2cc80, cond=0x55f5e9b2cca8) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9b2cca8, mutex=0x55f5e9b2cc80, abstime=0x7fd6a5e0bc90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 17 (Thread 0x7fd651ffc700 (LWP 3071223)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd651ffbc90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9b2f280) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd651ffbc90, clockid=<optimized out>, mutex=0x55f5e9b2f230, cond=0x55f5e9b2f258) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9b2f258, mutex=0x55f5e9b2f230, abstime=0x7fd651ffbc90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 16 (Thread 0x7fd6477fe700 (LWP 3071222)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd6477fdc90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9c87850) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd6477fdc90, clockid=<optimized out>, mutex=0x55f5e9c87800, cond=0x55f5e9c87828) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9c87828, mutex=0x55f5e9c87800, abstime=0x7fd6477fdc90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 15 (Thread 0x7fd646ffd700 (LWP 3071193)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd646ffcc90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9b2fbc4) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd646ffcc90, clockid=<optimized out>, mutex=0x55f5e9b2fb70, cond=0x55f5e9b2fb98) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9b2fb98, mutex=0x55f5e9b2fb70, abstime=0x7fd646ffcc90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 14 (Thread 0x7fd65a333700 (LWP 3071192)):
#0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fd65a332c90, clockid=<optimized out>, expected=0, futex_word=0x55f5e9c6f5f0) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7fd65a332c90, clockid=<optimized out>, mutex=0x55f5e9c6f5a0, cond=0x55f5e9c6f5c8) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x55f5e9c6f5c8, mutex=0x55f5e9c6f5a0, abstime=0x7fd65a332c90) at pthread_cond_wait.c:656
#3  0x00007fd6d5dc9528 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5dc6a31 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 13 (Thread 0x7fd6537fe700 (LWP 3068985)):
#0  0x00007fd6d5a1baff in __GI___poll (fds=0x7fd6980035d0, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fd6d2f711d6 in  () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#2  0x00007fd6d2f62841 in pa_mainloop_poll () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#3  0x00007fd6d2f62ec3 in pa_mainloop_iterate () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fd6d2f62f70 in pa_mainloop_run () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fd6d2f7111d in  () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fd6d0d2772c in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-13.99.so
#7  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#8  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 12 (Thread 0x7fd658a37700 (LWP 2962827)):
#0  __GI___libc_read (nbytes=16, buf=0x7fd658a36b10, fd=39) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=39, buf=0x7fd658a36b10, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007fd6d308ab2f in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd6d3041ebe in g_main_context_check () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fd6d3042312 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fd6d30424a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007fd6d60045eb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fd6d5fa887b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fd6d5dc2292 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#11 0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 11 (Thread 0x7fd659238700 (LWP 2962826)):
#0  0x00007fd6d3041841 in g_main_context_prepare () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007fd6d304229b in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fd6d30424a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd6d60045eb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fd6d5fa887b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5dc2292 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#8  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 10 (Thread 0x7fd668f79700 (LWP 2962808)):
#0  0x00007fd6d308f508 in g_mutex_unlock () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007fd6d30418e1 in g_main_context_prepare () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fd6d304229b in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd6d30424a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fd6d60045eb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5fa887b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d5dc2292 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fd6c14313ba in  () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#8  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 9 (Thread 0x7fd66a8af700 (LWP 2962807)):
#0  __GI___libc_read (nbytes=16, buf=0x7fd66a8aeaf0, fd=32) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=32, buf=0x7fd66a8aeaf0, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007fd6d308ab2f in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd6d3041ebe in g_main_context_check () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fd6d3042312 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fd6d30424a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007fd6d60045eb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fd6d5fa887b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fd6d5dc2292 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007fd6c117c549 in  () at /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#10 0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#12 0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 8 (Thread 0x7fd66a0ae700 (LWP 2962798)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fd6d5dc59b0 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fd6d5dc5816 in QSemaphore::tryAcquire(int, int) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007fd6d741a3d7 in KisTileDataSwapper::waitForWork() (this=<optimized out>) at /home/wolthera/krita/src/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:74
#4  0x00007fd6d741a5da in KisTileDataSwapper::run() (this=0x7fd6d7966ca0 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at /home/wolthera/krita/src/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:80
#5  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 7 (Thread 0x7fd69612e700 (LWP 2962792)):
#0  0x00007fd6d5dc39c3 in QMutex::unlock() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007fd6d6004cd9 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fd6d3041da1 in g_main_context_check () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd6d3042312 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fd6d30424a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fd6d60045eb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d5fa887b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fd6d5dc2292 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7fd6b3fff700 (LWP 2962500)):
#0  0x00007fd6d308f4dd in g_mutex_lock () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007fd6d30418fa in g_main_context_prepare () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fd6d304229b in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd6d30424a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fd6d60045eb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fd6d5fa887b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fd6d5dc2292 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fd6d2e11f4b in  () at /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#8  0x00007fd6d5dc342c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7fd6c09dc700 (LWP 2962499)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fd6b80018d8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fd6b8001888, cond=0x7fd6b80018b0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7fd6b80018b0, mutex=0x7fd6b8001888) at pthread_cond_wait.c:638
#3  0x00007fd6cd786e7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007fd6cd786a7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fd6cd3ad700 (LWP 2962498)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fd6b80018d8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fd6b8001888, cond=0x7fd6b80018b0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7fd6b80018b0, mutex=0x7fd6b8001888) at pthread_cond_wait.c:638
#3  0x00007fd6cd786e7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007fd6cd786a7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fd6ccbac700 (LWP 2962497)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fd6b80018d8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fd6b8001888, cond=0x7fd6b80018b0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7fd6b80018b0, mutex=0x7fd6b8001888) at pthread_cond_wait.c:638
#3  0x00007fd6cd786e7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007fd6cd786a7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fd6c2849700 (LWP 2962496)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fd6b80018d8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fd6b8001888, cond=0x7fd6b80018b0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7fd6b80018b0, mutex=0x7fd6b8001888) at pthread_cond_wait.c:638
#3  0x00007fd6cd786e7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007fd6cd786a7b in  () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007fd6d39bf609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fd6d5a28293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fd6d064cf80 (LWP 2962475)):
[KCrash Handler]
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x00007fd6d592b859 in __GI_abort () at abort.c:79
#6  0x00007fd6d5d87bd7 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fd6d5d86fe3 in qt_assert_x(char const*, char const*, char const*, int) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fd6d70f5b94 in KoResource::setMD5Sum(QString const&) (this=0x55f5fade3490, md5sum=...) at /home/wolthera/krita/src/libs/resources/KoResource.cpp:165
#9  0x00007fd6d7188ce7 in KoResource::md5Sum(bool) const (this=0x55f5fade3490, generateIfEmpty=generateIfEmpty@entry=true) at /home/wolthera/krita/src/libs/resources/KoResource.cpp:153
#10 0x00007fd6d711fe52 in KisResourceLocator::importResourceFromFile(QString const&, QString const&, bool, QString const&) (this=0x55f5ecfe62f0, resourceType=..., fileName=..., allowOverwrite=<optimized out>, storageLocation=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:307
#11 0x00007fd6d713582f in KisAllResourcesModel::importResourceFile(QString const&, bool, QString const&) (this=0x55f5ed808e60, filename=..., allowOverwrite=<optimized out>, storageId=...) at /home/wolthera/krita/src/libs/resources/KisResourceModel.cpp:447
#12 0x00007fd6d7132dcf in KisResourceModel::importResourceFile(QString const&, bool, QString const&) (this=this@entry=0x7ffc81ef2ba0, filename=..., allowOverwrite=allowOverwrite@entry=false, storageId=...) at /home/wolthera/krita/src/libs/resources/KisResourceModel.cpp:715
#13 0x00007fd6d4dfe455 in KisResourceUserOperations::importResourceFileWithUserInput(QWidget*, QString, QString, QString) (widgetParent=widgetParent@entry=0x55f5ef044aa0, storageLocation=..., resourceType=..., resourceFilepath=...) at /home/wolthera/krita/src/libs/resourcewidgets/KisResourceUserOperations.cpp:73
#14 0x00007fd6d4df17f0 in KisResourceItemChooser::slotButtonClicked(int) (this=0x55f5ef044aa0, button=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:835
#15 0x00007fd6d4de68a1 in KisResourceItemChooser::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /home/wolthera/krita/build/libs/resourcewidgets/kritaresourcewidgets_autogen/EWIEGA46WW/moc_KisResourceItemChooser.cpp:125
#16 0x00007fd6d5fe0dd0 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fd6d6b807c5 in QButtonGroup::buttonClicked(int) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007fd6d6b7bf08 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007fd6d6b7d363 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007fd6d6b7d525 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007fd6d6c748ae in QToolButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007fd6d6ac6cf6 in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007fd6d6c74958 in QToolButton::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007fd6d6a83dc3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007fd6d6a8ce77 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007fd6d8224d7d in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x55f5f0be8f00, event=0x7ffc81ef3460) at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:698
#27 0x00007fd6d5fa9d7a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#28 0x00007fd6d6a8c0a7 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007fd6d6ae29de in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#30 0x00007fd6d6ae5264 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007fd6d6a83dc3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007fd6d6a8cbb8 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#33 0x00007fd6d8224d7d in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x55f5f35b9d80, event=0x7ffc81ef3960) at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:698
#34 0x00007fd6d5fa9d7a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007fd6d638d4d8 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#36 0x00007fd6d638eb45 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#37 0x00007fd6d63667ac in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#38 0x00007fd6d01d0eae in  () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#39 0x00007fd6d304217d in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007fd6d3042400 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007fd6d30424a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#42 0x00007fd6d60045d2 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#43 0x00007fd6d5fa887b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#44 0x00007fd6d5fb0a34 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#45 0x000055f5e8263320 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /home/wolthera/krita/src/krita/main.cc:678
[Inferior 1 (process 2962475) detached]

Possible duplicates by query: bug 443308, bug 442146, bug 442117, bug 441638, bug 439730.

Reported using DrKonqi
Comment 1 wolthera 2021-11-04 14:43:13 UTC
Created attachment 143202 [details]
New crash information added by DrKonqi

krita (5.0.0-beta2 (git e610fb6)) using Qt 5.15.3

Also having this with tasksets, this time, I selected "taskset.kts copy"

-- Backtrace (Reduced):
#4  0x00007f22cb8b6bef in KisResourceLoaderBase::load(QString const&, QIODevice&, QSharedPointer<KisResourcesInterface>) (resourcesInterface=..., dev=..., name=..., this=0x0) at /home/wolthera/krita/src/libs/resources/KisResourceLoader.h:97
#5  KisResourceLocator::importResourceFromFile(QString const&, QString const&, bool, QString const&) (this=0x5606b6364470, resourceType=..., fileName=..., allowOverwrite=<optimized out>, storageLocation=...) at /home/wolthera/krita/src/libs/resources/KisResourceLocator.cpp:305
#6  0x00007f22cb8cc82f in KisAllResourcesModel::importResourceFile(QString const&, bool, QString const&) (this=0x5606bc949d50, filename=..., allowOverwrite=<optimized out>, storageId=...) at /home/wolthera/krita/src/libs/resources/KisResourceModel.cpp:447
#7  0x00007f22cb8c9dcf in KisResourceModel::importResourceFile(QString const&, bool, QString const&) (this=this@entry=0x7ffc2221cbb0, filename=..., allowOverwrite=allowOverwrite@entry=false, storageId=...) at /home/wolthera/krita/src/libs/resources/KisResourceModel.cpp:715
#8  0x00007f22c9595455 in KisResourceUserOperations::importResourceFileWithUserInput(QWidget*, QString, QString, QString) (widgetParent=widgetParent@entry=0x5606bc9684b0, storageLocation=..., resourceType=..., resourceFilepath=...) at /home/wolthera/krita/src/libs/resourcewidgets/KisResourceUserOperations.cpp:73
Comment 2 Tiar 2021-11-05 00:54:58 UTC
Created attachment 143220 [details]
Potential patch for tasksets

@Wolthera, how did you make `sketch.png~` to be visible for you when you search for patterns? I can't see it when the ending is wrong. I think I have the Qt dialogs, I tried to enable native dialogs but even after restart it still shows the same dialog.

The pattern crash probably happens because:
- it needs md5 sum. But it isn't calculated yet
- to calculate md5 sum, it tries to save the pattern to memory (why? it's not embedded in anything, it's a file)
- saving pattern to memory doesn't work, because it uses: QImage.save(buffer, "PNG~") function. So it doesn't save any bytes
- md5 doesn't work on empty buffers (no bytes saved)
Since we're going to talk about md5 situation with Dmitry, so I'll mention that.

For tasksets, the backtrace is different (note that it doesn't go into `md5Sum()` function but already crashes on load()). However I have the same problem, reproducing your issue :/
However I read the code and I think the problem might be that it simply doesn't create a loader (I can't be sure because the backtrace is cut, I think - was it segmentation fault because of empty loader?  I hope so, at least). In that case, I provided a patch file, which might or might not work, because I couldn't test it. It would be awesome if you could please test it, if it's possible.
Comment 3 amyspark 2021-11-05 01:44:05 UTC
I cannot reproduce either of the two crashes with de586e5385 under MSVC.
Comment 4 wolthera 2021-11-05 19:32:33 UTC
(In reply to Tiar from comment #2)
> Created attachment 143220 [details]
> Potential patch for tasksets
> 
> @Wolthera, how did you make `sketch.png~` to be visible for you when you
> search for patterns? I can't see it when the ending is wrong. I think I have
> the Qt dialogs, I tried to enable native dialogs but even after restart it
> still shows the same dialog.
> 
> The pattern crash probably happens because:
> - it needs md5 sum. But it isn't calculated yet
> - to calculate md5 sum, it tries to save the pattern to memory (why? it's
> not embedded in anything, it's a file)
> - saving pattern to memory doesn't work, because it uses:
> QImage.save(buffer, "PNG~") function. So it doesn't save any bytes
> - md5 doesn't work on empty buffers (no bytes saved)
> Since we're going to talk about md5 situation with Dmitry, so I'll mention
> that.
> 
> For tasksets, the backtrace is different (note that it doesn't go into
> `md5Sum()` function but already crashes on load()). However I have the same
> problem, reproducing your issue :/
> However I read the code and I think the problem might be that it simply
> doesn't create a loader (I can't be sure because the backtrace is cut, I
> think - was it segmentation fault because of empty loader?  I hope so, at
> least). In that case, I provided a patch file, which might or might not
> work, because I couldn't test it. It would be awesome if you could please
> test it, if it's possible.

I am using the KDE native dialogs. This patch fixes the crash with the task set, but not the crash with the backup file.
Comment 5 Tiar 2021-11-08 12:06:53 UTC
Git commit e1be9329dc5210170c95a55488c051546388dc63 by Agata Cacko.
Committed on 08/11/2021 at 12:04.
Pushed by tymond into branch 'master'.

Fix crash on loading `tmp.kts copy` as a taskset

Before this commit, if one tried to use native file dialogs
and import a file called for example `tmp.kts copy` as a taskset,
Krita would crash or assert.
This commit ensures that Krita recognizes that the loader hasn't been
created and leaves the function early, which avoids the crash.

M  +5    -0    libs/resources/KisResourceLocator.cpp

https://invent.kde.org/graphics/krita/commit/e1be9329dc5210170c95a55488c051546388dc63
Comment 6 Tiar 2021-11-08 15:52:47 UTC
Git commit 091a6db6b710fbc9818fc1299b26c9390f9b63c4 by Agata Cacko.
Committed on 08/11/2021 at 15:49.
Pushed by tymond into branch 'krita/5.0'.

Fix crash on loading `tmp.kts copy` as a taskset

Before this commit, if one tried to use native file dialogs
and import a file called for example `tmp.kts copy` as a taskset,
Krita would crash or assert.
This commit ensures that Krita recognizes that the loader hasn't been
created and leaves the function early, which avoids the crash.

M  +5    -0    libs/resources/KisResourceLocator.cpp

https://invent.kde.org/graphics/krita/commit/091a6db6b710fbc9818fc1299b26c9390f9b63c4
Comment 7 Tiar 2021-11-30 06:06:09 UTC
Fix for tasksets works for patterns too, at least in my case. @Wolthera, if you can still reproduce it, please add new steps to reproduce (unless they are completely the same), or maybe the file you try to import (though here it fails on creating a loader for the filename so I don't know why it would crash for you).

On my system, with some debug lines added, I get this output:
Could not create loader for "patterns" "pattern.png~" "application/x-trash"
Could not create loader for "patterns" "pattern.png~" "application/x-trash"
Could not retrieve imported resource from the storage "patterns" "/home/tymon/kritadev/otherfiles/testfiles/resources/pattern.png~" ""
Failed to import resource "/home/tymon/kritadev/otherfiles/testfiles/resources/pattern.png~"
First attempt: isNull =  true
Storage location:  ""
marked as existing already:  true
Could not create loader for "patterns" "pattern.png~" "application/x-trash"
Failed to import resource "/home/tymon/kritadev/otherfiles/testfiles/resources/pattern.png~"

I get two messages, first asking if I want to overwrite the file (which is clearly a bug - but it doesn't happen with correct importing), and then that it failed importing. I know why it does that... I will make a bug report for that tomorrow (so it will be more clear than this long one here).
Comment 8 wolthera 2021-11-30 13:32:52 UTC
Yep, you're correct, this is fixed :)