Bug 859717

Summary: memory leak with getaddrinfo()
Product: [Fedora] Fedora Reporter: Noam Meltzer <tsnoam>
Component: glibcAssignee: Jeff Law <law>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 17CC: fweimer, jakub, law, pfrankli, schwab, spoyarek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-24 13:38:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
example code to recreate the memory leak none

Description Noam Meltzer 2012-09-23 14:04:46 UTC
Created attachment 616108 [details]
example code to recreate the memory leak

Description of problem:
getaddrinfo() leaks memory

Version-Release number of selected component (if applicable):
glibc-2.15-56.fc17.x86_64
kernel: 3.5.3-1.fc17.x86_64
gcc-4.7.0-5.fc17.x86_64

How reproducible:
always using attached code

Steps to Reproduce:
1. cc     leak.c   -o leak

2. valgrind --leak-check=full --show-reachable=yes ./leak localhost

  
Actual results:
...

==11543== 240 bytes in 1 blocks are still reachable in loss record 1 of 1
==11543==    at 0x4C2884D: malloc (vg_replace_malloc.c:263)
==11543==    by 0x4F449FB: make_request (check_pf.c:250)
==11543==    by 0x4F44C55: __check_pf (check_pf.c:343)
==11543==    by 0x4F0BF08: getaddrinfo (getaddrinfo.c:2305)
==11543==    by 0x400716: ip_from_string (in /home/noam/sources/getaddrinfo.bug/leak)
==11543==    by 0x400822: main (in /home/noam/sources/getaddrinfo.bug/leak)

...

Expected results:


Additional info:
I also have Fedora15 machine which doesn't show this problem.

Comment 1 Jeff Law 2012-09-24 13:38:03 UTC
This does not appear in F15 because F15 doesn't cache information WRT what interfaces are available.

The memory leak is fixed in F18 & rawhide.  It's a low priority issue as only a single object is leaked (rather than an object per call) and there aren't currently plans to backport the fix to F17.