Bug 275065 - words crashes when closing it while document is loading
Summary: words crashes when closing it while document is loading
Status: RESOLVED UNMAINTAINED
Alias: None
Product: calligrawords
Classification: Applications
Component: general (show other bugs)
Version: 2.4-snapshots
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Calligra Words Bugs
URL:
Keywords:
: 239452 285553 329128 361303 371589 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-06 20:08 UTC by Halla Rempt
Modified: 2019-05-13 08:37 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Halla Rempt 2011-06-06 20:08:15 UTC
Application: words (2.4 Alpha 1)
KDE Platform Version: 4.6.3 (4.6.3) (Compiled from sources)
Qt Version: 4.7.3
Operating System: Linux 2.6.37.6-0.5-pae i686
Distribution: "openSUSE 11.4 (i586)"

-- Information about the crash:
I loaded the odf spec into words. When it was at 80% done layouting, I closed the application and got a crash.

The crash can be reproduced every time.

-- Backtrace:
Application: Words (words), signal: Segmentation fault
[Current thread is 1 (Thread 0xb4200710 (LWP 7634))]

Thread 2 (Thread 0xaf5e0b70 (LWP 7635)):
#0  0xb455922b in clock_gettime () from /lib/librt.so.1
#1  0xb56da0b5 in ?? () from /usr/lib/libQtCore.so.4
#2  0xb57acf36 in ?? () from /usr/lib/libQtCore.so.4
#3  0xb57ab77b in ?? () from /usr/lib/libQtCore.so.4
#4  0xb57ab81d in ?? () from /usr/lib/libQtCore.so.4
#5  0xb46d8a70 in g_main_context_prepare () from /lib/libglib-2.0.so.0
#6  0xb46d98e2 in ?? () from /lib/libglib-2.0.so.0
#7  0xb46d9fce in g_main_context_iteration () from /lib/libglib-2.0.so.0
#8  0xb57abfc7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#9  0xb577ca6d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#10 0xb577cc99 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#11 0xb567dd49 in QThread::exec() () from /usr/lib/libQtCore.so.4
#12 0xb575c7fd in ?? () from /usr/lib/libQtCore.so.4
#13 0xb5680993 in ?? () from /usr/lib/libQtCore.so.4
#14 0xb5603b05 in start_thread () from /lib/libpthread.so.0
#15 0xb542ed5e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 1 (Thread 0xb4200710 (LWP 7634)):
[KCrash Handler]
#7  0xb603edc7 in QAbstractTextDocumentLayout::document() const () from /usr/lib/libQtGui.so.4
#8  0xb50f98ea in KoTextDocumentLayout::doLayout() () from /home/boud/kde/inst/lib/libtextlayout.so.8
#9  0xb50f9cd0 in KoTextDocumentLayout::layout() () from /home/boud/kde/inst/lib/libtextlayout.so.8
#10 0xb50f7a20 in KoTextDocumentLayout::executeScheduledLayout() () from /home/boud/kde/inst/lib/libtextlayout.so.8
#11 0xb50f7cc3 in KoTextDocumentLayout::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libtextlayout.so.8
#12 0xb578407d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#13 0xb578eb55 in QMetaCallEvent::placeMetaCall(QObject*) () from /usr/lib/libQtCore.so.4
#14 0xb5792dbf in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#15 0xb5d74684 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#16 0xb5d7d427 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#17 0xb6827901 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#18 0xb577d78e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#19 0xb578151c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#20 0xb578166c in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/libQtCore.so.4
#21 0xb57abdf4 in ?? () from /usr/lib/libQtCore.so.4
#22 0xb46d9509 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#23 0xb46d9d10 in ?? () from /lib/libglib-2.0.so.0
#24 0xb46d9fce in g_main_context_iteration () from /lib/libglib-2.0.so.0
#25 0xb57abf7b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#26 0xb5e2b1da in ?? () from /usr/lib/libQtGui.so.4
#27 0xb5781903 in QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0xb77e8dca in KoProgressUpdater::update() () from /home/boud/kde/inst/lib/libkomain.so.8
#29 0xb77e91f1 in KoProgressUpdater::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libkomain.so.8
#30 0xb578407d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#31 0xb57934cc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#32 0xb77ea797 in KoUpdaterPrivate::sigUpdated() () from /home/boud/kde/inst/lib/libkomain.so.8
#33 0xb77ea89f in KoUpdaterPrivate::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libkomain.so.8
#34 0xb578407d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#35 0xb57934cc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#36 0xb77ea193 in KoUpdater::sigProgress(int) () from /home/boud/kde/inst/lib/libkomain.so.8
#37 0xb77ea244 in KoUpdater::setProgress(int) () from /home/boud/kde/inst/lib/libkomain.so.8
#38 0xb7783e86 in KoDocument::openFile() () from /home/boud/kde/inst/lib/libkomain.so.8
#39 0xb7179760 in ?? () from /usr/lib/libkparts.so.4
#40 0xb7179e29 in KParts::ReadOnlyPart::openUrl(KUrl const&) () from /usr/lib/libkparts.so.4
#41 0xb77868f1 in KoDocument::openUrl(KUrl const&) () from /home/boud/kde/inst/lib/libkomain.so.8
#42 0xb7776b99 in KoDocument::openExistingFile(KUrl const&) () from /home/boud/kde/inst/lib/libkomain.so.8
#43 0xb777db5b in KoDocument::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libkomain.so.8
#44 0xb1a91e1a in KWDocument::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libwordsprivate.so.8
#45 0xb578407d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#46 0xb57934cc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#47 0xb77ec763 in KoOpenPane::openExistingFile(KUrl const&) () from /home/boud/kde/inst/lib/libkomain.so.8
#48 0xb77edf7d in KoOpenPane::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libkomain.so.8
#49 0xb578407d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#50 0xb57934cc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#51 0xb77ead63 in KoDetailsPane::openUrl(KUrl const&) () from /home/boud/kde/inst/lib/libkomain.so.8
#52 0xb77ef6a1 in KoRecentDocumentsPane::openFile(QModelIndex const&) () from /home/boud/kde/inst/lib/libkomain.so.8
#53 0xb77eae50 in KoDetailsPane::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libkomain.so.8
#54 0xb77f02ba in KoRecentDocumentsPane::qt_metacall(QMetaObject::Call, int, void**) () from /home/boud/kde/inst/lib/libkomain.so.8
#55 0xb578407d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#56 0xb57934cc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#57 0xb6317745 in QAbstractItemView::doubleClicked(QModelIndex const&) () from /usr/lib/libQtGui.so.4
#58 0xb63646ec in QTreeView::mouseDoubleClickEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#59 0xb5dcfb0e in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#60 0xb61df0f5 in QFrame::event(QEvent*) () from /usr/lib/libQtGui.so.4
#61 0xb6270b91 in QAbstractScrollArea::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#62 0xb6314e74 in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#63 0xb6360546 in QTreeView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#64 0xb6273486 in ?? () from /usr/lib/libQtGui.so.4
#65 0xb577d926 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#66 0xb5d74654 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#67 0xb5d7df80 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#68 0xb6827901 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#69 0xb577d78e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#70 0xb5d7572c in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/libQtGui.so.4
#71 0xb5e01bb0 in ?? () from /usr/lib/libQtGui.so.4
#72 0xb5e00cbe in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#73 0xb5e2b5e0 in ?? () from /usr/lib/libQtGui.so.4
#74 0xb46d9509 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#75 0xb46d9d10 in ?? () from /lib/libglib-2.0.so.0
#76 0xb46d9fce in g_main_context_iteration () from /lib/libglib-2.0.so.0
#77 0xb57abf7b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#78 0xb5e2b1da in ?? () from /usr/lib/libQtGui.so.4
#79 0xb577ca6d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#80 0xb577cc99 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#81 0xb5781740 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#82 0xb5d723d4 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#83 0xb7859b85 in kdemain () from /home/boud/kde/inst/lib/libkdeinit4_words.so
#84 0x080487db in main ()

Reported using DrKonqi
Comment 1 Sebastian Sauer 2011-06-07 22:23:29 UTC
The reason is that the KoMainWindow got destroyed without the KWDocument knowing about it and therefore if it tries to access something that was owned by the KoMainWindow it crashes. The KoMainWindow tries to detach the KoDocument in it's ctor but the problem is that the KoDocument got only added to the KoMainWindow once loading is completed.

backtrace with symbols;

Application: Words (words), signal: Segmentation fault
[KCrash Handler]
#6  0xb76cbd78 in KoMainWindow::slotProgress (this=0x81e3d10, value=91) at /home/kdab/src/kde/calligra/libs/main/KoMainWindow.cpp:1553
#7  0xb769a5ff in (anonymous namespace)::DocumentProgressProxy::setValue (this=0x832dc40, value=91) at /home/kdab/src/kde/calligra/libs/main/KoDocument.cpp:322
#8  0xb770ee40 in KoProgressUpdater::updateUi (this=0x833b828) at /home/kdab/src/kde/calligra/libs/main/KoProgressUpdater.cpp:206
#9  0xb770f1ee in KoProgressUpdater::qt_metacall (this=0x833b828, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfde771c) at /home/kdab/src/build/calligra/libs/main/KoProgressUpdater.moc:74
#10 0xb56af8cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#11 0xb56bfa2c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#12 0xb570efe5 in QTimer::timeout() () from /usr/lib/libQtCore.so.4
#13 0xb56c6046 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/libQtCore.so.4
#14 0xb56be3f4 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#15 0xb5c9e414 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#16 0xb5ca70c7 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#17 0xb674e1f1 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#18 0xb56a8fde in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#19 0xb56da379 in ?? () from /usr/lib/libQtCore.so.4
#20 0xb56d7042 in ?? () from /usr/lib/libQtCore.so.4
#21 0xb45b3509 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#22 0xb45b3d10 in ?? () from /lib/libglib-2.0.so.0
#23 0xb45b3fce in g_main_context_iteration () from /lib/libglib-2.0.so.0
#24 0xb56d776b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#25 0xb5d5455a in ?? () from /usr/lib/libQtGui.so.4
#26 0xb56ad153 in QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#27 0xb770ebd5 in KoProgressUpdater::update (this=0x833b828) at /home/kdab/src/kde/calligra/libs/main/KoProgressUpdater.cpp:163
#28 0xb770f1e1 in KoProgressUpdater::qt_metacall (this=0x833b828, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbfde7f7c) at /home/kdab/src/build/calligra/libs/main/KoProgressUpdater.moc:73
#29 0xb56af8cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#30 0xb56bfa2c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#31 0xb7710c15 in KoUpdaterPrivate::sigUpdated (this=0x828a2e0) at /home/kdab/src/build/calligra/libs/main/KoUpdaterPrivate_p.moc:95
#32 0xb7710a85 in KoUpdaterPrivate::setProgress (this=0x828a2e0, percent=28) at /home/kdab/src/kde/calligra/libs/main/KoUpdaterPrivate_p.cpp:45
#33 0xb7710bd0 in KoUpdaterPrivate::qt_metacall (this=0x828a2e0, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbfde80c8) at /home/kdab/src/build/calligra/libs/main/KoUpdaterPrivate_p.moc:84
#34 0xb56af8cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#35 0xb56bfa2c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#36 0xb7710648 in KoUpdater::sigProgress (this=0x82f88e8, _t1=28) at /home/kdab/src/build/calligra/libs/main/KoUpdater.moc:102
#37 0xb7710352 in KoUpdater::setProgress (this=0x82f88e8, percent=28) at /home/kdab/src/kde/calligra/libs/main/KoUpdater.cpp:61
#38 0xb046fe2a in KWDocument::layoutProgressChanged (this=0x8207a60, percent=28) at /home/kdab/src/kde/calligra/words/part/KWDocument.cpp:356
#39 0xb045f29f in KWDocument::qt_metacall (this=0x8207a60, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0xbfde8248) at /home/kdab/src/build/calligra/words/part/moc_KWDocument.cpp:110
#40 0xb56af8cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#41 0xb56bfa2c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#42 0xb5026204 in KoTextDocumentLayout::layoutProgressChanged (this=0x90b1700, _t1=28) at /home/kdab/src/build/calligra/libs/textlayout/KoTextDocumentLayout.moc:101
#43 0xb5025fa2 in KoTextDocumentLayout::updateProgress (this=0x90b1700, it=...) at /home/kdab/src/kde/calligra/libs/textlayout/KoTextDocumentLayout.cpp:750
#44 0xb5025970 in KoTextDocumentLayout::doLayout (this=0x90b1700) at /home/kdab/src/kde/calligra/libs/textlayout/KoTextDocumentLayout.cpp:630
#45 0xb5024faa in KoTextDocumentLayout::layout (this=0x90b1700) at /home/kdab/src/kde/calligra/libs/textlayout/KoTextDocumentLayout.cpp:493
#46 0xb5025af5 in KoTextDocumentLayout::executeScheduledLayout (this=0x90b1700) at /home/kdab/src/kde/calligra/libs/textlayout/KoTextDocumentLayout.cpp:670
#47 0xb50261ab in KoTextDocumentLayout::qt_metacall (this=0x90b1700, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0x8e9bf68) at /home/kdab/src/build/calligra/libs/textlayout/KoTextDocumentLayout.moc:89
#48 0xb56af8cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#49 0xb56ba3a5 in QMetaCallEvent::placeMetaCall(QObject*) () from /usr/lib/libQtCore.so.4
#50 0xb56be5af in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#51 0xb5c9e414 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#52 0xb5ca70c7 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#53 0xb674e1f1 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#54 0xb56a8fde in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#55 0xb56acd6c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#56 0xb56acebc in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/libQtCore.so.4
#57 0xb56d75e4 in ?? () from /usr/lib/libQtCore.so.4
#58 0xb45b3509 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#59 0xb45b3d10 in ?? () from /lib/libglib-2.0.so.0
#60 0xb45b3fce in g_main_context_iteration () from /lib/libglib-2.0.so.0
#61 0xb56d776b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#62 0xb5d5455a in ?? () from /usr/lib/libQtGui.so.4
#63 0xb56ad153 in QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#64 0xb770ebd5 in KoProgressUpdater::update (this=0x833b828) at /home/kdab/src/kde/calligra/libs/main/KoProgressUpdater.cpp:163
#65 0xb770f1e1 in KoProgressUpdater::qt_metacall (this=0x833b828, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbfde8c7c) at /home/kdab/src/build/calligra/libs/main/KoProgressUpdater.moc:73
#66 0xb56af8cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#67 0xb56bfa2c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#68 0xb7710c15 in KoUpdaterPrivate::sigUpdated (this=0x8d57010) at /home/kdab/src/build/calligra/libs/main/KoUpdaterPrivate_p.moc:95
#69 0xb7710a85 in KoUpdaterPrivate::setProgress (this=0x8d57010, percent=100) at /home/kdab/src/kde/calligra/libs/main/KoUpdaterPrivate_p.cpp:45
#70 0xb7710bd0 in KoUpdaterPrivate::qt_metacall (this=0x8d57010, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbfde8dc8) at /home/kdab/src/build/calligra/libs/main/KoUpdaterPrivate_p.moc:84
#71 0xb56af8cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#72 0xb56bfa2c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#73 0xb7710648 in KoUpdater::sigProgress (this=0x82e76f0, _t1=100) at /home/kdab/src/build/calligra/libs/main/KoUpdater.moc:102
#74 0xb7710352 in KoUpdater::setProgress (this=0x82e76f0, percent=100) at /home/kdab/src/kde/calligra/libs/main/KoUpdater.cpp:61
#75 0xb76a1e94 in KoDocument::openFile (this=0x8207a60) at /home/kdab/src/kde/calligra/libs/main/KoDocument.cpp:1657
#76 0xb708c5c0 in ?? () from /usr/lib/libkparts.so.4
#77 0xb708cc89 in KParts::ReadOnlyPart::openUrl(KUrl const&) () from /usr/lib/libkparts.so.4
#78 0xb76a0190 in KoDocument::openUrl (this=0x8207a60, _url=...) at /home/kdab/src/kde/calligra/libs/main/KoDocument.cpp:1264
#79 0xb76c6cdb in KoMainWindow::openDocumentInternal (this=0x81e3d10, url=..., newdoc=0x8207a60) at /home/kdab/src/kde/calligra/libs/main/KoMainWindow.cpp:677
#80 0xb76c6b7a in KoMainWindow::openDocument (this=0x81e3d10, newdoc=0x8207a60, url=...) at /home/kdab/src/kde/calligra/libs/main/KoMainWindow.cpp:660
#81 0xb7695e94 in KoApplication::start (this=0xbfde94f0) at /home/kdab/src/kde/calligra/libs/main/KoApplication.cpp:252
#82 0xb778877a in kdemain (argc=2, argv=0xbfde95f4) at /home/kdab/src/kde/calligra/words/part/main.cpp:41
#83 0x080487d9 in main (argc=2, argv=0xbfde95f4) at /home/kdab/src/build/calligra/words/part/words_dummy.cpp:3
Comment 2 Sebastian Sauer 2011-06-07 22:39:45 UTC
Seems that crash shows a big design-error in Calligra's KDE-UI architecture. In fact the KoDocument is responsible for managing the KoMainWindow's (means the model controls the view). That's why we cannot easily use a parent-child relationship like with following patch but need to proper sync KoDocument's manually if KoMainWindow's go out of scope :-/

While we are on it. It's even that ugly that KoApplication doesn't delete the initial KoDocument. Probably that's the reason for those "** (process:28215): WARNING **: 1 dictionaries weren't free'd." printed on quit of any calligra application.

Yay :-/

diff --git a/libs/main/KoApplication.cpp b/libs/main/KoApplication.cpp
index f97ae04..e7867f7 100644
--- a/libs/main/KoApplication.cpp
+++ b/libs/main/KoApplication.cpp
@@ -189,6 +189,7 @@ bool KoApplication::start()
             if (doc) {
                 // show a shell asap
                 KoMainWindow *shell = new KoMainWindow(doc->componentData());
+                doc->setParent(shell);
                 if (showShell || !benchmarkLoading) {
                     shell->show();
                 }
Comment 3 Halla Rempt 2011-06-08 11:06:53 UTC
On Tuesday 07 June 2011 Jun, Sebastian Sauer wrote:
> https://bugs.kde.org/show_bug.cgi?id=275065

> --- Comment #2 from Sebastian Sauer <mail dipe org>  2011-06-07 22:39:45 ---
> Seems that crash shows a big design-error in Calligra's KDE-UI architecture. In
> fact the KoDocument is responsible for managing the KoMainWindow's (means the
> model controls the view). That's why we cannot easily use a parent-child
> relationship like with following patch but need to proper sync KoDocument's
> manually if KoMainWindow's go out of scope :-/
> 
> While we are on it. It's even that ugly that KoApplication doesn't delete the
> initial KoDocument. Probably that's the reason for those "** (process:28215):
> WARNING **: 1 dictionaries weren't free'd." printed on quit of any calligra
> application.
> 
> Yay :-/
> 

Yes... It's a big design error, and I've already spent quite a bit of time trying to disentangle it. But it's gotten very, very complicated because every application seems to use it in a slightly different, wrong way. Nice consequence of this design is also that splitting the view creates duplicates of all actions... KoMainWindow, KoDocument and KoView are just very, very wrong at the moment.
Comment 4 Sebastian Sauer 2011-06-08 15:49:34 UTC
Following patch would fix it the dirty way but then we still need to abort all current actions done in the KoDocument (e.g. layouting, loading, etc) and destroy the KoDocument as well else the KoDocument keeps on to run in the background forever.

diff --git a/libs/main/KoDocument.cpp b/libs/main/KoDocument.cpp
index e4aafa9..23e9fa2 100644
--- a/libs/main/KoDocument.cpp
+++ b/libs/main/KoDocument.cpp
@@ -2346,13 +2346,18 @@ void KoDocument::addShell(KoMainWindow *shell)
         //kDebug(30003) <<"shell" << (void*)shell <<"added to doc" << this;
         d->shells.append(shell);
         connect(shell, SIGNAL(documentSaved()), d->undoStack, SLOT(setClean()));
+        connect(shell, SIGNAL(destroyed(QObject*)), this, SLOT(shellDestroyed(QObject*)));
     }
 }
 
 void KoDocument::removeShell(KoMainWindow *shell)
 {
     //kDebug(30003) <<"shell" << (void*)shell <<"removed from doc" << this;
-    d->shells.removeAll(shell);
+    if (shell) {
+        disconnect(shell, SIGNAL(documentSaved()), d->undoStack, SLOT(setClean()));
+        disconnect(shell, SIGNAL(destroyed(QObject*)), this, SLOT(shellDestroyed(QObject*)));
+        d->shells.removeAll(shell);
+    }
 }
 
 const QList<KoMainWindow*>& KoDocument::shells() const
@@ -2645,6 +2650,11 @@ void KoDocument::startCustomDocument()
     deleteOpenPane();
 }
 
+void KoDocument::shellDestroyed(QObject *obj)
+{
+    removeShell(static_cast<KoMainWindow*>(obj));
+}
+
 KoOpenPane *KoDocument::createOpenPane(QWidget *parent, const KComponentData &componentData,
                                        const QString& templateType)
 {
diff --git a/libs/main/KoDocument.h b/libs/main/KoDocument.h
index 5be2b11..6c76bf9 100644
--- a/libs/main/KoDocument.h
+++ b/libs/main/KoDocument.h
@@ -1022,6 +1022,7 @@ private slots:
     void slotAutoSave();
     void slotStarted(KIO::Job*);
     void startCustomDocument();
+    void shellDestroyed(QObject *obj);
 
 private:
Comment 5 Camilla Boemann 2011-06-08 23:18:28 UTC
i think more people need to voice an opinion, but given that this is a stop gap to a broken design, which we have stated our intention to redo at some point,  i think we can live with hacks

Just if someone is more into this area (i'm not), please look if this is the best hack we can do
Comment 6 Sebastian Sauer 2011-09-23 16:34:03 UTC
*** Bug 239452 has been marked as a duplicate of this bug. ***
Comment 7 Camilla Boemann 2011-11-02 14:47:02 UTC
*** Bug 285553 has been marked as a duplicate of this bug. ***
Comment 8 Camilla Boemann 2011-12-05 14:09:57 UTC
removing release_blocker flag as it may take forever to fix and only happens on close
Comment 9 Camilla Boemann 2015-02-09 21:52:40 UTC
*** Bug 329128 has been marked as a duplicate of this bug. ***
Comment 10 RJ 2016-04-23 19:10:35 UTC
*** Bug 361303 has been marked as a duplicate of this bug. ***
Comment 11 Camilla Boemann 2016-10-24 16:40:21 UTC
*** Bug 371589 has been marked as a duplicate of this bug. ***
Comment 12 Halla Rempt 2019-05-13 08:37:40 UTC
I'm no longer able to test any fixes to these bugs, if there would be a fix forthcoming.