Crash in ~KApplication (was Re: Crash on exit, seemingly caused by netacces)

Klas Kalass klas.kalass at
Sat Jun 1 19:21:10 BST 2002

Am Sonntag, 26. Mai 2002 00:17 schrieb Klas Kalass:
> Hi all,
> I think I found a bug somewhere in kdelibs. Keduca crashes on exit with
> current kdelibs when a remote file is opened. This does not happen with the
> KDE 3.0 release version kdelibs. I do not have the time and resource to
> recompile qt & libs with debug to get a decent backtrace at the moment, but
> I think the output of valgrind might be helpfull to someone more
> knowledgable.

I did a recompile with debug output now and attached the backtrace.

I think the following happens: 
On exit, the destructors are called, destructing KGlobals::_instance on the 
way. When the kapplication destructor is done, all objects are automatically 
deleted and in AuthDataList destructor the cached Data shall be purged, but 
to check for the existance of the CacheDaemon a KDEsuClient needs to be 
created which needs KGlobal::_instance in its constructor to get the current 
locale. But _instance is already destroyed.

So what is the correct fix? A workaround could be to go through all 
childObjects and remove / delete them before  
KGlobal::deleteStaticDeleters(); is called in KApplication. But I consider 
this to be *very* ugly so I rather did not do a patch, yet.

Please advise,

-------------- next part --------------
[New Thread 1024 (LWP 21132)]
0x411ea079 in wait4 () from /lib/
#0  0x411ea079 in wait4 () from /lib/
#1  0x41264b98 in __DTOR_END__ () from /lib/
#2  0x4107f072 in waitpid () from /lib/
#3  0x40792d2c in KCrash::defaultCrashHandler (sig=6)
    at /debian/home/kdecompiler/src/kdelibs/kdecore/kcrash.cpp:224
#4  0x4107ca74 in pthread_sighandler () from /lib/
#5  <signal handler called>
#6  0x41170ab1 in kill () from /lib/
#7  0x4107c982 in pthread_kill () from /lib/
#8  0x4107ce6d in raise () from /lib/
#9  0x41171edb in abort () from /lib/
#10 0x40d08d42 in qFatal (
    msg=0x40831120 "Fatal error: you need to have a KInstance object before\nyou do anything that requires it! Examples of this are config\nobjects, standard directories or translations.")
    at /debian/home/kdecompiler/src/qt-copy/src/tools/qglobal.cpp:469
#11 0x4079f759 in KGlobal::instance ()
    at /debian/home/kdecompiler/src/kdelibs/kdecore/kglobal.cpp:76
#12 0x40682b4b in KDEsuClient::KDEsuClient (this=0xbffff22c)
    at /debian/home/kdecompiler/src/kdelibs/kdesu/client.cpp:66
#13 0x401e62ad in KIO::SessionData::AuthDataList::purgeCachedData (
    at /debian/home/kdecompiler/src/kdelibs/kio/kio/sessiondata.cpp:111
#14 0x403c3ee0 in KIO::SessionData::AuthDataList::~AuthDataList (
    this=0x81bb9d0, __in_chrg=3)
    at /debian/home/kdecompiler/src/kdelibs/kio/kio/sessiondata.cpp:73
#15 0x401e649e in KIO::SessionData::~SessionData (this=0x81b3310, __in_chrg=3)
    at /debian/home/kdecompiler/src/kdelibs/kio/kio/sessiondata.cpp:202
#16 0x401ec0ad in KIO::Scheduler::~Scheduler (this=0x81bb738, __in_chrg=3)
    at /debian/home/kdecompiler/src/kdelibs/kio/kio/scheduler.cpp:156
#17 0x40ae2da0 in QObject::~QObject (this=0xbffff424, __in_chrg=2)
    at /debian/home/kdecompiler/src/qt-copy/src/kernel/qobject.cpp:440
#18 0x40a9a7de in QApplication::~QApplication (this=0xbffff424, __in_chrg=2)
    at /debian/home/kdecompiler/src/qt-copy/src/kernel/qapplication.cpp:1097
#19 0x406f6d26 in KApplication::~KApplication (this=0xbffff424, __in_chrg=2)
    at /debian/home/kdecompiler/src/kdelibs/kdecore/kapplication.cpp:1475
#20 0x0807b27e in main ()
#21 0x4115f9ed in __libc_start_main () from /lib/

More information about the kde-core-devel mailing list