Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Mar 2011 22:31:53 -0600
From:      Eric Anderson <anderson@ttel.com>
To:        Eygene Ryabinkin <rea@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Mem leak : malloc/free + pthreads = leakage?
Message-ID:  <BE335BDF-5D8B-4965-B12E-0BC555FAEADD@freebsd.org>
In-Reply-To: <g%2B9/OWFOOUBNE3KhEpL7PKrnUCc@QsmfhJNucgI88DfvPJdT1/nyboE>
References:  <40A52D4A-9397-4406-A7EC-E7CBBEFADD55@freebsd.org> <g%2B9/OWFOOUBNE3KhEpL7PKrnUCc@QsmfhJNucgI88DfvPJdT1/nyboE>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 5, 2011, at 6:23 AM, Eygene Ryabinkin wrote:

> Fri, Mar 04, 2011 at 10:02:45PM -0600, Eric Anderson wrote:
>> I have a moderately threaded userland program (all C) I am working
>> on (using pthreads, freebsd 8.1 64bit).  It seems to leak memory
>> (using standard malloc/free) badly.  I am using pcap to capture
>> packets and process them. I have a handful of libs statically linked
>> in (pcap is one, the rest don't seem to matter - I can remove them
>> and still see the leak). =20
>>=20
>> Does anyone know of issues regarding malloc/free on multithreaded
>> userland apps? =20
>=20
> I personally hadn't heard about them, but you can definitely run
> your program under Valgrind's memcheck tool -- it often does the
> good amount of work and detects many leaks.  Valrgind is ported
> to FreeBSD, devel/valgrind.


I tried valgrind from ports, however there were some missing syscalls =
and such, and when I went to fill them in, could not figure out which it =
was, and just could not make it fly.  :(

I also tried to make hoard work, but it seems to not be happy in ports =
on 64bit FreeBSD.

Thanks!

Eric






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BE335BDF-5D8B-4965-B12E-0BC555FAEADD>