[augeas-devel] [Augeas] #251: memory leaks in augeas

Augeas trac at fedorahosted.org
Mon Jan 30 10:45:36 UTC 2012


#251: memory leaks in augeas
--------------------+---------------------
 Reporter:  rjones  |       Owner:  lutter
     Type:  defect  |      Status:  new
 Priority:  major   |   Milestone:  next
Component:  Augeas  |     Version:  devel
 Keywords:          |  Blocked By:
 Blocking:          |
--------------------+---------------------
 Running a simple augeas program under valgrind reveals many memory leaks.

 {{{
 #include <stdlib.h>
 #include <augeas.h>

 main ()
 {
   augeas *aug;

   aug = aug_init ("/", NULL, 0);
   if (!aug) { perror ("aug_init"); exit (1); }
   aug_close (aug);
   exit (0);
 }
 }}}

 {{{
 $ gcc -I /usr/include/libxml2 augtest.c -o augtest -laugeas
 $ valgrind --leak-check=full ./augtest
 ==817== Memcheck, a memory error detector
 ==817== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
 ==817== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
 ==817== Command: ./augtest
 ==817==
 ==817==
 ==817== HEAP SUMMARY:
 ==817==     in use at exit: 45,265 bytes in 1,281 blocks
 ==817==   total heap usage: 2,463,711 allocs, 2,462,430 frees, 253,887,232
 bytes allocated
 ==817==
 ==817== 1,060 bytes in 212 blocks are definitely lost in loss record 23 of
 33
 ==817==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
 ==817==    by 0x3F62208744: aug_init (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x400767: main (in /tmp/augtest)
 ==817==
 ==817== 2,445 bytes in 489 blocks are definitely lost in loss record 27 of
 33
 ==817==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
 ==817==    by 0x3F622087AD: aug_init (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x400767: main (in /tmp/augtest)
 ==817==
 ==817== 6,180 (80 direct, 6,100 indirect) bytes in 2 blocks are definitely
 lost in loss record 30 of 33
 ==817==    at 0x4A075B2: realloc (vg_replace_malloc.c:525)
 ==817==    by 0x3F622104D5: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F6222D92B: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F6222734B: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62227BBC: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62223D95: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62207562: aug_load (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62208970: aug_init (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x400767: main (in /tmp/augtest)
 ==817==
 ==817== 35,580 (144 direct, 35,436 indirect) bytes in 3 blocks are
 definitely lost in loss record 33 of 33
 ==817==    at 0x4A05BB4: calloc (vg_replace_malloc.c:467)
 ==817==    by 0x3F62210494: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F6222D300: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F6222734B: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62227BBC: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62223D95: ??? (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62207562: aug_load (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x3F62208970: aug_init (in /usr/lib64/libaugeas.so.0.15.0)
 ==817==    by 0x400767: main (in /tmp/augtest)
 ==817==
 ==817== LEAK SUMMARY:
 ==817==    definitely lost: 3,729 bytes in 706 blocks
 ==817==    indirectly lost: 41,536 bytes in 575 blocks
 ==817==      possibly lost: 0 bytes in 0 blocks
 ==817==    still reachable: 0 bytes in 0 blocks
 ==817==         suppressed: 0 bytes in 0 blocks
 ==817==
 ==817== For counts of detected and suppressed errors, rerun with: -v
 ==817== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 3 from 3)
 }}}

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/251>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list