Application: krita (2.6.4) KDE Platform Version: 4.10.4 Qt Version: 4.8.4 Operating System: Linux 3.9.4-200.fc18.x86_64 x86_64 Distribution: "Fedora release 18 (Spherical Cow)" -- Information about the crash: - What I was doing when the application crashed: Sometimes, when I save the work, Krita crashes unexpectedly. I use a file where I combine imported pictures, vector graphics and some standard layers, with many backups of them. The crash can be reproduced sometimes. -- Backtrace: Application: Krita (krita), signal: Segmentation fault Using host libthread_db library "/lib64/libthread_db.so.1". [Current thread is 1 (Thread 0x7f84b0c31880 (LWP 6398))] Thread 6 (Thread 0x7f849fc1a700 (LWP 6399)): #0 0x0000003a4420b5e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x0000003a4da7bebb in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQtCore.so.4 #2 0x0000003a4da77dd7 in QSemaphore::acquire(int) () from /lib64/libQtCore.so.4 #3 0x00000032de0bf26e in KisTileDataPooler::waitForWork() () from /lib64/libkritaimage.so.11 #4 0x00000032de0bf9bb in KisTileDataPooler::run() () from /lib64/libkritaimage.so.11 #5 0x0000003a4da7b95c in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4 #6 0x0000003a44207d15 in start_thread () from /lib64/libpthread.so.0 #7 0x0000003a43af248d in clone () from /lib64/libc.so.6 Thread 5 (Thread 0x7f849f419700 (LWP 6400)): #0 0x0000003a4420b5e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x0000003a4da7bebb in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQtCore.so.4 #2 0x0000003a4da781a8 in QSemaphore::tryAcquire(int, int) () from /lib64/libQtCore.so.4 #3 0x00000032de0dd02a in KisTileDataSwapper::run() () from /lib64/libkritaimage.so.11 #4 0x0000003a4da7b95c in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4 #5 0x0000003a44207d15 in start_thread () from /lib64/libpthread.so.0 #6 0x0000003a43af248d in clone () from /lib64/libc.so.6 Thread 4 (Thread 0x7f849d5c5700 (LWP 6410)): #0 0x0000003a4420b5e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x0000003a4da7bebb in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQtCore.so.4 #2 0x0000003fcccb5fa6 in QFileInfoGatherer::run() () from /lib64/libQtGui.so.4 #3 0x0000003a4da7b95c in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4 #4 0x0000003a44207d15 in start_thread () from /lib64/libpthread.so.0 #5 0x0000003a43af248d in clone () from /lib64/libc.so.6 Thread 3 (Thread 0x7f849cd03700 (LWP 6411)): #0 0x0000003a43aeb7b3 in select () from /lib64/libc.so.6 #1 0x0000003a4dba3143 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /lib64/libQtCore.so.4 #2 0x0000003a4dba7e39 in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /lib64/libQtCore.so.4 #3 0x0000003a4dba8902 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #4 0x0000003a4db765ef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #5 0x0000003a4db76878 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #6 0x0000003a4da78980 in QThread::exec() () from /lib64/libQtCore.so.4 #7 0x0000003a4db56e1f in QInotifyFileSystemWatcherEngine::run() () from /lib64/libQtCore.so.4 #8 0x0000003a4da7b95c in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4 #9 0x0000003a44207d15 in start_thread () from /lib64/libpthread.so.0 #10 0x0000003a43af248d in clone () from /lib64/libc.so.6 Thread 2 (Thread 0x7f849e5c7700 (LWP 6416)): #0 0x0000003a43aeb7b3 in select () from /lib64/libc.so.6 #1 0x0000003a4dba3143 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /lib64/libQtCore.so.4 #2 0x0000003a4dba7e39 in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /lib64/libQtCore.so.4 #3 0x0000003a4dba8902 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #4 0x0000003a4db765ef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #5 0x0000003a4db76878 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #6 0x0000003a4da78980 in QThread::exec() () from /lib64/libQtCore.so.4 #7 0x0000003a4db56e1f in QInotifyFileSystemWatcherEngine::run() () from /lib64/libQtCore.so.4 #8 0x0000003a4da7b95c in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4 #9 0x0000003a44207d15 in start_thread () from /lib64/libpthread.so.0 #10 0x0000003a43af248d in clone () from /lib64/libc.so.6 Thread 1 (Thread 0x7f84b0c31880 (LWP 6398)): [KCrash Handler] #5 0x00000032d55077e4 in void qDeleteAll<QHash<QString, KArchiveEntry*>::const_iterator>(QHash<QString, KArchiveEntry*>::const_iterator, QHash<QString, KArchiveEntry*>::const_iterator) () from /lib64/libkdecore.so.5 #6 0x00000032d5505dd1 in KArchiveDirectory::~KArchiveDirectory() () from /lib64/libkdecore.so.5 #7 0x00000032d5505e39 in KArchiveDirectory::~KArchiveDirectory() () from /lib64/libkdecore.so.5 #8 0x00000032d5504daa in KArchive::close() () from /lib64/libkdecore.so.5 #9 0x00000032dac8538b in KoDocument::saveNativeFormatCalligra(KoStore*) () from /lib64/libkomain.so.11 #10 0x00000032dac906ab in KoDocument::saveNativeFormat(QString const&) () from /lib64/libkomain.so.11 #11 0x00000032dac89a6f in KoDocument::saveFile() () from /lib64/libkomain.so.11 #12 0x00000032dad20b74 in KoPart::saveFile() () from /lib64/libkomain.so.11 #13 0x00000032d782798c in KParts::ReadWritePart::save() () from /lib64/libkparts.so.4 #14 0x00000032dacb81f8 in KoMainWindow::saveDocument(bool, bool) () from /lib64/libkomain.so.11 #15 0x00000032dacba05d in KoMainWindow::slotFileSave() () from /lib64/libkomain.so.11 #16 0x00000032dacbe2a9 in KoMainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /lib64/libkomain.so.11 #17 0x0000003a4db8cd6f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4 #18 0x0000003fcc7c4412 in QAction::triggered(bool) () from /lib64/libQtGui.so.4 #19 0x0000003fcc7c4600 in QAction::activate(QAction::ActionEvent) () from /lib64/libQtGui.so.4 #20 0x0000003fccb8424f in QAbstractButtonPrivate::click() () from /lib64/libQtGui.so.4 #21 0x0000003fccb844fc in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /lib64/libQtGui.so.4 #22 0x0000003fccc3e78a in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /lib64/libQtGui.so.4 #23 0x0000003fcc819f49 in QWidget::event(QEvent*) () from /lib64/libQtGui.so.4 #24 0x0000003fcc7ca5cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #25 0x0000003fcc7cf2ab in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #26 0x00000032dac79248 in KoApplication::notify(QObject*, QEvent*) () from /lib64/libkomain.so.11 #27 0x0000003a4db7793e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4 #28 0x0000003fcc7cb40b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /lib64/libQtGui.so.4 #29 0x0000003fcc845b74 in QETWidget::translateMouseEvent(_XEvent const*) () from /lib64/libQtGui.so.4 #30 0x0000003fcc844901 in QApplication::x11ProcessEvent(_XEvent*) () from /lib64/libQtGui.so.4 #31 0x0000003fcc86b4f9 in QEventDispatcherX11::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtGui.so.4 #32 0x0000003a4db765ef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #33 0x0000003a4db76878 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #34 0x0000003a4db7b708 in QCoreApplication::exec() () from /lib64/libQtCore.so.4 #35 0x00000032dd3e6572 in kdemain () from /lib64/libkdeinit4_krita.so #36 0x0000003a43a21a05 in __libc_start_main () from /lib64/libc.so.6 #37 0x00000000004009b1 in _start () Reported using DrKonqi
Created attachment 80499 [details] The problematic Kra file
> #6 0x00000032d5505dd1 in KArchiveDirectory::~KArchiveDirectory() () from /lib64/libkdecore.so.5 Please install debug symbols and try to provide a better backtrace.
Created attachment 80511 [details] A new Kcrash file Is this useful or I have to reproduce the bug again? I installed the debug symbols, but I don't know if bugtrace is refreshed.
Hi Eduardo, Thanks for your report. I haven't been able to actually reproduce the crash. I have seen one other bug report with the same backtrace, I think, but I cannot find it at the moment :-( But looking at the code/git log for karchive.cpp, I see: commit 12280e1ab1fe53550b086b260b0a94fc6feb603b Author: Lamarque V. Souza <lamarque@kde.org> Date: Tue Jul 3 22:36:54 2012 -0300 Avoid double delete in KArchive::close. Which looks exactly like the issue here. My suspicion is that this bug is in kdelibs, not krita, and that it is fixed in the next point release of KDE 4.10.
Well, if that commit is from July 2012, then it should have been in all 4.10 releases. Maybe related to the qDeleteAll() behavior change issue?
Hm... You have to remind me what that issue was again, my mind is turning up a blank here.
Boudewijn, since Qt 4.8, you are no longer allowed to do this: QList<Foo *> list; qDeleteAll(list); while _also_ in Foo::~Foo() removing itself from the same list (or doing any other modifications of the list). It is possible that KArchive does exactly that.
*** Bug 322352 has been marked as a duplicate of this bug. ***
Yes, that looks like the issue.
Hello, I can reproduce this bug like clockwork on linux mint MATE: make a new layer, remove the layer, save and *poof* Fortunately the crash happens after the save is complete (when I open the file the changes are still there), but it makes it very difficult to get any painting done! I just wanted to confirm that this is a consistent bug that is effecting multiple users (I noticed the status is unconfirmed). But more importantly I wanted to offer a workaround for users finding this happening to them. One is to not save in the .kra filetype, but if you are using Krita specific features or multiple layers that might not be an option. The other option is to always save with 'save as' and never 'save'. However, if you're like me, you have 'ctrl+s' built very strongly into your automatic muscle memory, so I recommend going into 'settings>>configure shortcuts' then search for 'save as', set it to 'ctrl+s' and confirm. When this bug is fixed you can change it back, but in the meantime you can save using 'ctrl+s' without a crash (just have to click save in the dialog that pops up, which isn't much hassle) I'm going to go out on a limb and guess that this works because 'save as' creates a whole new file from scratch, while 'save' alters the existing file and runs into some kind of indexing error as mentioned above... am I close? :)
that sounds like a good guess, but it doesn't seem to be the case. I can reproduce on *buntu, but not opensuse, so I guess the bug also needs to be reported upstream.
Hmmm... I should add that I was about halfway through my painting before this problem even started, although it has happened to me intermittently before (even previous versions of krita). This time it started and hasn't stopped, although about 1/20 tries results in a success for no apparent reason (same action exactly). Also, if I open a file and 'save' first thing it usually works, I can keep clicking save with no problem. But as soon as I make a new layer and 'save' it crashes *95% of the time* :) I guess the bug isn't as logical as I hoped... darn! Oh well, atleast I have my workaround. You guys are doing an awesome job with this software by the way, it's amazing! Those nested groups and erase layers are pure gold...
*** Bug 325153 has been marked as a duplicate of this bug. ***
*** Bug 325522 has been marked as a duplicate of this bug. ***
*** Bug 325632 has been marked as a duplicate of this bug. ***
Created attachment 83085 [details] New crash information added by DrKonqi krita (2.7.1) on KDE Platform 4.11.2 using Qt 4.8.2 - What I was doing when the application crashed: I save my work in KRA format and it crash. Dosen't matter how many layers or the combination it crash once among X number of saves. -- Backtrace (Reduced): #7 0x00007f99c28539c7 in qDeleteAll<QHash<QString, KArchiveEntry*>::const_iterator> (end=..., begin=...) at /usr/include/qt4/QtCore/qalgorithms.h:322 #8 qDeleteAll<QHash<QString, KArchiveEntry*> > (c=...) at /usr/include/qt4/QtCore/qalgorithms.h:330 #9 ~KArchiveDirectoryPrivate (this=0x7630580, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:697 #10 KArchiveDirectory::~KArchiveDirectory (this=0x98873c0, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:713 #11 0x00007f99c2853a29 in KArchiveDirectory::~KArchiveDirectory (this=0x98873c0, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:714
Created attachment 83189 [details] New crash information added by DrKonqi krita (2.7.1) on KDE Platform 4.11.2 using Qt 4.8.2 - What I was doing when the application crashed: Saving my work in KRA format with layers, but just outline work no colors or FX. -- Backtrace (Reduced): #7 0x00007f8f8873a9c7 in qDeleteAll<QHash<QString, KArchiveEntry*>::const_iterator> (end=..., begin=...) at /usr/include/qt4/QtCore/qalgorithms.h:322 #8 qDeleteAll<QHash<QString, KArchiveEntry*> > (c=...) at /usr/include/qt4/QtCore/qalgorithms.h:330 #9 ~KArchiveDirectoryPrivate (this=0x4c8f8e0, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:697 #10 KArchiveDirectory::~KArchiveDirectory (this=0x6d99e80, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:713 #11 0x00007f8f8873aa29 in KArchiveDirectory::~KArchiveDirectory (this=0x6d99e80, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:714
Created attachment 83207 [details] New crash information added by DrKonqi krita (2.7.1) on KDE Platform 4.11.2 using Qt 4.8.2 - What I was doing when the application crashed: Tracing a mask selection, then Krita chrashed. -- Backtrace (Reduced): #7 0x00007fac8d76c9c7 in qDeleteAll<QHash<QString, KArchiveEntry*>::const_iterator> (end=..., begin=...) at /usr/include/qt4/QtCore/qalgorithms.h:322 #8 qDeleteAll<QHash<QString, KArchiveEntry*> > (c=...) at /usr/include/qt4/QtCore/qalgorithms.h:330 #9 ~KArchiveDirectoryPrivate (this=0x5260680, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:697 #10 KArchiveDirectory::~KArchiveDirectory (this=0x5b7e330, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:713 #11 0x00007fac8d76ca29 in KArchiveDirectory::~KArchiveDirectory (this=0x5b7e330, __in_chrg=<optimized out>) at ../../kdecore/io/karchive.cpp:714
*** Bug 327397 has been marked as a duplicate of this bug. ***
The only place where I could reproduce this issue was on Windows, where I use the following patch to avoid the crash. I haven't been able to reproduce on Linux :-( diff --git a/kdecore/io/karchive.cpp b/kdecore/io/karchive.cpp index 88e1de0..a2cff49 100644 --- a/kdecore/io/karchive.cpp +++ b/kdecore/io/karchive.cpp @@ -694,7 +694,10 @@ class KArchiveDirectoryPrivate public: ~KArchiveDirectoryPrivate() { - qDeleteAll(entries); + foreach(KArchiveEntry *entry, entries.values()) { + delete entry; + } + entries.clear(); } QHash<QString, KArchiveEntry *> entries; }; lines 1-16/16 (END)
Created attachment 83515 [details] New crash information added by DrKonqi krita (2.7.2) on KDE Platform 4.11.2 using Qt 4.8.4 - What I was doing when the application crashed: I was saving under .kra format. It crashes at each saving. The saved file is OK (not corrupted). -- Backtrace (Reduced): #6 0x00007f3f38c883df in KArchiveDirectory::~KArchiveDirectory() () from /usr/lib/libkdecore.so.5 #7 0x00007f3f38c88449 in KArchiveDirectory::~KArchiveDirectory() () from /usr/lib/libkdecore.so.5 #8 0x00007f3f38c88848 in KArchive::close() () from /usr/lib/libkdecore.so.5 #9 0x00007f3f3a3bab5c in KoDocument::saveNativeFormatCalligra(KoStore*) () from /usr/lib/libkomain.so.12 #10 0x00007f3f3a3bc12b in KoDocument::saveNativeFormat(QString const&) () from /usr/lib/libkomain.so.12
Boudewijn, could you create a review request for comment #20 ? I am not sure the patch is entirely correct, but we should get something like this into 4.11.4. Our fellow developers on k-c-d might remember the issue and the correct code.
Git commit 2986e095a607e1319e68939aa92c5bae32ce73e1 by Friedrich W. H. Kossebau. Committed on 22/11/2013 at 10:20. Pushed by kossebau into branch 'master'. Don't write the implicitely written "mimetype" entry a 2nd time on saving kra files (and thus avoid assumed bug in KZip) REVIEW: 114016 thanks boud for review M +0 -7 krita/ui/kra/kis_kra_saver.cpp http://commits.kde.org/calligra/2986e095a607e1319e68939aa92c5bae32ce73e1
Git commit 282749e063a9bbd93956400ba4548a8af6829f73 by Boudewijn Rempt, on behalf of Friedrich W. H. Kossebau. Committed on 22/11/2013 at 10:20. Pushed by rempt into branch 'calligra/2.7'. Don't write the implicitely written "mimetype" entry a 2nd time on saving kra files (and thus avoid assumed bug in KZip) REVIEW: 114016 thanks boud for review M +0 -7 krita/ui/kra/kis_kra_saver.cpp http://commits.kde.org/calligra/282749e063a9bbd93956400ba4548a8af6829f73
Git commit fa0be8a39623b3bc18454895b4008440f6e4ed0d by Friedrich W. H. Kossebau. Committed on 28/11/2013 at 01:03. Pushed by kossebau into branch 'KDE/4.11'. fix crash in KZip on overwriting existing entries (+ unit test) REVIEW: 114048 thanks Albert for review M +21 -0 kdecore/io/karchive.cpp M +6 -0 kdecore/io/karchive.h M +19 -16 kdecore/io/kzip.cpp M +29 -0 kdecore/tests/karchivetest.cpp M +1 -0 kdecore/tests/karchivetest.h http://commits.kde.org/kdelibs/fa0be8a39623b3bc18454895b4008440f6e4ed0d
*** Bug 328882 has been marked as a duplicate of this bug. ***
*** Bug 329080 has been marked as a duplicate of this bug. ***
*** Bug 335298 has been marked as a duplicate of this bug. ***