Bug 282462

Summary: Calligra Words crash when exiting
Product: [Applications] calligrawords Reporter: Thomas Fischer <fischer>
Component: generalAssignee: Calligra Words Bugs <calligra-words-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: jcmoutinho60, lassi.ta.nieminen, sebsauer, skaumo
Priority: NOR    
Version: 2.4-snapshots   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi

Description Thomas Fischer 2011-09-21 09:01:21 UTC
Version:           2.4-snapshots (using KDE 4.6.5) 
OS:                Linux

Whenever I exit Calligra Words Beta 1, it crashes with blow backtrace. I does not matter if I actually work with Words or just start and exit.


Reproducible: Always

Steps to Reproduce:
Start and exit Calligra.

Actual Results:  
Crash

Expected Results:  
No Crash

Application: Words (kdeinit4), signal: Segmentation fault
[Current thread is 1 (Thread 0xb587f710 (LWP 8185))]

Thread 2 (Thread 0xad36ab70 (LWP 8198)):
#0  0xb5b48f87 in clock_gettime () from /lib/librt.so.1
#1  0xb6d8ebf7 in do_gettime () at tools/qelapsedtimer_unix.cpp:123
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#3  0xb6e688b6 in QTimerInfoList::updateCurrentTime (this=0x98ce734) at kernel/qeventdispatcher_unix.cpp:339
#4  0xb6e68b9c in QTimerInfoList::timerWait (this=0x98ce734, tm=...) at kernel/qeventdispatcher_unix.cpp:442
#5  0xb6e66da5 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xad36a0ac) at kernel/qeventdispatcher_glib.cpp:136
#6  0xb6e66e2f in timerSourcePrepare (source=0x0, timeout=0xb5b4cff4) at kernel/qeventdispatcher_glib.cpp:169
#7  0xb5a8d280 in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#8  0xb5a8d6b4 in ?? () from /usr/lib/libglib-2.0.so.0
#9  0xb5a8dc3d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#10 0xb6e66bdb in QEventDispatcherGlib::processEvents (this=0x9892010, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#11 0xb6e355ff in QEventLoop::processEvents (this=0xad36a280, flags=) at kernel/qeventloop.cpp:149
#12 0xb6e35a25 in QEventLoop::exec (this=0xad36a280, flags=...) at kernel/qeventloop.cpp:201
#13 0xb6d2f5f9 in QThread::exec (this=0x986f848) at thread/qthread.cpp:492
#14 0xb6e12ff2 in QInotifyFileSystemWatcherEngine::run (this=0x986f848) at io/qfilesystemwatcher_inotify.cpp:248
#15 0xb6d32427 in QThreadPrivate::start (arg=0x986f848) at thread/qthread_unix.cpp:320
#16 0xb6cb4b4c in start_thread () from /lib/libpthread.so.0
#17 0xb601194e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb587f710 (LWP 8185)):
[KCrash Handler]
#7  QObject::~QObject (this=0xa5d2788, __in_chrg=<value optimized out>) at kernel/qobject.cpp:821
#8  0xb11f649e in qDeleteAll<QList<QWidget*>::const_iterator> (this=0x9fc80e0, __in_chrg=<value optimized out>) at /usr/include/qt4/QtCore/qalgorithms.h:322
#9  qDeleteAll<QList<QWidget*> > (this=0x9fc80e0, __in_chrg=<value optimized out>) at /usr/include/qt4/QtCore/qalgorithms.h:330
#10 ~KoToolBasePrivate (this=0x9fc80e0, __in_chrg=<value optimized out>) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/libs/flake/KoToolBase_p.h:57
#11 KoToolBase::~KoToolBase (this=0x9fc80e0, __in_chrg=<value optimized out>) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/libs/flake/KoToolBase.cpp:62
#12 0xada1f257 in TextTool::~TextTool (this=0x9fc80e0, __in_chrg=<value optimized out>) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/plugins/textshape/TextTool.cpp:550
#13 0xb1209e90 in KoToolManager::Private::detachCanvas (this=0x9f98590, controller=0x9fb94fc) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/libs/flake/KoToolManager.cpp:456
#14 0xb120a5d4 in KoToolManager::removeCanvasController (this=0x9f708b8, controller=0x9fb94fc) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/libs/flake/KoToolManager.cpp:831
#15 0xaeb95db3 in KWGui::~KWGui (this=0x9fb9218, __in_chrg=<value optimized out>) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/words/part/KWGui.cpp:109
#16 0xb6e49bfb in QObjectPrivate::deleteChildren (this=0x9be8598) at kernel/qobject.cpp:1955
#17 0xb632edd2 in QWidget::~QWidget (this=0x9c86ef8, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1631
#18 0xb15eb341 in KoView::~KoView (this=0x9c86ef8, __vtt_parm=0xaec02284, __in_chrg=<value optimized out>) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/libs/main/KoView.cpp:206
#19 0xaeb995aa in KWView::~KWView (this=0x9c86ef8, __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/words/part/KWView.cpp:197
#20 0xb15c2eb2 in KoMainWindow::setRootDocument (this=0x96ad038, doc=0x0) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/libs/main/KoMainWindow.cpp:500
#21 0xb15c596a in KoMainWindow::slotFileClose (this=0x96ad038) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/libs/main/KoMainWindow.cpp:1288
#22 0xb15c9c60 in KoMainWindow::qt_metacall (this=0x96ad038, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=0xbfdbe858) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81_build/libs/main/KoMainWindow.moc:157
#23 0xb6e3e093 in QMetaObject::metacall (object=0x96ad038, cl=QMetaObject::InvokeMetaMethod, idx=66, argv=0xbfdbe858) at kernel/qmetaobject.cpp:237
#24 0xb6e51460 in QMetaObject::activate (sender=0x97a6518, m=0xb6c8f858, local_signal_index=1, argv=0xb6f6f088) at kernel/qobject.cpp:3278
#25 0xb62bf1b2 in QAction::triggered (this=0x97a6518, _t1=false) at .moc/debug-shared/moc_qaction.cpp:263
#26 0xb62c0669 in QAction::activate (this=0x97a6518, event=QAction::Trigger) at kernel/qaction.cpp:1257
#27 0xb62c3816 in QAction::event (this=0x97a6518, e=0xbfdbed68) at kernel/qaction.cpp:1183
#28 0xb73ed264 in KAction::event (this=0x97a6518, event=0xbfdbed68) at /var/tmp/portage/kde-base/kdelibs-4.6.5-r1/work/kdelibs-4.6.5/kdeui/actions/kaction.cpp:131
#29 0xb62c790f in QApplicationPrivate::notify_helper (this=0x95e0950, receiver=0x97a6518, e=0xbfdbed68) at kernel/qapplication.cpp:4462
#30 0xb62cf822 in QApplication::notify (this=0xbfdbfbfc, receiver=0x97a6518, e=0xbfdbed68) at kernel/qapplication.cpp:3862
#31 0xb74ea845 in KApplication::notify (this=0xbfdbfbfc, receiver=0x97a6518, event=0xbfdbed68) at /var/tmp/portage/kde-base/kdelibs-4.6.5-r1/work/kdelibs-4.6.5/kdeui/kernel/kapplication.cpp:311
#32 0xb6e36b25 in QCoreApplication::notifyInternal (this=0xbfdbfbfc, receiver=0x97a6518, event=0xbfdbed68) at kernel/qcoreapplication.cpp:731
#33 0xb630b989 in sendEvent (this=0x95e09fc, e=0xbfdbf1d4) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#34 QShortcutMap::dispatchEvent (this=0x95e09fc, e=0xbfdbf1d4) at kernel/qshortcutmap.cpp:879
#35 0xb630db5d in QShortcutMap::tryShortcutEvent (this=0x95e09fc, o=0x9fba2f0, e=0xbfdbf1d4) at kernel/qshortcutmap.cpp:364
#36 0xb62d1aaf in QApplication::notify (this=0xbfdbfbfc, receiver=0x9fba2f0, e=0xbfdbf1d4) at kernel/qapplication.cpp:3904
#37 0xb74ea845 in KApplication::notify (this=0xbfdbfbfc, receiver=0x9fba2f0, event=0xbfdbf1d4) at /var/tmp/portage/kde-base/kdelibs-4.6.5-r1/work/kdelibs-4.6.5/kdeui/kernel/kapplication.cpp:311
#38 0xb6e36b25 in QCoreApplication::notifyInternal (this=0xbfdbfbfc, receiver=0x9fba2f0, event=0xbfdbf1d4) at kernel/qcoreapplication.cpp:731
#39 0xb62c700d in sendSpontaneousEvent (receiver=0x9fba2f0, event=0xbfdbf1d4) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#40 qt_sendSpontaneousEvent (receiver=0x9fba2f0, event=0xbfdbf1d4) at kernel/qapplication.cpp:5456
#41 0xb6387a2b in QKeyMapper::sendKeyEvent (keyWidget=0x9fba2f0, grab=false, type=QEvent::KeyPress, code=87, modifiers=..., text=..., autorepeat=<value optimized out>, count=<value optimized out>, nativeScanCode=25, nativeVirtualKey=119, nativeModifiers=4) at kernel/qkeymapper_x11.cpp:1866
#42 0xb6389dd4 in QKeyMapperPrivate::translateKeyEvent (this=0x96015f8, keyWidget=0x9fba2f0, event=0xbfdbf890, grab=<value optimized out>) at kernel/qkeymapper_x11.cpp:1836
#43 0xb635f23e in QApplication::x11ProcessEvent (this=0xbfdbfbfc, event=0xbfdbf890) at kernel/qapplication_x11.cpp:3480
#44 0xb638d1b3 in x11EventSourceDispatch (s=0x95e3450, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#45 0xb5a89990 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#46 0xb5a8da88 in ?? () from /usr/lib/libglib-2.0.so.0
#47 0xb5a8dc3d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#48 0xb6e66ba6 in QEventDispatcherGlib::processEvents (this=0x9531750, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#49 0xb638ca7c in QGuiEventDispatcherGlib::processEvents (this=0x9531750, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#50 0xb6e355ff in QEventLoop::processEvents (this=0xbfdbfb84, flags=) at kernel/qeventloop.cpp:149
#51 0xb6e35a25 in QEventLoop::exec (this=0xbfdbfb84, flags=...) at kernel/qeventloop.cpp:201
#52 0xb6e38432 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#53 0xb62c6096 in QApplication::exec () at kernel/qapplication.cpp:3736
#54 0xb541cdd3 in kdemain (argc=1, argv=0x9540500) at /var/tmp/portage/app-office/calligra-2.3.81/work/calligra-2.3.81/words/part/main.cpp:43
#55 0x0804e872 in launch (argc=<value optimized out>, _name=<value optimized out>, args=<value optimized out>, cwd=0x0, envc=1, envs=0x9511e57 "DISPLAY=:0", reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x9511e66 "artamus;1316593351;469171;3830_TIME5248774") at /var/tmp/portage/kde-base/kdelibs-4.6.5-r1/work/kdelibs-4.6.5/kinit/kinit.cpp:734
#56 0x0804f323 in handle_launcher_request (sock=<value optimized out>, who=<value optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.6.5-r1/work/kdelibs-4.6.5/kinit/kinit.cpp:1226
#57 0x08050058 in handle_requests (waitForPid=<value optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.6.5-r1/work/kdelibs-4.6.5/kinit/kinit.cpp:1419
#58 0x080505ea in main (argc=2, argv=0xbfdc0274, envp=0xbfdc0280) at /var/tmp/portage/kde-base/kdelibs-4.6.5-r1/work/kdelibs-4.6.5/kinit/kinit.cpp:1907
Comment 1 Sebastian Sauer 2011-09-21 13:06:33 UTC
I am not 100% sure there (cause I was never able to reproduce that problem) but iirc we fixed that crash already a while ago. But then the bug-report says beta1 which was just released what means the problem would still be present...
Comment 2 Camilla Boemann 2011-09-21 13:09:14 UTC
I've never been able to produce that crash either :(
Comment 3 Sebastian Sauer 2011-09-23 16:29:23 UTC
*** Bug 239452 has been marked as a duplicate of this bug. ***
Comment 4 Camilla Boemann 2011-09-26 22:04:18 UTC
Doc you build calligra yourself?

it may be you have not deleted a former installation
Comment 5 Thomas Fischer 2011-09-27 07:45:48 UTC
(In reply to comment #4)
> Doc you build calligra yourself?
> 
> it may be you have not deleted a former installation
I am using official Gentoo ebuilds which should basically guarantee to remove old files when updating a package. Configuration files are excluded, of course.

I am wondering if the problem may be related to that I am still using KDE 4.6.5? It is the latest stable KDE release for Gentoo.

I'll try to compile Calligra with debug flags enabled to see if I get more information...
Comment 6 Camilla Boemann 2011-09-27 09:27:51 UTC
I'm using 4.6.5 too so that is not it
Comment 7 Camilla Boemann 2011-10-09 11:38:04 UTC
It looks like it a QObject being deleted twice but since i don't get the crash there i no way for me to fix it
Comment 8 Camilla Boemann 2011-10-09 11:41:56 UTC
actually the
    delete m_toolSelection;


in the text tool destructor looks wrong as it's a qobject

I'm can't see if a deleteLater or just not deleting is the right fix
Comment 9 Thomas Fischer 2011-10-09 12:53:38 UTC
(In reply to comment #8)
> actually the
>     delete m_toolSelection;
>
> in the text tool destructor looks wrong as it's a qobject
> 
> I'm can't see if a deleteLater or just not deleting is the right fix

I can compile and test the code on my machine. Can you please send me a patch or some instructions what to change?

Even if Calligra does not crash in your case, using a tool like Valgrind should find the illegal delete?
Comment 10 Camilla Boemann 2011-10-26 07:33:27 UTC
diff --git a/plugins/textshape/TextTool.cpp b/plugins/textshape/TextTool.cpp
index 44cfa87..e699319 100644
--- a/plugins/textshape/TextTool.cpp
+++ b/plugins/textshape/TextTool.cpp
@@ -89,7 +89,8 @@ class TextToolSelection : public KoToolSelection
 public:
 
     TextToolSelection(QWeakPointer<KoTextEditor> editor)
-        : m_editor(editor)
+        : KoToolSelection(0)
+        , m_editor(editor)
     {
     }
Comment 11 Camilla Boemann 2011-10-26 07:39:15 UTC
ah no that can't be it

it crashes on deleting widgets, so it must be the option widgets then
Comment 12 Camilla Boemann 2011-10-26 07:45:30 UTC
Git commit 0aa702d9466251405162f55eea86c128bbf474f8 by C. Boemann.
Committed on 26/10/2011 at 09:43.
Pushed by boemann into branch 'master'.

Don't delete widgets that have this as parent - Qt will take care of that
 Deleting them just leads to crashes

BUG:282462

M  +0    -1    plugins/textshape/dialogs/SimpleCharacterWidget.cpp
M  +0    -1    plugins/textshape/dialogs/SimpleParagraphWidget.cpp

http://commits.kde.org/calligra/0aa702d9466251405162f55eea86c128bbf474f8
Comment 13 zeka 2012-05-30 23:56:22 UTC
Created attachment 71455 [details]
New crash information added by DrKonqi

calligrawords (2.4.0) on KDE Platform 4.8.2 (4.8.2) using Qt 4.8.1

The bug occurred when closing a document template Calligra.

-- Backtrace (Reduced):
#7  0x00007f3c2a1fadef in qDeleteAll<QList<QWidget*>::const_iterator> (end=<optimized out>, begin=<optimized out>) at /usr/include/qt4/QtCore/qalgorithms.h:322
#8  qDeleteAll<QList<QWidget*> > (c=...) at /usr/include/qt4/QtCore/qalgorithms.h:330
#9  ~KoToolBasePrivate (this=0x122a410, __in_chrg=<optimized out>) at /build/buildd/calligra-2.4.0/libs/flake/KoToolBase_p.h:61
#10 KoToolBase::~KoToolBase (this=0x1293850, __in_chrg=<optimized out>) at /build/buildd/calligra-2.4.0/libs/flake/KoToolBase.cpp:52
#11 0x00007f3c0ff13689 in KarbonGradientTool::~KarbonGradientTool (this=0x1293850, __in_chrg=<optimized out>) at /build/buildd/calligra-2.4.0/karbon/plugins/tools/KarbonGradientTool.cpp:80
Comment 14 skaumo 2013-02-01 10:11:51 UTC
Created attachment 76858 [details]
New crash information added by DrKonqi

calligrawords (2.4.0) on KDE Platform 4.8.5 (4.8.5) using Qt 4.8.1

- What I was doing when the application crashed:

exiting then confirmed I wish to save the current document

-- Backtrace (Reduced):
#7  0x00007f23a8fd7def in qDeleteAll<QList<QWidget*>::const_iterator> (end=..., begin=...) at /usr/include/qt4/QtCore/qalgorithms.h:322
#8  qDeleteAll<QList<QWidget*> > (c=...) at /usr/include/qt4/QtCore/qalgorithms.h:330
#9  ~KoToolBasePrivate (this=0x2960190, __in_chrg=<optimized out>) at /build/buildd/calligra-2.4.0/libs/flake/KoToolBase_p.h:61
#10 KoToolBase::~KoToolBase (this=0x2901550, __in_chrg=<optimized out>) at /build/buildd/calligra-2.4.0/libs/flake/KoToolBase.cpp:52
#11 0x00007f238eee16a9 in KarbonGradientTool::~KarbonGradientTool (this=0x2901550, __in_chrg=<optimized out>) at /build/buildd/calligra-2.4.0/karbon/plugins/tools/KarbonGradientTool.cpp:80