Bug 859717 - memory leak with getaddrinfo()
Summary: memory leak with getaddrinfo()
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 17
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-23 14:04 UTC by Noam Meltzer
Modified: 2016-11-24 15:56 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-09-24 13:38:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
example code to recreate the memory leak (1.10 KB, text/plain)
2012-09-23 14:04 UTC, Noam Meltzer
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.