All of lore.kernel.org
 help / color / mirror / Atom feed
* memory leaks in numa_run_on_node
@ 2013-06-27  0:05 Andrew J. Schorr
  2013-06-27  0:31 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew J. Schorr @ 2013-06-27  0:05 UTC (permalink / raw)
  To: linux-numa

Hi,

According to valgrind, this trivial program has a bunch of memory leaks:

bash$ cat numaleak.c 
#include <numa.h>

int
main(int argc, char **argv)
{
   numa_run_on_node(0);
   return 0;
}

bash-4.2$ valgrind --leak-check=full --show-reachable=yes numaleak
==17943== Memcheck, a memory error detector
==17943== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==17943== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==17943== Command: numaleak
==17943== 
==17943== 
==17943== HEAP SUMMARY:
==17943==     in use at exit: 4,144 bytes in 3 blocks
==17943==   total heap usage: 35 allocs, 32 frees, 74,720 bytes allocated
==17943== 
==17943== 16 bytes in 1 blocks are still reachable in loss record 1 of 3
==17943==    at 0x4C2B78F: malloc (vg_replace_malloc.c:270)
==17943==    by 0x4E36F55: numa_bitmask_alloc (in /usr/lib64/libnuma.so.1)
==17943==    by 0x4E38B2E: numa_node_to_cpus (in /usr/lib64/libnuma.so.1)
==17943==    by 0x4E39449: numa_run_on_node (in /usr/lib64/libnuma.so.1)
==17943==    by 0x40055A: main (numaleak.c:6)
==17943== 
==17943== 32 bytes in 1 blocks are still reachable in loss record 2 of 3
==17943==    at 0x4C29A84: calloc (vg_replace_malloc.c:593)
==17943==    by 0x4E36F72: numa_bitmask_alloc (in /usr/lib64/libnuma.so.1)
==17943==    by 0x4E38B2E: numa_node_to_cpus (in /usr/lib64/libnuma.so.1)
==17943==    by 0x4E39449: numa_run_on_node (in /usr/lib64/libnuma.so.1)
==17943==    by 0x40055A: main (numaleak.c:6)
==17943== 
==17943== 4,096 bytes in 1 blocks are still reachable in loss record 3 of 3
==17943==    at 0x4C29A84: calloc (vg_replace_malloc.c:593)
==17943==    by 0x4E38668: ??? (in /usr/lib64/libnuma.so.1)
==17943==    by 0x4E38B18: numa_node_to_cpus (in /usr/lib64/libnuma.so.1)
==17943==    by 0x4E39449: numa_run_on_node (in /usr/lib64/libnuma.so.1)
==17943==    by 0x40055A: main (numaleak.c:6)
==17943== 
==17943== LEAK SUMMARY:
==17943==    definitely lost: 0 bytes in 0 blocks
==17943==    indirectly lost: 0 bytes in 0 blocks
==17943==      possibly lost: 0 bytes in 0 blocks
==17943==    still reachable: 4,144 bytes in 3 blocks
==17943==         suppressed: 0 bytes in 0 blocks
==17943== 
==17943== For counts of detected and suppressed errors, rerun with: -v
==17943== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

This is using version 2.0.8 of numactl on a Fedora 16 system.
There are similar memory leaks in numa_run_on_node_mask().

Regards,
Andy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-27  1:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-27  0:05 memory leaks in numa_run_on_node Andrew J. Schorr
2013-06-27  0:31 ` Andi Kleen
2013-06-27  0:53   ` Andrew J. Schorr
2013-06-27  1:15     ` Andrew J. Schorr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.