[kfm-devel] Konq always crashes on exit

Malte Starostik malte at kde.org
Mon Oct 7 04:49:35 BST 2002


On Monday 07 October 2002 05:26, Malte Starostik wrote:
> Hi,
>
> has anyone seen this recently?
> Fresh build on Mandrake 9.0 and konq consistently crashes on exit. I
> suspect it's some lib unloading thing as ~KLibrary is always in the bt, but
> I'm not sure yet. Still investigating but maybe you already have the answer
> *hope* -Malte
Hmmm, both bts show a sequence like this: KApp::~KApp cleans up the libraries 
*after* deleting the static deleters:

  // First call the static deleters and then call KLibLoader::cleanup()
  // The static deleters may delete libraries for which they need KLibLoader.
  // KLibLoader will take care of the remaining ones.
  KGlobal::deleteStaticDeleters();
  KLibLoader::cleanUp();

But those libraries' dtors access the singletons again, causing the singletons 
to be newly instantiated.

This code has been around since almost a year, so I wonder why it breaks only 
now; still: what was expected to happen in the not so unlikely case that a 
library's cleanup routine will access a KStaticDeleter-using singleton again?
Of course there's also the question why this leads to crashes because normally 
it should only increase shutdown time due to the new singleton creation...

I don't dare to call it a solution, but if I reverse the above two lines, the 
crashes are gone.

> #2  0x402fbc63 in SlaveConfig (this=0x82b1fe0)
>     at /home/malte/src/kde/kdelibs/kio/kio/slaveconfig.cpp:150
> #3  0x402fbb31 in KIO::SlaveConfig::self() ()
>     at /home/malte/src/kde/kdelibs/kio/kio/slaveconfig.cpp:142
[...]
> #12 0x408467fb in ~KLibrary (this=0x8202d08)
>     at /home/malte/src/kde/kdelibs/kdecore/klibloader.cpp:132
> #13 0x408483f2 in KLibLoader::close_pending(KLibWrapPrivate*)
> (this=0x8103de8, wrap=0x8202d90) at
> /home/malte/src/kde/kdelibs/kdecore/klibloader.cpp:525 #14 0x40847793 in
> ~KLibLoader (this=0x8103de8)
>     at /home/malte/src/kde/kdelibs/kdecore/klibloader.cpp:342
> #15 0x408470db in KLibLoader::cleanUp() ()
>     at /home/malte/src/kde/kdelibs/kdecore/klibloader.cpp:312
> #16 0x407c0139 in ~KApplication (this=0xbffff3a0)
>     at /home/malte/src/kde/kdelibs/kdecore/kapplication.cpp:1314

I wonder when we will be able to get rid of all those hacks around static 
objects where normally the compiler/linker is supposed to care for it *grr*
-Malte





More information about the kfm-devel mailing list