From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 27 15:43:19 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 704C01065692 for ; Wed, 27 Jan 2010 15:43:19 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout6.freenet.de (mout6.freenet.de [IPv6:2001:748:100:40::2:8]) by mx1.freebsd.org (Postfix) with ESMTP id 08B7C8FC15 for ; Wed, 27 Jan 2010 15:43:19 +0000 (UTC) Received: from [195.4.92.17] (helo=7.mx.freenet.de) by mout6.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.70 #1) id 1NaA32-000883-Vw; Wed, 27 Jan 2010 16:43:16 +0100 Received: from p57ae1733.dip0.t-ipconnect.de ([87.174.23.51]:20459 helo=ernst.jennejohn.org) by 7.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #94) id 1NaA2y-0004Q9-Ce; Wed, 27 Jan 2010 16:43:15 +0100 Date: Wed, 27 Jan 2010 16:42:56 +0100 From: Gary Jennejohn To: Brandon Falk Message-ID: <20100127164256.2a06177a@ernst.jennejohn.org> In-Reply-To: <4B604B43.7010203@gamozo.org> References: <4B604B43.7010203@gamozo.org> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.16.2; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Leaks in libc? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2010 15:43:19 -0000 On Wed, 27 Jan 2010 08:18:43 -0600 Brandon Falk wrote: > The simple program: >=20 > #include > #include >=20 > int main() > { > puts("Apple cider"); > return 0; > } >=20 > Yields the following result in valgrind: >=20 > =3D=3D4703=3D=3D Memcheck, a memory error detector > =3D=3D4703=3D=3D Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward= et al. > =3D=3D4703=3D=3D Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyr= ight info > =3D=3D4703=3D=3D Command: ./a.out > =3D=3D4703=3D=3D > Apple cider > =3D=3D4703=3D=3D > =3D=3D4703=3D=3D HEAP SUMMARY: > =3D=3D4703=3D=3D in use at exit: 4,096 bytes in 1 blocks > =3D=3D4703=3D=3D total heap usage: 1 allocs, 0 frees, 4,096 bytes alloc= ated > =3D=3D4703=3D=3D > =3D=3D4703=3D=3D LEAK SUMMARY: > =3D=3D4703=3D=3D definitely lost: 0 bytes in 0 blocks > =3D=3D4703=3D=3D indirectly lost: 0 bytes in 0 blocks > =3D=3D4703=3D=3D possibly lost: 0 bytes in 0 blocks > =3D=3D4703=3D=3D still reachable: 0 bytes in 0 blocks > =3D=3D4703=3D=3D suppressed: 4,096 bytes in 1 blocks > =3D=3D4703=3D=3D > =3D=3D4703=3D=3D For counts of detected and suppressed errors, rerun with= : -v > =3D=3D4703=3D=3D ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 f= rom 0) >=20 > Any ideas why the standard libraries are leaking like this? Is it=20 > perhaps a bug with valgrind, or maybe FreeBSD automatically cleans up so= =20 > they took the cleanup out of their libc? >=20 > FreeBSD 8.0 x86_64 >=20 =46rom the valgrind FAQ "suppressed" means that a leak error has been suppressed. There are some suppressions in the default suppression files. You can ignore suppressed errors. AFAIK all variants of U*X recover memory used by applications when the applications exit. This is not a real leak. --- Gary Jennejohn