KLibLoader is crashing

Thiago Macieira thiago at kde.org
Sun Sep 2 19:18:17 BST 2007

>I've found the problem. This one is a tricky one.
>The problem is a conceptual one. A library now can provide both the
>configuration dialog for a plugin and the plugin itself.
>If a plugin is not loaded and its configuration dialog is shown, then
>the library is loaded, and after Cancel or OK is clicked, the library
>is unloaded. That doesn't represent a problem.
>The problem comes when a plugins is loaded and the configuration
>dialog is shown. The library is "loaded", then when the configuration
>dialog is closed, the library is _UNLOADED_, but it was _still
>providing_ the plugin itself (that is still loaded) what makes it

The way I see it, there are two conceptual problems here:

1) each load should be counted. The module (the .so file) must not be 
unloaded until as many unloads have been issued as loads. It's like a 
mutex: if you load (lock), you must unload (unlock) exactly as many 
times, never less, never more.

2) unloading is broken, completely. It brings too many problems. I want to 
remove the whole module unloading code from KDE -- but leave the API so 
that there's the impression that unloading happens. Probably leave some 
debugging about the number of unloads being different than the number of 

  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070902/c496a2e7/attachment.sig>

More information about the kde-core-devel mailing list