Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2010 08:18:43 -0600
From:      Brandon Falk <falkman@gamozo.org>
To:        freebsd-hackers@freebsd.org
Subject:   Leaks in libc?
Message-ID:  <4B604B43.7010203@gamozo.org>

next in thread | raw e-mail | index | archive | help
The simple program:

#include <stdlib.h>
#include <stdio.h>

int main()
{
        puts("Apple cider");
        return 0;
}

Yields the following result in valgrind:

==4703== Memcheck, a memory error detector
==4703== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==4703== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==4703== Command: ./a.out
==4703==
Apple cider
==4703==
==4703== HEAP SUMMARY:
==4703==     in use at exit: 4,096 bytes in 1 blocks
==4703==   total heap usage: 1 allocs, 0 frees, 4,096 bytes allocated
==4703==
==4703== LEAK SUMMARY:
==4703==    definitely lost: 0 bytes in 0 blocks
==4703==    indirectly lost: 0 bytes in 0 blocks
==4703==      possibly lost: 0 bytes in 0 blocks
==4703==    still reachable: 0 bytes in 0 blocks
==4703==         suppressed: 4,096 bytes in 1 blocks
==4703==
==4703== For counts of detected and suppressed errors, rerun with: -v
==4703== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Any ideas why the standard libraries are leaking like this? Is it 
perhaps a bug with valgrind, or maybe FreeBSD automatically cleans up so 
they took the cleanup out of their libc?

FreeBSD 8.0 x86_64

Thanks,
Brandon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B604B43.7010203>