Bug 712178

Summary: getaddrinfo() in glibc-2.14-2 leaks memory
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: fweimer, jakub, schwab, trever
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-2.14-3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-24 17:54:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Valgrind log file none

Description Sam Varshavchik 2011-06-09 17:35:04 UTC
Description of problem:

valgrind reports a memory leak in getaddrinfo().

Version-Release number of selected component (if applicable):

2.14-2

How reproducible:

always

Steps to Reproduce:

1. Compile and link the following:
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>

int main()
{
	struct addrinfo *res;

	if (getaddrinfo("localhost", "http", NULL, &res) == 0)
	{
		freeaddrinfo(res);
	}

	return 0;
}

2. Run with valgrind --tool=memcheck --leak-check=yes
  
Actual results:

See attached

Expected results:

No memory leaks.

Comment 1 Sam Varshavchik 2011-06-09 17:35:39 UTC
Created attachment 503959 [details]
Valgrind log file

Comment 2 Trever Adams 2011-06-20 13:46:07 UTC
I am seeing this with many many programs which are properly written and do freeaddrinfo as well. One example is a program that has less than 45M in memory size when first started (actually about an hour afterward). With the new glibc in just a few days this will grow to over 100M. This wasn't the case before.

Comment 3 Fedora Update System 2011-06-22 15:44:57 UTC
glibc-2.14-3 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/glibc-2.14-3

Comment 4 Trever Adams 2011-06-22 17:55:40 UTC
I have two networks (virtual) in libvirt. One doesn't want to start automatically after this update. I am also seeing some other strange things even after reboot that I cannot describe.

Other than ssh doesn't work at least for a while.

Comment 5 Fedora Update System 2011-06-24 03:38:32 UTC
Package glibc-2.14-3:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.14-3'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.14-3
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-06-24 17:54:09 UTC
glibc-2.14-3 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.