Question

I have gone through other questions on SO with no luck for eg:
C++: dlclose doesn't unload the shared library

I have encountered with two shared objects(unfortunately i can't expose the code).
lets say

liba.so and libb.so

liba.so implicitly links libb.so.
And an application explicitly links liba.so using dlopen() with RTLD_LAZY flag.

Everything is working fine except that dlclose() isn't unloading liba.so, although its returning successfully. lsof command is showing both liba.so and libb.so as loaded.

As the answer to above question suggests, dlclose() only decrements ref count. But as nothing else is using those libraries I expect dlclose() to actually unload it.

I have tried these two so's with different application with same problem. So I guess the problem is within the libraries.

Can someone please give suggestion about what might be the cause.

Was it helpful?

Solution

Hmmm... finally it seems that the problem has been found.

That's a bug in OpenSUSE.

Here is the link: https://bugzilla.novell.com/show_bug.cgi?id=680125

The code is ran on OpenSUSE 12.1 and the bug was resolved in OpenSUSE 12.2.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top