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

List:       kde-core-devel
Subject:    Re: metaunloading problem
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-08-05 0:42:53
[Download RAW message or body]

On Tue, 25 Jul 2000, Michael Matz wrote :
>Hi,
>
>On Mon, 24 Jul 2000, Dirk Mueller wrote:
>> #0  0x4000769c in _dl_lookup_symbol (
>>     undef_name=0x411a9e2f "_._35_KUnloadMetaClass_Helperlibkjava_la",
>>     ref=0xbffff59c, symbol_scope=0x8179f20,
>>     reference_name=0x8179618 "/opt/kde/lib/libkjava.so.1", reloc_type=7)
>>     at do-lookup.h:70
>> #1  0x4000a351 in fixup (l=0x8179f20, reloc_offset=1092263471)
>>     at dl-runtime.c:88
>> #2  0x4000a4d0 in _dl_runtime_resolve () at dl-runtime.c:182
>> #3  0x411b04b2 in
>> _GLOBAL_.D._._35_KUnloadMetaClass_Helperlibkjava_lalibkjava_la_meta_unload
>>.cppGiaLbb () at libkjava_la_meta_unload.cpp:9
>
>As the crash is in ld.so when resolving the symbol I suspect that some
>bounds problem in the code (added the last days) screwed the symbol
>tables. Wasn't that also the problem, when there were static function
>local objects? That, or a normal overwriting of unallocated memory.

I'm still having this problem, but I know a bit more what happens.

The bug is definitely that libkhtml_java is not unloaded when libkhtml is,
but after any other lib has been unloaded (and since the unload code is in kdecore, it crashes).

The reason seems to be that libkhtml_java is simply not related to libkhtml as far
as the linker is concerned. Note that libkjava and kjs_html are real libs
(as opposed to all the noinst_libs in libkhtml). I thought this was the reason,
but kjs_html is unloaded fine.

Typical scenario: konqueror www.kde.org ; click on the home button ; close window

KUnloadMetaClass - New library loaded libDCOP_la
KUnloadMetaClass - New library loaded libkdecore_la
KUnloadMetaClass - New library loaded libkdeui_la
KUnloadMetaClass - New library loaded libkio_la
KUnloadMetaClass - New library loaded libksycoca_la
KUnloadMetaClass - New library loaded libkfile_la
KUnloadMetaClass - New library loaded libkparts_la
KUnloadMetaClass - New library loaded libkjava_la       <--- libkjava is loaded
KUnloadMetaClass - New library loaded libkhtmlmisc_la
KUnloadMetaClass - New library loaded libkhtmlrender_la
KUnloadMetaClass - New library loaded libkhtmlhtml_la
KUnloadMetaClass - New library loaded libkhtml_la
KUnloadMetaClass - New library loaded kjs_html_la

KUnloadMetaClass - Unloading library kjs_html_la     <-- see that one ? no problem there.
KUnloadMetaClass - Unloading library libkhtml_la
KUnloadMetaClass - Unloading library libkhtmlhtml_la
KUnloadMetaClass - Unloading library libkhtmlrender_la
KUnloadMetaClass - Unloading library libkhtmlmisc_la
KUnloadMetaClass - Unloading library libkparts_la
KUnloadMetaClass - Unloading library libkfile_la
KUnloadMetaClass - Unloading library libksycoca_la
KUnloadMetaClass - Unloading library libkio_la
KUnloadMetaClass - Unloading library libkdeui_la
KUnloadMetaClass - Unloading library libkdecore_la
KUnloadMetaClass - Unloading library libDCOP_la 
<then it tries to unload libkjava_la but it's too late, kdecore is gone already>

I also note that the unloading after a certain period of time (after changing the view mode in konq)
doesn't work in khtml but it works in e.g. kwrite !!! No idea why.....

Does anyone know when libkjava is supposed to be loaded and unloaded ?
Oh !!! It doesn't have a factory (KLibFactory) ! So it doesn't unload itself ! That's why !
Hmm... still, it should get unloaded before libkparts (reverse order)... this doesn't seem to
work :(

Rich, can you have a look at making the factory-type class (kjavaappletserver.h apparently)
a KLibFactory ? This will make it be unloaded after deleting the last object it creates.
Well, that won't be enough. We also want that it gets unloaded with libkhtml even
if it created no object, I guess. Or rather, we don't want to load libkjava until we 
need a java object. This way, it would fit perfectly with the concept of KLibrary/KLibFactory.

Thanks for having a look, or for pointing me to the code in khtml that uses kjava.

PS: I wonder why kjs_html gets unloaded btw.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/, 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

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

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