Hi,

I think, I can ask here as the function should behave identical to the Mac OS X 
version - if fink not indeed use the Mac version.

I have several shared libraries and I do unload them manually as these are all 
loaded at runtime and I like to keep the order.
I'll get a crash because one library seems not to get unloaded, even I get an 
error message (dlclose called too many times) as I
force unloading the shared library in a while loop.

The error message seems to me as it has got unloaded by the prior call. But the 
_fini in that module is not called.
At the end runtime unloads the shared library and thus it crashes, because I 
have unloaded all other libraries beforehand.

Now my questions:

It seems, the shared library did not have a _fini. How can I see that with nm?

It seems that the library did not really get unloaded by dlclose. How can I 
find the cause of it?

I see the _ini function of that problematic library telling me it gets called, 
thus I assume _fini is also present (I declare them in the same macro).

Thus my last question:

When I call dlopen twice, do I get two handles to be kept by my code or do I 
get always the same reference?

Meaning: If I get two, I'll probably override my previous handle!

It does struggling me very hard. Is there any help from you?

Thanks in advance, Lothar

Here is the output:

Summary:
        Executed Tests: 45
        Passed Tests:   45
Unregister meta application.
Unregister unit tests.
...
Unload module testsBaseDevelopment with 36 references.
Unloaded module testsBaseDevelopment.
Error while unloading module: invalid handle passed to dlclose()
Unload module testsActions with 36 references.
Unloaded module testsActions.
Error while unloading module: invalid handle passed to dlclose()

Here I have unloaded my Unit Test plugins :-)

Unload module lbMetaApplication with 1025 references.
Destructor for singleton object 'singleton_instanceOfMetaApplication' called.
Destruct instance 'singleton_instanceOfMetaApplication'.
Destructor for singleton object 'singleton_instanceOfDispatcher' called.
Destruct instance 'singleton_instanceOfDispatcher'.
Destructor for singleton object 'singleton_instanceOfEventManager' called.
Destruct instance 'singleton_instanceOfEventManager'.
Unloaded module lbMetaApplication.
Error while unloading module: invalid handle passed to dlclose()
...
Unload module DatabaseLayerGateway with 26 references.
Here the following message is mising:
'
lbDB.cpp, 4834: ~singletonHolder_instanceOflbDatabaseLayerDatabase() called.
lbDB.cpp, 4908: lbDatabaseLayerDatabase::~lbDatabaseLayerDatabase() called.
'

Unloaded module DatabaseLayerGateway.
Error while unloading module: dlclose() called too many times
...
Unload module lbPluginManager with 108 references.
Destructor for singleton object 'singleton_instanceOfPluginManager' called.
Destruct instance 'singleton_instanceOfPluginManager'.
Unloaded module lbPluginManager.
Error while unloading module: invalid handle passed to dlclose()
Unload module lbClasses with 85431 references.
Unloaded module lbClasses.
Error while unloading module: invalid handle passed to dlclose()

__cxa_finalize() seems to trigger, as the shared library does not really got 
unloaded beforehand:

lbDB.cpp, 4834: ~singletonHolder_instanceOflbDatabaseLayerDatabase() called.
lbDB.cpp, 4908: lbDatabaseLayerDatabase::~lbDatabaseLayerDatabase() called.
lbDB.cpp, 4914: lbDatabaseLayerDatabase::close() called.
lbDB.cpp, 4916: lbDatabaseLayerDatabase::close() Info: Connection pool 
initialized.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x002c1150
0x128a5b5a in lbDatabaseLayerDatabase::close ()
(gdb) where
#0  0x128a5b5a in lbDatabaseLayerDatabase::close ()
#1  0x128a5fd2 in lbDatabaseLayerDatabase::~lbDatabaseLayerDatabase ()
#2  0x128d2563 in singletonHolder_instanceOflbDatabaseLayerDatabase::destroy ()
#3  0x128d2823 in 
singletonHolder_instanceOflbDatabaseLayerDatabase::~singletonHolder_instanceOflbDatabaseLayerDatabase
 ()
#4  0x128e1337 in __tcf_2 ()
#5  0x90f9a1ff in __cxa_finalize ()
#6  0x90f9a114 in exit ()
#7  0x00002455 in start () at iostream:77
(gdb) 


-- | Rapid Prototyping | XSLT Codegeneration | http://www.lollisoft.de
Lothar Behrens
Ginsterweg 4
65760 Eschborn













------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Fink-users mailing list
Fink-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to