Bug 322000

Summary: save layer with group layer crashes
Product: [Applications] krita Reporter: animtim
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: halla
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description animtim 2013-07-05 16:42:29 UTC
Application: krita (2.8 Pre-Alpha)
KDE Platform Version: 4.10.3 "release 1"
Qt Version: 4.8.4
Operating System: Linux 3.9.8-1.gf3348a8-desktop x86_64
Distribution: "openSUSE 12.3 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:

Use save_layer on a group layer, including 3 painting layers inside it.

The crash can be reproduced every time.

-- Backtrace:
Application: Krita (kdeinit4), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f2f5a42d780 (LWP 23830))]

Thread 6 (Thread 0x7f2f36dc7700 (LWP 23834)):
#0  0x00007f2f58ce3964 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f2f58f7a62b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/libQtCore.so.4
#2  0x00007f2f58f76537 in QSemaphore::acquire(int) () from /usr/lib64/libQtCore.so.4
#3  0x00007f2f468002ce in KisTileDataPooler::waitForWork (this=this@entry=0x3b8ad90) at /home/timo/kde4/src/calligra/krita/image/tiles3/kis_tile_data_pooler.cc:162
#4  0x00007f2f46800a1b in KisTileDataPooler::run (this=0x3b8ad90) at /home/timo/kde4/src/calligra/krita/image/tiles3/kis_tile_data_pooler.cc:184
#5  0x00007f2f58f7a0cc in ?? () from /usr/lib64/libQtCore.so.4
#6  0x00007f2f58cdfe0f in start_thread () from /lib64/libpthread.so.0
#7  0x00007f2f57a507dd in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f2f365c6700 (LWP 23835)):
#0  0x00007f2f58ce3964 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f2f58f7a62b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/libQtCore.so.4
#2  0x00007f2f58f76908 in QSemaphore::tryAcquire(int, int) () from /usr/lib64/libQtCore.so.4
#3  0x00007f2f4681e08a in KisTileDataSwapper::run (this=0x3b8adc8) at /home/timo/kde4/src/calligra/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#4  0x00007f2f58f7a0cc in ?? () from /usr/lib64/libQtCore.so.4
#5  0x00007f2f58cdfe0f in start_thread () from /lib64/libpthread.so.0
#6  0x00007f2f57a507dd in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f2f2f7fe700 (LWP 23840)):
#0  0x00007f2f57a49623 in select () from /lib64/libc.so.6
#1  0x00007f2f590a16f3 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib64/libQtCore.so.4
#2  0x00007f2f590a6189 in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /usr/lib64/libQtCore.so.4
#3  0x00007f2f590a7252 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#4  0x00007f2f59074adf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#5  0x00007f2f59074d68 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#6  0x00007f2f58f770f0 in QThread::exec() () from /usr/lib64/libQtCore.so.4
#7  0x00007f2f5905529f in ?? () from /usr/lib64/libQtCore.so.4
#8  0x00007f2f58f7a0cc in ?? () from /usr/lib64/libQtCore.so.4
#9  0x00007f2f58cdfe0f in start_thread () from /lib64/libpthread.so.0
#10 0x00007f2f57a507dd in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f2f13d2f700 (LWP 23873)):
#0  0x00007f2f58ce3964 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f2f58f7a62b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/libQtCore.so.4
#2  0x00007f2f586ea4d6 in ?? () from /usr/lib64/libQtGui.so.4
#3  0x00007f2f58f7a0cc in ?? () from /usr/lib64/libQtCore.so.4
#4  0x00007f2f58cdfe0f in start_thread () from /lib64/libpthread.so.0
#5  0x00007f2f57a507dd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f2f2e7fc700 (LWP 23874)):
#0  0x00007f2f57a49623 in select () from /lib64/libc.so.6
#1  0x00007f2f590a16f3 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib64/libQtCore.so.4
#2  0x00007f2f590a6189 in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) () from /usr/lib64/libQtCore.so.4
#3  0x00007f2f590a7252 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#4  0x00007f2f59074adf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#5  0x00007f2f59074d68 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#6  0x00007f2f58f770f0 in QThread::exec() () from /usr/lib64/libQtCore.so.4
#7  0x00007f2f5905529f in ?? () from /usr/lib64/libQtCore.so.4
#8  0x00007f2f58f7a0cc in ?? () from /usr/lib64/libQtCore.so.4
#9  0x00007f2f58cdfe0f in start_thread () from /lib64/libpthread.so.0
#10 0x00007f2f57a507dd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f2f5a42d780 (LWP 23830)):
[KCrash Handler]
#5  KisNodeManager::saveNodeAsImage (this=<optimized out>) at /home/timo/kde4/src/calligra/krita/ui/kis_node_manager.cpp:787
#6  0x00007f2f46dc036e in KisNodeManager::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /home/timo/kde4/build/calligra/krita/ui/kis_node_manager.moc:140
#7  0x00007f2f5908b29f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#8  0x00007f2f581f8662 in QAction::triggered(bool) () from /usr/lib64/libQtGui.so.4
#9  0x00007f2f581f8850 in QAction::activate(QAction::ActionEvent) () from /usr/lib64/libQtGui.so.4
#10 0x00007f2f586326e3 in ?? () from /usr/lib64/libQtGui.so.4
#11 0x00007f2f58638ac9 in ?? () from /usr/lib64/libQtGui.so.4
#12 0x00007f2f59edd1e0 in KMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libkdeui.so.5
#13 0x00007f2f5824e149 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#14 0x00007f2f58639d7b in QMenu::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#15 0x00007f2f581fe86c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#16 0x00007f2f5820354b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#17 0x00007f2f464357f8 in KoApplication::notify (this=<optimized out>, receiver=0x2b33a200, event=0x7fff05175150) at /home/timo/kde4/src/calligra/libs/main/KoApplication.cpp:556
#18 0x00007f2f59075d8e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#19 0x00007f2f581ff6ab in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQtGui.so.4
#20 0x00007f2f58279d5c in ?? () from /usr/lib64/libQtGui.so.4
#21 0x00007f2f58278c21 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#22 0x00007f2f5829f9d9 in ?? () from /usr/lib64/libQtGui.so.4
#23 0x00007f2f59074adf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#24 0x00007f2f59074d68 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#25 0x00007f2f59079a08 in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#26 0x00007f2f473db732 in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/timo/kde4/src/calligra/krita/main.cc:79
#27 0x000000000040889a in _start ()

Reported using DrKonqi
Comment 1 Halla Rempt 2013-07-20 10:05:07 UTC
Hi Timothee,

Thanks for the report! I can confirm the bug. 

krita(20424): couldn't create slave: "Unable to create io-slave:
klauncher said: Unknown protocol ''.
" 
krita(20424)/koffice (lib komain) KoOdfReadStore::loadAndParse: File "/home/boud/kde/master/share/apps/calligra/styles/markers.xml"  loaded and parsed
krita(20424)/koffice (lib komain) KoOdfStylesReader::createStyleMap: Starting reading in office:styles
krita(20424): "[
0: /usr/lib64/libkdecore.so.5(kRealBacktrace(int)+0x38) [0x7f1e5a1b71e8]
1: /home/boud/kde/inst/lib64/libkritaui.so.13(+0x292e9d) [0x7f1e61940e9d]
2: /home/boud/kde/inst/lib64/libkritaui.so.13(KisNodeManager::saveNodeAsImage()+0x3bf) [0x7f1e6196468f]
3: /home/boud/kde/inst/lib64/libkritaui.so.13(+0x2b7443) [0x7f1e61965443]
4: /usr/lib64/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x2bf) [0x7f1e621e029f]
5: /usr/lib64/libQtGui.so.4(QAction::triggered(bool)+0x32) [0x7f1e5a9ad662]
6: /usr/lib64/libQtGui.so.4(QAction::activate(QAction::ActionEvent)+0x70) [0x7f1e5a9ad850]
7: /usr/lib64/libQtGui.so.4(+0x6126e3) [0x7f1e5ade76e3]
8: /usr/lib64/libQtGui.so.4(+0x618ac9) [0x7f1e5adedac9]
9: /usr/lib64/libkdeui.so.5(KMenu::mouseReleaseEvent(QMouseEvent*)+0x50) [0x7f1e5b77e030]
10: /usr/lib64/libQtGui.so.4(QWidget::event(QEvent*)+0x929) [0x7f1e5aa03149]
11: /usr/lib64/libQtGui.so.4(QMenu::event(QEvent*)+0x5b) [0x7f1e5adeed7b]
12: /usr/lib64/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0xac) [0x7f1e5a9b386c]
13: /usr/lib64/libQtGui.so.4(QApplication::notify(QObject*, QEvent*)+0x99b) [0x7f1e5a9b854b]
14: /home/boud/kde/inst/lib64/libkomain.so.13(KoApplication::notify(QObject*, QEvent*)+0x28) [0x7f1e60da9ed8]
15: /usr/lib64/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, QEvent*)+0x8e) [0x7f1e621cad8e]
16: /usr/lib64/libQtGui.so.4(QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)+0x14b) [0x7f1e5a9b46ab]
17: /usr/lib64/libQtGui.so.4(+0x259d5c) [0x7f1e5aa2ed5c]
18: /usr/lib64/libQtGui.so.4(QApplication::x11ProcessEvent(_XEvent*)+0xb11) [0x7f1e5aa2dc21]
19: /usr/lib64/libQtGui.so.4(+0x27f9d9) [0x7f1e5aa549d9]
20: /usr/lib64/libQtCore.so.4(QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x2f) [0x7f1e621c9adf]
21: /usr/lib64/libQtCore.so.4(QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+0x138) [0x7f1e621c9d68]
22: /usr/lib64/libQtCore.so.4(QCoreApplication::exec()+0x88) [0x7f1e621cea08]
23: /home/boud/kde/inst/lib64/libkdeinit4_krita.so(kdemain+0x212) [0x7f1e62765742]
24: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f1e5928fa15]
25: krita() [0x400a21]
]
" 
ASSERT: "d" in file /home/boud/kde/src/calligra/krita/image/kis_shared_ptr.h, line 181
Comment 2 Halla Rempt 2013-07-20 12:05:19 UTC
Git commit 39b91df8e2f8ffe7b035d4ed4db8e12ab3cc8a8a by Boudewijn Rempt.
Committed on 20/07/2013 at 10:47.
Pushed by rempt into branch 'master'.

Do not crash when saving a groupd as an image

M  +11   -2    krita/ui/kis_node_manager.cpp

http://commits.kde.org/calligra/39b91df8e2f8ffe7b035d4ed4db8e12ab3cc8a8a