[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 69906] crash when opening existing project
From:       Carsten Pfeiffer <pfeiffer () kde ! org>
Date:       2006-09-28 10:36:42
Message-ID: 20060928103642.27419.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=69906         




------- Additional Comments From pfeiffer kde org  2006-09-28 12:36 -------
Created an attachment (id=17953)
 --> (http://bugs.kde.org/attachment.cgi?id=17953&action=view)
patch fixing a	crash on shutdown

kdevelop uses a few singleton objects that are never deleted on exit, and which
are the "owners" of quite a bunch of other objects. When closing the main
window with Alt-F4 for example, the QObject hierarchy will make sure that
(almost) everything is deleted in the right order. 

When closing kdevelop through session management, or e.g. via "dcop `dcop
kdevelop*` MainApplication-Interface quit" however, kdevelop is being closed
with the last window (and hence all its child objects) still alive.

On KApplication destruction, all the plugins are deleted through KLibLoader:

#0  ~KFileIconView (this=0x8458630) at kfileiconview.cpp:186
#1  0xb72fa89a in ~KDirOperator (this=0x8430460) at kdiroperator.cpp:158
#2  0xb53251a5 in KDevDirOperator::~KDevDirOperator () from
/home/gis/kde3-test/lib/kde3/libkdevfileselector.so
#3  0xb652c883 in QWidget::~QWidget () from /usr/share/qt3/lib/libqt-mt.so.3
#4  0xb53211d8 in KDevFileSelector::~KDevFileSelector () from
/home/gis/kde3-test/lib/kde3/libkdevfileselector.so
#5  0xb531b4de in FileSelectorPart::~FileSelectorPart () from
/home/gis/kde3-test/lib/kde3/libkdevfileselector.so
#6  0xb74df47e in QPtrList<QObject>::deleteItem (this=0x8412ef0, d=0x84030b8)
at /usr/share/qt3/include/qptrlist.h:150
#7  0xb67e8d84 in QGList::clear () from /usr/share/qt3/lib/libqt-mt.so.3
#8  0xb74df49d in QPtrList<QObject>::clear (this=0x8412ef0) at
/usr/share/qt3/include/qptrlist.h:93
#9  0xb6c3a9c4 in ~KLibrary (this=0x8412eb8) at klibloader.cpp:126
#10 0xb6c387c8 in KLibLoader::close_pending (this=0x81a8678, wrap=0x840a070) at
klibloader.cpp:516
#11 0xb6c392bb in ~KLibLoader (this=0x81a8678) at klibloader.cpp:328
#12 0xb6c37e0c in KLibLoader::cleanUp () at klibloader.cpp:298
#13 0xb6b8883a in ~KApplication (this=0xbfd841d0) at kapplication.cpp:1609

I'm not exactly sure why this doesn't work (it certainly is not related to
KFileIconView -- if I change its destructor to {} the crash happens in the next
(documentation) plugin.

In order to fix this, kdevelop simply needs to make sure to clean up all its
plugins and singletons in time.

This patch does that in a proof of concept way. I'd rather have a dedicated
QObject though, that manages all those singletons and listens to kapp's
aboutToQuit() signal to perform the shutdown, then. I'm happy to create a new
patch doing this.

In order to verify this, try current kdevelop 3.x and quit it with Alt-F4 once
and with "dcop `dcop kdevelop*` MainApplication-Interface quit". The latter
should make it crash. Now apply the patch and try again.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic