All,

   I have an application which is statically linked.
It uses dlopen() and dlclose() calls multiple times.
First time the dlopen()/dlclose() pair succeeds.
But the second one fails with segfault.

 This happens only in RH AS2.1, not in RH 8.x/9.x
Any bug in glibc?

Any ideas?


Thanks.

--T. Muthu Mohan.

-----------[ source code: mystatic.cpp ]------------------
#include <iostream.h> 
#include <dlfcn.h> 
#include <stdlib.h> 
int main() 
{
        void *pHandle = dlopen("libz.so", RTLD_NOW);
        if (pHandle) {
                cout << "Successfully Loaded!" << endl;
                dlclose(pHandle);
                cout << "Successfully UnLoaded!" << endl;
        }

        cout << "Second Time" << endl;

        void *pHandle1 = dlopen("libz.so", RTLD_NOW);
        if (pHandle1) {
                cout << "Successfully Loaded!" << endl;
                dlclose(pHandle1);
                cout << "Successfully UnLoaded!" << endl;
        }
        return 0;
}
        
---------------
Compile using : g++ -g -static mystatic.cpp -o mystatic -ldl
                
Then run: ./mystatic
Successfully Loaded!
Successfully UnLoaded!
Second Time
Segmentaion Fault



-- 
Psyche-list mailing list
[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/psyche-list

Reply via email to