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

List:       kde-devel
Subject:    Problems with library unloading
From:       Szymon Stefanek <stefanek () tin ! it>
Date:       2000-10-26 12:25:55
[Download RAW message or body]

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.

First:
Here is a backtrace generated by DrKonqi:
0x409f78e9 in __wait4 ()
#0  0x409f78e9 in __wait4 ()
#1  0x40a561ec in __DTOR_END__ ()
#2  0x40b04995 in waitpid (pid=9864, stat_loc=0x0, options=0)
    at wrapsyscall.c:134
#3  0x40e019f0 in KCrash::defaultCrashHandler ()
#4  <signal handler called>
#5  0xfe90a58d in ?? ()
#6  0x403155ce in QGDict::unlink_ascii ()
#7  0x403157d5 in QGDict::remove_ascii ()
#8  0x400d16ce in unload_libkfile_la ()
#9  0x400d1725 in __static_initialization_and_destruction_0 ()
#10 0x400d177a in global destructors keyed to libkfile_la_meta_unload.cpp6lfk4b
    ()
#11 0x4008dab3 in __do_global_dtors_aux ()
#12 0x400d4449 in _fini ()
#13 0x4000aef6 in _dl_fini () at dl-fini.c:40
#14 0x4098725a in exit (status=0) at exit.c:57
#15 0x4097e9d1 in __libc_start_main () at ../sysdeps/generic/libc-start.c:92

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.
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 ?

-- 

Szymon Stefanek

============================================================
= I'm sorry but the number you have dialled is immaginary
= please rotate your phone 90 degrees and try again   
============================================================
= public: stefanek@tin.it
= protected: kvirc@tin.it
= protected: pragma@firenze.linux.it
= private: stefaszym@sunto.ing.unisi.it
============================================================
 
>> 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