Hi,

Here is the valgrind output I get for the test cases with current trunk,

--
[r...@resman2 tests]# sh runlibcgrouptest.sh                                    
                                                                                
                                                                                
                                    
                                                                                
                                                                                
                                                                                
                                    
Running first set of testcases                                                  
                                                                                
                                                                                
                                    
==============================                                                  
                                                                                
                                                                                
                                    
==15299== Memcheck, a memory error detector.                                    
                                                                                
                                                                                
                                    
==15299== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.       
                                                                                
                                                                                
                                    
==15299== Using LibVEX rev 1732, a library for dynamic binary translation.      
                                                                                
                                                                                
                                    
==15299== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.             
                                                                                
                                                                                
                                    
==15299== Using valgrind-3.2.3, a dynamic binary instrumentation framework.     
                                                                                
                                                                                
                                    
==15299== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.       
                                                                                
                                                                                
                                    
==15299== For more details, rerun with: -v                                      
                                                                                
                                                                                
                                    
==15299==                                                                       
                                                                                
                                                                                
                                    
C:DBG: fs_mounted as recieved from script=0                                     
                                                                                
                                                                                
                                    
TEST 1:PASS : cgroup_init()                      Ret Value = 50001              
                                                                                
                                                                                
                                    
TEST 2:PASS : cgroup_attach_task()               Ret Value = 50014       
Parameter nullcgroup                                                            
                                                                                
                                           
TEST 3:PASS : cgroup_new_cgroup()                Ret Value = 0                  
                                                                                
                                                                                
                                    
TEST 4:PASS : cgroup_create_cgroup()             Ret Value = 50014              
                                                                                
                                                                                
                                    
TEST 5:PASS : cgroup_delete_cgroup()             Ret Value = 50014              
                                                                                
                                                                                
                                    
TEST 6:PASS : cgroup_create_cgroup()             Ret Value = 50014              
                                                                                
                                                                                
                                    
TEST 7:PASS : cgroup_delete_cgroup()             Ret Value = 50014              
                                                                                
                                                                                
                                    
TEST 8:PASS : cgroup_add_controller()            Ret Value = 0                  
                                                                                
                                                                                
                                    
TEST 9:PASS : cgroup_add_controller()            Ret Value = 0                  
                                                                                
                                                                                
                                    
TEST10:PASS : cgroup_add_controller()            Ret Value = 0                  
                                                                                
                                                                                
                                    
==15299==                                                                       
                                                                                
                                                                                
                                    
==15299== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 1)        
                                                                                
                                                                                
                                    
==15299== malloc/free: in use at exit: 1,730 bytes in 7 blocks.                 
                                                                                
                                                                                
                                    
==15299== malloc/free: 15 allocs, 8 frees, 31,086 bytes allocated.              
                                                                                
                                                                                
                                    
==15299== For counts of detected errors, rerun with: -v                         
                                                                                
                                                                                
                                    
==15299== searching for pointers to 7 not-freed blocks.                         
                                                                                
                                                                                
                                    
==15299== checked 6,892,504 bytes.                                              
                                                                                
                                                                                
                                    
==15299==                                                                       
                                                                                
                                                                                
                                    
==15299== LEAK SUMMARY:                                                         
                                                                                
                                                                                
                                    
==15299==    definitely lost: 0 bytes in 0 blocks.                              
                                                                                
                                                                                
                                    
==15299==      possibly lost: 0 bytes in 0 blocks.                              
                                                                                
                                                                                
                                    
==15299==    still reachable: 1,730 bytes in 7 blocks.                          
                                                                                
                                                                                
                                    
==15299==         suppressed: 0 bytes in 0 blocks.                              
                                                                                
                                                                                
                                    
==15299== Reachable blocks (those to which a pointer was found) are not shown.  
                                                                                
                                                                                
                                    
==15299== To see them, rerun with: --leak-check=full --show-reachable=yes       
                                                                                
                                                                                
                                    

Running second set of testcases
============================== 
==15315== Memcheck, a memory error detector.
==15315== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==15315== Using LibVEX rev 1732, a library for dynamic binary translation.
==15315== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.       
==15315== Using valgrind-3.2.3, a dynamic binary instrumentation framework.
==15315== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.  
==15315== For more details, rerun with: -v                                 
==15315==                                                                  
C:DBG: fs_mounted as recieved from script=1                                
C:DBG: mountpoint1 as recieved from script=/dev/cgroup_controllers-1       
sanity check pass. cgroup                                                  
TEST 1:PASS : cgroup_attach_task()               Ret Value = 50014       
Parameter nullcgroup
TEST 2:PASS : cgroup_init()                      Ret Value = 0                  
             
TEST 3:PASS : cgroup_attach_task()               Ret Value = 0   Task found in 
group/s       
TEST 4:PASS : cgroup_attach_task_pid()           Ret Value = 50016              
             
TEST 5:PASS : cgroup_new_cgroup()                Ret Value = 0                  
             
TEST 6:PASS : cgroup_create_cgroup()             Ret Value = 0   group found in 
filesystem   
TEST 7:PASS : cgroup_attach_task()               Ret Value = 0   Task found in 
group/s       
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x4A07167: strncat (mc_replace_strmem.c:218)                    
             
==15315==    by 0x40453D: main (libcgrouptest01.c:1255)                         
             
==15315==                                                                       
             
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x4A077BF: strcpy (mc_replace_strmem.c:272)                     
             
==15315==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)                     
             
==15315==    by 0x40454A: main (libcgrouptest01.c:251)                          
             
==15315==                                                                       
             
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x4A077D0: strcpy (mc_replace_strmem.c:272)                     
             
==15315==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)                     
             
==15315==    by 0x40454A: main (libcgrouptest01.c:251)                          
             
==15315==                                                                       
             
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x40160E: group_modified(char*, int) (libcgrouptest01.c:1072)   
             
==15315==    by 0x40455D: main (libcgrouptest01.c:253)                          
             
==15315==                                                                       
             
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x4A06837: strncmp (mc_replace_strmem.c:318)                    
             
==15315==    by 0x40163B: group_modified(char*, int) (libcgrouptest01.c:1072)   
             
==15315==    by 0x40455D: main (libcgrouptest01.c:253)                          
             
==15315==                                                                       
             
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x4A0683C: strncmp (mc_replace_strmem.c:318)                    
             
==15315==    by 0x40163B: group_modified(char*, int) (libcgrouptest01.c:1072)   
             
==15315==    by 0x40455D: main (libcgrouptest01.c:253)                          
             
==15315==                                                                       
             
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x4A06848: strncmp (mc_replace_strmem.c:318)                    
             
==15315==    by 0x40163B: group_modified(char*, int) (libcgrouptest01.c:1072)   
             
==15315==    by 0x40455D: main (libcgrouptest01.c:253)                          
             
TEST 8:FAIL : cgroup_modify_cgroup()             Ret Value = 0   Parameter same 
cgroup       
TEST 9:PASS : cgroup_new_cgroup()                Ret Value = 0                  
             
==15315==                                                                       
             
==15315== Conditional jump or move depends on uninitialised value(s)            
             
==15315==    at 0x4A077BF: strcpy (mc_replace_strmem.c:272)                     
             
==15315==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)                     
             
==15315==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15315==    by 0x404619: main (libcgrouptest01.c:285)                          
                                               
==15315==                                                                       
                                               
==15315== Conditional jump or move depends on uninitialised value(s)            
                                               
==15315==    at 0x4A077D0: strcpy (mc_replace_strmem.c:272)                     
                                               
==15315==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)                     
                                               
==15315==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15315==    by 0x404619: main (libcgrouptest01.c:285)                          
                                               
TEST10:PASS : cgroup_modify_cgroup()             Ret Value = 0                  
                                               
TEST11:PASS : cgroup_modify_cgroup()             Ret Value = 50007              
                                               
TEST12:PASS : cgroup_new_cgroup()                Ret Value = 0                  
                                               
==15315==                                                                       
                                               
==15315== Conditional jump or move depends on uninitialised value(s)            
                                               
==15315==    at 0x4A077BF: strcpy (mc_replace_strmem.c:272)                     
                                               
==15315==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)                     
                                               
==15315==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15315==    by 0x4046A5: main (libcgrouptest01.c:313)                          
                                               
==15315==                                                                       
                                               
==15315== Conditional jump or move depends on uninitialised value(s)            
                                               
==15315==    at 0x4A077D0: strcpy (mc_replace_strmem.c:272)                     
                                               
==15315==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)                     
                                               
==15315==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15315==    by 0x4046A5: main (libcgrouptest01.c:313)                          
                                               
TEST13:PASS : cgroup_modify_cgroup()             Ret Value = 0                  
                                               
TEST14:PASS : cgroup_get_cgroup()                Ret Value = 50007       
Parameter nullcgroup                                  
TEST15:PASS : cgroup_get_cgroup()                Ret Value = 50002       
Parameter not created group                           
TEST16:PASS : cgroup_get_cgroup()                Ret Value = 0                  
                                               
TEST 0:PASS : cgroup_new_cgroup()                Ret Value = 0                  
                                               
TEST 0:PASS : cgroup_create_cgroup()             Ret Value = 0   group found in 
filesystem                                     
TEST17:FAIL : cgroup_get_cgroup()                Ret Value = 50017              
                                               
TEST16:PASS : cgroup_delete_cgroup()             Ret Value = 0   Group deleted 
from filesystem                                 
TEST17:PASS : cgroup_create_cgroup()             Ret Value = 50007              
                                               
TEST18:PASS : cgroup_delete_cgroup()             Ret Value = 50007              
                                               
TEST19:PASS : cgroup_compare_cgroup()            Ret Value = 50011       
Parameter nullcgroup                                  
TEST20:PASS : cgroup_compare_cgroup()            Ret Value = 0                  
                                               
TEST21:PASS : cgroup_compare_cgroup()            Ret Value = 50017              
                                               
==15315==                                                                       
                                               
==15315== ERROR SUMMARY: 57 errors from 11 contexts (suppressed: 4 from 1)      
                                               
==15315== malloc/free: in use at exit: 9,530 bytes in 14 blocks.                
                                               
==15315== malloc/free: 184 allocs, 170 frees, 248,828 bytes allocated.          
                                               
==15315== For counts of detected errors, rerun with: -v                         
                                               
==15315== searching for pointers to 14 not-freed blocks.                        
                                               
==15315== checked 6,914,368 bytes.                                              
                                               
==15315==                                                                       
                                               
==15315==                                                                       
                                               
==15315== 40 bytes in 1 blocks are definitely lost in loss record 2 of 4        
                                               
==15315==    at 0x4A059F6: malloc (vg_replace_malloc.c:149)                     
                                               
==15315==    by 0x40132C: check_fsmounted(int) (libcgrouptest01.c:1171)         
                                               
==15315==    by 0x404306: main (libcgrouptest01.c:168)                          
                                               
==15315==                                                                       
                                               
==15315==                                                                       
                                               
==15315== 4,920 bytes in 1 blocks are definitely lost in loss record 4 of 4     
                                               
==15315==    at 0x4A04D1F: calloc (vg_replace_malloc.c:279)                     
                                               
==15315==    by 0x4C400AF: cgroup_new_cgroup (wrapper.c:28)                     
                                               
==15315==    by 0x403DAB: test_cgroup_get_cgroup(int, int, int) 
(libcgrouptest01.c:1342)                                       
==15315==    by 0x4046B4: main (libcgrouptest01.c:324)                          
                                               
==15315==                                                                       
                                               
==15315== LEAK SUMMARY:                                                         
                                               
==15315==    definitely lost: 4,960 bytes in 2 blocks.                          
                                               
==15315==      possibly lost: 0 bytes in 0 blocks.                              
                                               
==15315==    still reachable: 4,570 bytes in 12 blocks.                         
                                               
==15315==         suppressed: 0 bytes in 0 blocks.                              
                                               
==15315== Reachable blocks (those to which a pointer was found) are not shown.  
                                               
==15315== To see them, rerun with: --leak-check=full --show-reachable=yes       
                                               
Cleanup done                                                                    
                                               

Running third set of testcases
==============================
==15366== Memcheck, a memory error detector.
==15366== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==15366== Using LibVEX rev 1732, a library for dynamic binary translation.
==15366== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.       
==15366== Using valgrind-3.2.3, a dynamic binary instrumentation framework.
==15366== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.  
==15366== For more details, rerun with: -v                                 
==15366==                                                                  
C:DBG: fs_mounted as recieved from script=2                                
C:DBG: mountpoint1 as recieved from script=/dev/cgroup_controllers-1       
C:DBG: mountpoint2 as recieved from script=/dev/cgroup_controllers-2       
sanity check pass. cgroup                                                  
TEST 1:PASS : cgroup_init()                      Ret Value = 0             
TEST 2:PASS : cgroup_attach_task()               Ret Value = 0   Task found in 
group/s
TEST 3:PASS : cgroup_new_cgroup()                Ret Value = 0                  
      
TEST 4:PASS : cgroup_create_cgroup()             Ret Value = 0   group found in 
filesystem
TEST 5:PASS : cgroup_new_cgroup()                Ret Value = 0                  
          
TEST 6:PASS : cgroup_create_cgroup()             Ret Value = 0   group found in 
filesystem
TEST 7:PASS : cgroup_create_cgroup()             Ret Value = 0   group found in 
filesystem
TEST 8:PASS : cgroup_attach_task()               Ret Value = 0   Task found in 
group/s    
TEST 9:PASS : cgroup_attach_task()               Ret Value = 0   Task found in 
group/s    
TEST10:PASS : cgroup_new_cgroup()                Ret Value = 0                  
          
TEST11:PASS : cgroup_attach_task()               Ret Value = 50002       
Parameter not created group
TEST12:PASS : cgroup_new_cgroup()                Ret Value = 0                  
                    
==15366== Conditional jump or move depends on uninitialised value(s)            
                    
==15366==    at 0x4A077BF: strcpy (mc_replace_strmem.c:272)                     
                    
==15366==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)                     
                    
==15366==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15366==    by 0x404A74: main (libcgrouptest01.c:497)
==15366==
==15366== Conditional jump or move depends on uninitialised value(s)
==15366==    at 0x4A077D0: strcpy (mc_replace_strmem.c:272)
==15366==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)
==15366==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15366==    by 0x404A74: main (libcgrouptest01.c:497)
TEST13:PASS : cgroup_modify_cgroup()             Ret Value = 0
TEST14:PASS : cgroup_new_cgroup()                Ret Value = 0
==15366==
==15366== Conditional jump or move depends on uninitialised value(s)
==15366==    at 0x4A077BF: strcpy (mc_replace_strmem.c:272)
==15366==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)
==15366==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15366==    by 0x404ABC: main (libcgrouptest01.c:518)
==15366==
==15366== Conditional jump or move depends on uninitialised value(s)
==15366==    at 0x4A077D0: strcpy (mc_replace_strmem.c:272)
==15366==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)
==15366==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15366==    by 0x404ABC: main (libcgrouptest01.c:518)
TEST15:PASS : cgroup_modify_cgroup()             Ret Value = 0
TEST16:PASS : cgroup_delete_cgroup()             Ret Value = 0   Group deleted 
from filesystem
TEST17:PASS : cgroup_delete_cgroup()             Ret Value = 0   Group deleted 
from filesystem
TEST18:PASS : cgroup_new_cgroup()                Ret Value = 0
TEST19:PASS : cgroup_create_cgroup()             Ret Value = 0   group found 
under both controllers
TEST20:PASS : cgroup_attach_task()               Ret Value = 0   Task found in 
group/s
TEST21:PASS : cgroup_new_cgroup()                Ret Value = 0
==15366==
==15366== Conditional jump or move depends on uninitialised value(s)
==15366==    at 0x4A077BF: strcpy (mc_replace_strmem.c:272)
==15366==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)
==15366==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15366==    by 0x404C47: main (libcgrouptest01.c:621)
==15366==
==15366== Conditional jump or move depends on uninitialised value(s)
==15366==    at 0x4A077D0: strcpy (mc_replace_strmem.c:272)
==15366==    by 0x4C3E481: cgroup_modify_cgroup (api.c:998)
==15366==    by 0x402A9B: test_cgroup_modify_cgroup(int, cgroup*, char const*, 
int, int, int, int, int) (libcgrouptest01.c:888)
==15366==    by 0x404C47: main (libcgrouptest01.c:621)
TEST22:PASS : cgroup_modify_cgroup()             Ret Value = 0   group modified 
under both controllers
TEST23:PASS : cgroup_delete_cgroup()             Ret Value = 0   Group deleted 
from filesystem
TEST 0:PASS : cgroup_new_cgroup()                Ret Value = 0
TEST 0:PASS : cgroup_create_cgroup()             Ret Value = 0   group found in 
filesystem
TEST24:FAIL : cgroup_get_cgroup()                Ret Value = 50018
==15366==
==15366== ERROR SUMMARY: 84 errors from 6 contexts (suppressed: 4 from 1)
==15366== malloc/free: in use at exit: 78,670 bytes in 35 blocks.
==15366== malloc/free: 193 allocs, 158 frees, 248,091 bytes allocated.
==15366== For counts of detected errors, rerun with: -v
==15366== searching for pointers to 35 not-freed blocks.
==15366== checked 6,944,920 bytes.
==15366==
==15366==
==15366== 40 bytes in 1 blocks are definitely lost in loss record 2 of 6
==15366==    at 0x4A059F6: malloc (vg_replace_malloc.c:149)
==15366==    by 0x40132C: check_fsmounted(int) (libcgrouptest01.c:1171)
==15366==    by 0x4048B0: main (libcgrouptest01.c:360)
==15366==
==15366==
==15366== 70,084 (19,680 direct, 50,404 indirect) bytes in 4 blocks are 
definitely lost in loss record 4 of 6
==15366==    at 0x4A04D1F: calloc (vg_replace_malloc.c:279)
==15366==    by 0x4C400AF: cgroup_new_cgroup (wrapper.c:28)
==15366==    by 0x4025C8: new_cgroup(char*, char*, char*, int, int) 
(libcgrouptest01.c:1127)
==15366==    by 0x402957: create_new_cgroup_ds(int, char const*, int, int) 
(libcgrouptest01.c:743)
==15366==    by 0x404A42: main (libcgrouptest01.c:484)
==15366==
==15366== LEAK SUMMARY:
==15366==    definitely lost: 19,720 bytes in 5 blocks.
==15366==    indirectly lost: 50,404 bytes in 11 blocks.
==15366==      possibly lost: 0 bytes in 0 blocks.
==15366==    still reachable: 8,546 bytes in 19 blocks.
==15366==         suppressed: 0 bytes in 0 blocks.
==15366== Reachable blocks (those to which a pointer was found) are not shown.
==15366== To see them, rerun with: --leak-check=full --show-reachable=yes
Cleanup done
[r...@resman2 tests]#
--

libcgroup seems to be causing comparitively fewer number of leaks as
opposed to the test cases. Also with the cleanup patches (the patch 3 in
the previously posted patches), the libcgroup entries are significantly
reduced (There is one entry which I cleaning up right now).

Any more hints on various paths to be tested would be great.

Sudhir, I am planning to look at cleaning up the noise generated by the
test suite unless you are already planning to look at it. Can you please
let me know your plans?

Thanks,
-- 
regards,
Dhaval

------------------------------------------------------------------------------
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to