[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: What is wrong with this program?



On Thu, 8 Oct 1998, Mihai Ibanescu wrote:

> On Wed, 7 Oct 1998, Cristian Gafton wrote:
> 
> > On Wed, 7 Oct 1998, Andrew Morgan wrote:
> > 
> > > Perhaps Red Hat would like to review the fix and fold it into their
> > > next glibc rpm?  Anyone know if the same problem is in the older
> > > non-glibc version of libdl?
> > 
> > The patch is mostly correct, but not complete (free the l_dupsearchlist
> > is calling for trouble...)
> > 
> > I am looking at the problem too.
> 
> 	Provided by Cristian is the following workaround:
> 
> #include <dlfcn.h>
> 
> main()
> {
>         int i=10000;
> 
>         void *y = dlopen("/lib/libtermcap.so.2", RTLD_GLOBAL);
> 
>         while (i) {
>                 void *x = dlopen("/lib/libtermcap.so.2", RTLD_GLOBAL);
>                 printf("x=%p\n", x);
>                 dlclose(x);
>         }
>         dlclose(y);
> }
> 
> 	Loading/unloading for the second time a dynamic library produces
> no memory leak.
> 	For PAM programmers:
> 
> pam_start()
> while(1) {
> 	pam_start()
> 	pam_end*(
> }
> pam_end
> 
> 	Thanks to Cristian for suggesting this.


I just re-read all the messages on this, just in case, but...I'm sooo
confused.  The one patch I saw that went through was for dlclose()...is
the problem libdl.a related after all?  Something that I'm going to need
to follow up with Sun, or is the above "pam_start/pam_end" a work around
for the problem?


Marc G. Fournier                               scrappy@hub.org
Systems Administrator @ hub.org                    
scrappy@{postgresql|isc}.org                       ICQ#7615664



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []