Application: krita () (Compiled from sources) Qt Version: 5.6.0 Frameworks Version: 5.21.0 Operating System: Linux 4.5.4-1-default x86_64 Distribution: "openSUSE Tumbleweed (20160517) (x86_64)" -- Information about the crash: - What I was doing when the application crashed: I had opened a PDF file, picking only first page for the image. Painted some stroke with the default brush over the image. Had Krita window in the background while doing something else. Boom after a few minutes, first autosave trigger it seems. PDF file itself had writing rights for the user. Happened on git 63e5e2efc5e05dac95e59be3690a5bb90f258d4f (May 19th 2016) -- Backtrace: Application: krita (krita), signal: Aborted Using host libthread_db library "/lib64/libthread_db.so.1". [Current thread is 1 (Thread 0x7f1280e75900 (LWP 18852))] Thread 9 (Thread 0x7f125e413700 (LWP 18854)): #0 0x00007f1274f2c03f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f126987c5c3 in () at /usr/lib64/dri/swrast_dri.so #2 0x00007f126987c447 in () at /usr/lib64/dri/swrast_dri.so #3 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #4 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 8 (Thread 0x7f125dc12700 (LWP 18855)): #0 0x00007f1274f2c03f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f126987c5c3 in () at /usr/lib64/dri/swrast_dri.so #2 0x00007f126987c447 in () at /usr/lib64/dri/swrast_dri.so #3 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #4 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 7 (Thread 0x7f125d411700 (LWP 18856)): #0 0x00007f1274f2c03f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f126987c5c3 in () at /usr/lib64/dri/swrast_dri.so #2 0x00007f126987c447 in () at /usr/lib64/dri/swrast_dri.so #3 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #4 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 6 (Thread 0x7f125cc10700 (LWP 18857)): #0 0x00007f1274f2c03f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f126987c5c3 in () at /usr/lib64/dri/swrast_dri.so #2 0x00007f126987c447 in () at /usr/lib64/dri/swrast_dri.so #3 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #4 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 5 (Thread 0x7f12584fa700 (LWP 18858)): #0 0x00007f1278fdb408 in QMutex::unlock() () at /usr/lib64/libQt5Core.so.5 #1 0x00007f12791f832d in () at /usr/lib64/libQt5Core.so.5 #2 0x00007f1273a35a1d in g_main_context_prepare () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f1273a36323 in () at /usr/lib64/libglib-2.0.so.0 #4 0x00007f1273a364fc in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #5 0x00007f12791f8c5b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #6 0x00007f12791a479a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #7 0x00007f1278fddf2c in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #8 0x00007f12748737b5 in () at /usr/lib64/libQt5DBus.so.5 #9 0x00007f1278fe2b29 in () at /usr/lib64/libQt5Core.so.5 #10 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #11 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 4 (Thread 0x7f1246591700 (LWP 18864)): #0 0x00007f1274f2c03f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f1278fe38bb in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQt5Core.so.5 #2 0x00007f1278fdcceb in QSemaphore::acquire(int) () at /usr/lib64/libQt5Core.so.5 #3 0x00007f127f63ad90 in KisTileDataPooler::waitForWork() (this=0x7f127fc1ef60 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/image/tiles3/kis_tile_data_pooler.cc:165 #4 0x00007f127f63ae38 in KisTileDataPooler::run() (this=0x7f127fc1ef60 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/image/tiles3/kis_tile_data_pooler.cc:187 #5 0x00007f1278fe2b29 in () at /usr/lib64/libQt5Core.so.5 #6 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #7 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 3 (Thread 0x7f1245d90700 (LWP 18865)): #0 0x00007f1274f2c03f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f1278fe38bb in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQt5Core.so.5 #2 0x00007f1278fdcf86 in QSemaphore::tryAcquire(int, int) () at /usr/lib64/libQt5Core.so.5 #3 0x00007f127f65b134 in KisTileDataSwapper::waitForWork() (this=0x7f127fc1efa0 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:86 #4 0x00007f127f65b150 in KisTileDataSwapper::run() (this=0x7f127fc1efa0 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:92 #5 0x00007f1278fe2b29 in () at /usr/lib64/libQt5Core.so.5 #6 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #7 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 2 (Thread 0x7f124518e700 (LWP 18866)): #0 0x00007f1274f2c03f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f1278fe38bb in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQt5Core.so.5 #2 0x00007f127a0e19d2 in () at /usr/lib64/libQt5Widgets.so.5 #3 0x00007f1278fe2b29 in () at /usr/lib64/libQt5Core.so.5 #4 0x00007f1274f26424 in start_thread () at /lib64/libpthread.so.0 #5 0x00007f12783daadd in clone () at /lib64/libc.so.6 Thread 1 (Thread 0x7f1280e75900 (LWP 18852)): [KCrash Handler] #4 0x00007f12783269e8 in raise () at /lib64/libc.so.6 #5 0x00007f1278327e3a in abort () at /lib64/libc.so.6 #6 0x00007f1278fcb62e in () at /usr/lib64/libQt5Core.so.5 #7 0x00007f1278fc6e7e in () at /usr/lib64/libQt5Core.so.5 #8 0x00007f127f758d0b in KisImage::unlock() (this=0x9620510) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/image/kis_image.cc:445 #9 0x00007f1280691ed0 in KisImageBarrierLockAdapterImpl<KisSharedPtr<KisImage> >::~KisImageBarrierLockAdapterImpl() (this=0x7fff540fa8c0, __in_chrg=<optimized out>) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/image/kis_image_barrier_lock_adapter.h:33 #10 0x00007f1280691b23 in KisDocument::Private::SafeSavingLocker::~SafeSavingLocker() (this=0x7fff540fa8b0, __in_chrg=<optimized out>) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/ui/KisDocument.cpp:471 #11 0x00007f128068450b in KisDocument::saveNativeFormat(QString const&) (this=0x9540770, file=...) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/ui/KisDocument.cpp:890 #12 0x00007f1280683bf7 in KisDocument::slotAutoSave() (this=0x9540770) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/ui/KisDocument.cpp:842 #13 0x00007f128074579a in KisDocument::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x9540770, _c=QMetaObject::InvokeMetaMethod, _id=18, _a=0x7fff540faba0) at /home/koder/Kode/kdegit/build/kf5/calligra/krita/libs/ui/moc_KisDocument.cpp:180 #14 0x00007f12791d17a0 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib64/libQt5Core.so.5 #15 0x00007f12791dd828 in QTimer::timerEvent(QTimerEvent*) () at /usr/lib64/libQt5Core.so.5 #16 0x00007f12791d250b in QObject::event(QEvent*) () at /usr/lib64/libQt5Core.so.5 #17 0x00007f1279ec891c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5 #18 0x00007f1279ecd7d6 in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5 #19 0x00007f1280678c39 in KisApplication::notify(QObject*, QEvent*) (this=0x7fff540fb2e0, receiver=0x95651d0, event=0x7fff540fafe0) at /home/koder/Kode/kdegit/kf5/calligra/krita/libs/ui/KisApplication.cpp:493 #20 0x00007f12791a68b8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5 #21 0x00007f12791f7bbe in QTimerInfoList::activateTimers() () at /usr/lib64/libQt5Core.so.5 #22 0x00007f12791f8101 in () at /usr/lib64/libQt5Core.so.5 #23 0x00007f1273a36227 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #24 0x00007f1273a36458 in () at /usr/lib64/libglib-2.0.so.0 #25 0x00007f1273a364fc in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #26 0x00007f12791f8c3f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #27 0x00007f12791a479a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #28 0x00007f12791aca6d in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5 #29 0x000000000040927d in main(int, char**) (argc=1, argv=0x7fff540fb8b8) at /home/koder/Kode/kdegit/kf5/calligra/krita/krita/main.cc:231 Reported using DrKonqi
Seems I am the only one running Krita as "debug" build since May 6th, to hit asserts? :) Not sure given I have no real experience with lock systems. The crash I hit was due to Q_ASSERT(locked()); in KisImage::unlock(). The reason is that KisDocument::Private::SafeSavingLocker uses a member KisImageBarrierLockAdapter m_imageLock. Which it explicitely unlocks again, to keep locking in balance, together with std::try_lock. Just, KisImageBarrierLockAdapter in its deconstructor unconditionally calls unlock on the image, not taking into account any state of other unlock/lock calls. Which seems strange to me (but perhaps that is some pattern in lock code writing?). At least the assert in KisImage::unlock() is expecting else. As Lockable/BasicLockable seem to not require that unlock in the destructor, and the only current usecase of KisImageBarrierLockAdapterImpl explicitely cares for unlocking, this patch here makes the assert happy at least, by no longer doing unbalanced unlock calls: diff --git a/libs/image/kis_image_barrier_lock_adapter.h b/libs/image/kis_image_barrier_lock_adapter.h index 2f949e2..734381a 100644 --- a/libs/image/kis_image_barrier_lock_adapter.h +++ b/libs/image/kis_image_barrier_lock_adapter.h @@ -30,7 +30,6 @@ public: } inline ~KisImageBarrierLockAdapterImpl() { - m_image->unlock(); } inline void lock() { lines 1-12/12 (END)
Git commit 4a3058a511766761cea7a6b796e03f38c301cb12 by Friedrich W. H. Kossebau. Committed on 20/05/2016 at 08:36. Pushed by kossebau into branch 'master'. Fix assert triggered for unbalanced unlock on (auto)save Summary: KisDocument::Private::SafeSavingLocker uses a member KisImageBarrierLockAdapter m_imageLock to do the locking of KisImage. Which it explicitely locks and unlocks again, to keep locking in balance, together with std::try_lock. But KisImageBarrierLockAdapter in its deconstructor unconditionally also calls unlock on the image, without taking into account any state of other unlock/lock calls. Which then triggers the Q_ASSERT(locked()); in KisImage::unlock(). Reviewers: dkazakov, #krita:_next Reviewed By: dkazakov, #krita:_next Differential Revision: https://phabricator.kde.org/D1645 M +0 -1 libs/image/kis_image_barrier_lock_adapter.h http://commits.kde.org/krita/4a3058a511766761cea7a6b796e03f38c301cb12