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

List:       kde-core-devel
Subject:    Re: kio_slaves never die
From:       Waldo Bastian <bastian () kde ! org>
Date:       2003-02-26 15:08:01
[Download RAW message or body]

I have not received any feedback on this since last week.

Cheers,
Waldo

On Wednesday 05 February 2003 23:32, Alexei Dets wrote:
> Problem is in libc?! But what triggers it?

It crashes in the KSocks destructor which gets called when "static 
KStaticDeleter<KSocks> med;" gets destructed by libc.

I think there is a problem with the destruction order here. Normally things 
get cleaned up from the KApplication destructor but since this is a IO slave 
we don't have a KApplication. What might happen is that the global 
KLibraryLoader gets destructed before KSocks gets destructed, that would give 
problems because the stopSocks() function still tries to unload a library.

This didn't show up in KDE 3.0 because there we just killed the io-slaves. In  
KDE 3.1 they are supposed to exit like normal applications.

Does the following patch helps? If not, you may try to see if it helps to get 
rid of this whole "med" thing from ksocks.cpp Cleaning things up on exit is 
really overrated IMO.

Cheers,
Waldo
-- 
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com



["klibloader.diff" (text/x-diff)]

Index: klibloader.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/klibloader.cpp,v
retrieving revision 1.60
diff -u -r1.60 klibloader.cpp
--- klibloader.cpp	5 Feb 2003 12:55:45 -0000	1.60
+++ klibloader.cpp	19 Feb 2003 14:25:05 -0000
@@ -188,7 +188,8 @@
 
 void KLibrary::unload() const
 {
-   KLibLoader::self()->unloadLibrary(QFile::encodeName(name()));
+   if (KLibLoader::s_self)
+      KLibLoader::s_self->unloadLibrary(QFile::encodeName(name()));
 }
 
 void KLibrary::slotObjectCreated( QObject *obj )
Index: klibloader.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/klibloader.h,v
retrieving revision 1.56
diff -u -r1.56 klibloader.h
--- klibloader.h	7 Feb 2003 13:34:23 -0000	1.56
+++ klibloader.h	19 Feb 2003 14:25:05 -0000
@@ -142,6 +142,8 @@
  */
 class KLibLoader : public QObject
 {
+    friend class KLibrary;
+
     Q_OBJECT
 public:
     /**


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

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