You are not logged in.

#1 2010-12-27 21:55:03

brian
Member
Registered: 2009-08-03
Posts: 16

getaddrinfo memory leak?

Could someone with gcc and valgrind try to reproduce this leak?
http://pastebin.com/MuDm3bMk

I see getaddrinfo leaking on every call. The exact same program *isn't* seeming to leak on Ubuntu. Theories appreciated.

Offline

#2 2010-12-27 22:02:36

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: getaddrinfo memory leak?

These pipes are sealed tight:

$ alias vgfull
alias vgfull='valgrind --leak-check=full --show-reachable=yes'
$ vgfull ./leak
==27665== Memcheck, a memory error detector
==27665== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==27665== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==27665== Command: ./leak
==27665== 
==27665== 
==27665== HEAP SUMMARY:
==27665==     in use at exit: 0 bytes in 0 blocks
==27665==   total heap usage: 8,038 allocs, 8,038 frees, 701,170 bytes allocated
==27665== 
==27665== All heap blocks were freed -- no leaks are possible
==27665== 
==27665== For counts of detected and suppressed errors, rerun with: -v
==27665== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 15 from 10)

edit: in case it's relevant, i'm using the testing toolchain (gcc 4.5.2). valgrind is plain -- version 3.6.0 out of extra.

Last edited by falconindy (2010-12-27 22:13:41)

Offline

#3 2010-12-28 16:11:09

brian
Member
Registered: 2009-08-03
Posts: 16

Re: getaddrinfo memory leak?

Thank you for testing that. Maybe I have something misconfigured w.r.t. nslcd.

Here's my valgrind output: http://pastebin.com/j7SLaiJ5

Offline

Board footer

Powered by FluxBB