This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gethostbyname_r leaks memory


Hi,

I can easily reproduce this problem.

I have some evidence that the leak is caused by the following:

	    if (EXT(statp).nsaddrs[n] == NULL)
		 EXT(statp).nsaddrs[n] =
			    malloc(sizeof (struct sockaddr_in6));

from resolv/res_send.c near line 440, which is apparantly producing
lots of small chunks which in the multi-thread case are never freed.
Perhaps someone who understands the resolver logic better can fix it
straight away?  I might take a look too but it's probably going to
take some time..

Regards,
Wolfram.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]