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

List:       kde-devel
Subject:    Re: Problems with library unloading
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-10-26 12:40:01
[Download RAW message or body]

On Thursday 26 October 2000 12:25, Szymon Stefanek wrote:
> Hi.
> 
> I have a small problem related to the library unloading.
> I'm currently extending the KDE2.0 support in KVIrc and have
> encountered a curious crash at the application shutdown
> when KVIrc is linked to the KDE libraries.
> The problem looks to be in unload_libkfile_la , so I have recompiled
> that library with some debugging stuff in the _UNLOAD macro (kunload.h),
> and got a couple of different results:
> 
> [root@localhost kfile]# kvirc
> removing meta classes for libkfile_la
>   removing metaclass KApplicationPropsPlugin
>   removing metaclass KApplicationTree
>   removing metaclass KBindingPropsPlugin
>   removing metaclass KCombiView
>   removing metaclass KDevicePropsPlugin
>   removing metaclass KDirOperator
> KCrash: crashing.... crashRecursionCounter = 2
> KCrash: Application Name = k
> 
> [root@localhost term]# kvirc
> removing meta classes for libkfile_la
>   removing metaclass KApplicationPropsPlugin
>   removing metaclass KApplicationTree
>   removing metaclass KBindingPropsPlugin
>   removing metaclass KCombiView
>   removing metaclass KDevicePropsPlugin
>   removing metaclass KDirOperator
>   removing metaclass KDirSize
>   removing metaclass KExecPropsPlugin
>   removing metaclass KFileBookmarkManager
>   removing metaclass KFileDetailView
>   removing metaclass KFileDialog
>   removing metaclass KFileDialogConfigure
>   removing metaclass KFileDialogConfigureDlg
> KCrash: crashing.... crashRecursionCounter = 2
> KCrash: Application Name = kvirc path = <unknown>   
> 
> A relevant detail is that KVIrc loads dynamically its own modules too:
> this feature has to be KDE independant so I'm actually using the common
> dlopen() stuff to achieve it.
> It looks like that if no kvirc module is loaded in the core memory the
> program exits gracefully. Once a module has been loaded , kvirc
> will crash at application quit:  always in unload_libkfile_la,
> but while removing a different metaclass, depending on the module that has been loaded.
That's because it's iterating in the list of metaclasses, and it's encountering one
that you unloaded but didn't remove from the metaclass list.

> Each kvirc module has its own characteristic metaclass that causes the SIGSEGV.
> The kvirc modules are unloaded early in the application destructor, thus are already
> unloaded at SEGV time.
> 
> Can anyone give me a hint about this ?

You need to use the "metaclass unloading" feature for kvirc's plugins too.

Do you use the current admin directory from KDE CVS ?

PS: kvirc rocks ! :)

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2

>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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