Bug 305259

Summary: Karbon crashes when inserting a layer
Product: [Applications] karbon Reporter: Halla Rempt <halla>
Component: generalAssignee: Jan Hambrecht <jaham>
Status: RESOLVED FIXED    
Severity: crash CC: pentalis
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Halla Rempt 2012-08-16 13:19:39 UTC
Application: karbon (2.6 Pre-Alpha)
KDE Platform Version: 4.9.00 "release 558"
Qt Version: 4.8.2
Operating System: Linux 3.4.6-1.1-desktop x86_64
Distribution: "openSUSE 12.2 (x86_64)"

-- Information about the crash:
Create a new document, then use the layer docker to create a new layer.

I suspect this is fall-out from the document/view/part split refactoring.

The crash can be reproduced every time.

-- Backtrace:
Application: Karbon (karbon), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f9131b31780 (LWP 18750))]

Thread 2 (Thread 0x7f9111311700 (LWP 18751)):
#0  0x00007f912a73813f in poll () from /lib64/libc.so.6
#1  0x00007f91232dc6d4 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f91232dc7f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f912c5103f6 in QEventDispatcherGlib::processEvents (this=0x7f910c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f912c4e0ebf in QEventLoop::processEvents (this=this@entry=0x7f9111310df0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f912c4e1148 in QEventLoop::exec (this=0x7f9111310df0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f912c3e4ef0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f912c4c189f in QInotifyFileSystemWatcherEngine::run (this=0x17513b0) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f912c3e7e8b in QThreadPrivate::start (arg=0x17513b0) at thread/qthread_unix.cpp:307
#9  0x00007f912c151e0e in start_thread () from /lib64/libpthread.so.0
#10 0x00007f912a7402bd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f9131b31780 (LWP 18750)):
[KCrash Handler]
#5  0x00007f912a690d25 in raise () from /lib64/libc.so.6
#6  0x00007f912a6921a8 in abort () from /lib64/libc.so.6
#7  0x00007f912c3dda54 in qt_message_output (msgType=msgType@entry=QtFatalMsg, buf=<optimized out>) at global/qglobal.cpp:2260
#8  0x00007f912c3ddc08 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, msg=msg@entry=0x7f912c544cc8 "ASSERT: \"%s\" in file %s, line %d", ap=ap@entry=0x7fff0c66a3b8) at global/qglobal.cpp:2306
#9  0x00007f912c3ddd94 in qFatal (msg=msg@entry=0x7f912c544cc8 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2489
#10 0x00007f912c3dddda in qt_assert (assertion=<optimized out>, file=<optimized out>, line=<optimized out>) at global/qglobal.cpp:2007
#11 0x00007f912fe54f88 in KoShapeCreateCommand::redo (this=0x1aec4b0) at /home/boud/kde/src/calligra/libs/flake/commands/KoShapeCreateCommand.cpp:64
#12 0x00007f912f883ddd in KUndo2QStack::push (this=0x18b3730, cmd=0x1aec4b0) at /home/boud/kde/src/calligra/libs/kundo2/kundo2stack.cpp:569
#13 0x00007f9131533855 in KarbonCanvas::addCommand (this=0x2f3b370, command=<optimized out>) at /home/boud/kde/src/calligra/karbon/ui/widgets/KarbonCanvas.cpp:307
#14 0x00007f913152ba54 in KarbonLayerDocker::addLayer (this=0x3ef4210) at /home/boud/kde/src/calligra/karbon/ui/dockers/KarbonLayerDocker.cpp:285
#15 0x00007f912c4f89ff in QMetaObject::activate (sender=0x3ef8ae0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff0c66a730) at kernel/qobject.cpp:3556
#16 0x00007f912ba58ef1 in QButtonGroup::buttonClicked(int) () from /usr/lib64/libQtGui.so.4
#17 0x00007f912b7ad1b7 in ?? () from /usr/lib64/libQtGui.so.4
#18 0x00007f912b7ad9c0 in ?? () from /usr/lib64/libQtGui.so.4
#19 0x00007f912b7adc2c in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQtGui.so.4
#20 0x00007f912b443cb0 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#21 0x00007f912b3f464c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#22 0x00007f912b3f932b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#23 0x00007f9130f5d6f8 in KoApplication::notify (this=<optimized out>, receiver=0x3ef71c0, event=0x7fff0c66afe0) at /home/boud/kde/src/calligra/libs/main/KoApplication.cpp:504
#24 0x00007f912c4e216e in QCoreApplication::notifyInternal (this=0x7fff0c66bba0, receiver=0x3ef71c0, event=0x7fff0c66afe0) at kernel/qcoreapplication.cpp:915
#25 0x00007f912b3f548b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQtGui.so.4
#26 0x00007f912b46fad4 in ?? () from /usr/lib64/libQtGui.so.4
#27 0x00007f912b46e861 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#28 0x00007f912b494b32 in ?? () from /usr/lib64/libQtGui.so.4
#29 0x00007f91232dc405 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#30 0x00007f91232dc738 in ?? () from /usr/lib64/libglib-2.0.so.0
#31 0x00007f91232dc7f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#32 0x00007f912c5103d6 in QEventDispatcherGlib::processEvents (this=0x162aa70, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#33 0x00007f912b4947ae in ?? () from /usr/lib64/libQtGui.so.4
#34 0x00007f912c4e0ebf in QEventLoop::processEvents (this=this@entry=0x7fff0c66bb20, flags=...) at kernel/qeventloop.cpp:149
#35 0x00007f912c4e1148 in QEventLoop::exec (this=0x7fff0c66bb20, flags=...) at kernel/qeventloop.cpp:204
#36 0x00007f912c4e5de8 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#37 0x00007f913175e0d1 in kdemain (argc=<optimized out>, argv=0x7fff0c66bcb8) at /home/boud/kde/src/calligra/karbon/main.cpp:50
#38 0x00007f912a67d455 in __libc_start_main () from /lib64/libc.so.6
#39 0x0000000000400951 in _start () at ../sysdeps/x86_64/elf/start.S:113

Reported using DrKonqi
Comment 1 pentalis 2012-08-19 00:06:51 UTC
Confirmed, with this ASSERT:

karbon(24874)/koffice (lib flake) KoTosContainer::textAlignment: No text shape present in KoTosContainer 
karbon(24874)/koffice (lib flake) KoTosContainer::textAlignment: No text shape present in KoTosContainer 
ASSERT: "d->controller" in file /home/pentalis/GIT_TEMPLE/kde4/source/calligra/libs/flake/commands/KoShapeCreateCommand.cpp, line 64
KCrash: Application 'karbon' crashing...
Comment 2 T Zachmann 2012-09-01 04:52:53 UTC
Git commit bbfda532bc81307c56aa91faa91cd5f3357194b2 by Thorsten Zachmann.
Committed on 01/09/2012 at 06:44.
Pushed by zachmann into branch 'master'.

Fix layerdocker broken by document part split

Make the docker a KoCanvasObserver so it gets triggered when the canvas changes and can
update the used data.
REVIEW: 106210

M  +1    -4    karbon/ui/KarbonView.cpp
M  +27   -20   karbon/ui/dockers/KarbonLayerDocker.cpp
M  +5    -3    karbon/ui/dockers/KarbonLayerDocker.h
M  +5    -0    karbon/ui/widgets/KarbonCanvas.cpp
M  +3    -0    karbon/ui/widgets/KarbonCanvas.h

http://commits.kde.org/calligra/bbfda532bc81307c56aa91faa91cd5f3357194b2