<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libcg.git/tests, branch fix-initscripts</title>
<subtitle>Unnamed repository; edit this file to name it for gitweb.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/'/>
<entry>
<title>Feature: Provide new libcgroup walk tree API</title>
<updated>2009-02-28T09:27:31+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-02-28T09:27:31+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=bcf5c9ac11e899311ba0f3ba1b551ec62b8602cc'/>
<id>bcf5c9ac11e899311ba0f3ba1b551ec62b8602cc</id>
<content type='text'>
From: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;

Changelog v3..v4

1. Add _end() method for the iterator

Changelog v3..v2

1. Move to iterator based design

Changelog v2..v1

1. Add base path and depth semantics for walking

This patch adds the capability to walk cgroups by providing a new API
called cgroup_walk_tree. The API accepts the controller to walk and the
order in which the directories and files must be visited. The code is
implemented as an iterator, the begin function starts the walk and
we have depth control. The next function gets the following node
and returns ECGEOF when done.

libcgroup.map has been updated to reflect the same change and the prototype
is exported in libcgroup.h.

I've also added test cases (tests/walk_test.c). Sample output is show

root is /cgroup/cpu///
path , parent , relative /, full /cgroup/cpu///
path l3, parent , relative /l3, full /cgroup/cpu///l3
path ll1, parent l3, relative /l3/ll1, full /cgroup/cpu///l3/ll1
path lll1, parent ll1, relative /l3/ll1/lll1, full /cgroup/cpu///l3/ll1/lll1
path l2, parent , relative /l2, full /cgroup/cpu///l2
path ll1, parent l2, relative /l2/ll1, full /cgroup/cpu///l2/ll1
path lll1, parent ll1, relative /l2/ll1/lll1, full /cgroup/cpu///l2/ll1/lll1
path l1, parent , relative /l1, full /cgroup/cpu///l1
path ll1, parent l1, relative /l1/ll1, full /cgroup/cpu///l1/ll1
path lll1, parent ll1, relative /l1/ll1/lll1, full /cgroup/cpu///l1/ll1/lll1
path a, parent , relative /a, full /cgroup/cpu///a
path e, parent a, relative /a/e, full /cgroup/cpu///a/e
path f, parent e, relative /a/e/f, full /cgroup/cpu///a/e/f
path f, parent a, relative /a/f, full /cgroup/cpu///a/f
path x, parent a, relative /a/x, full /cgroup/cpu///a/x
path b, parent a, relative /a/b, full /cgroup/cpu///a/b
path c, parent b, relative /a/b/c, full /cgroup/cpu///a/b/c
path d, parent c, relative /a/b/c/d, full /cgroup/cpu///a/b/c/d
path default, parent , relative /default, full /cgroup/cpu///default
root is /cgroup/cpu//a/
path , parent , relative /, full /cgroup/cpu//a/
path e, parent , relative /e, full /cgroup/cpu//a/e
path f, parent e, relative /e/f, full /cgroup/cpu//a/e/f
path f, parent , relative /f, full /cgroup/cpu//a/f
path x, parent , relative /x, full /cgroup/cpu//a/x
path b, parent , relative /b, full /cgroup/cpu//a/b
path c, parent b, relative /b/c, full /cgroup/cpu//a/b/c
Walking the first 5 nodes
root is /cgroup/cpu///
path , parent , relative /, full /cgroup/cpu///
path l3, parent , relative /l3, full /cgroup/cpu///l3
path ll1, parent l3, relative /l3/ll1, full /cgroup/cpu///l3/ll1
path lll1, parent ll1, relative /l3/ll1/lll1, full /cgroup/cpu///l3/ll1/lll1


NOTE: Parent directory is represented by an empty (not NULL) string "".
The length of the string is 0.

Signed-off-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@356 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;

Changelog v3..v4

1. Add _end() method for the iterator

Changelog v3..v2

1. Move to iterator based design

Changelog v2..v1

1. Add base path and depth semantics for walking

This patch adds the capability to walk cgroups by providing a new API
called cgroup_walk_tree. The API accepts the controller to walk and the
order in which the directories and files must be visited. The code is
implemented as an iterator, the begin function starts the walk and
we have depth control. The next function gets the following node
and returns ECGEOF when done.

libcgroup.map has been updated to reflect the same change and the prototype
is exported in libcgroup.h.

I've also added test cases (tests/walk_test.c). Sample output is show

root is /cgroup/cpu///
path , parent , relative /, full /cgroup/cpu///
path l3, parent , relative /l3, full /cgroup/cpu///l3
path ll1, parent l3, relative /l3/ll1, full /cgroup/cpu///l3/ll1
path lll1, parent ll1, relative /l3/ll1/lll1, full /cgroup/cpu///l3/ll1/lll1
path l2, parent , relative /l2, full /cgroup/cpu///l2
path ll1, parent l2, relative /l2/ll1, full /cgroup/cpu///l2/ll1
path lll1, parent ll1, relative /l2/ll1/lll1, full /cgroup/cpu///l2/ll1/lll1
path l1, parent , relative /l1, full /cgroup/cpu///l1
path ll1, parent l1, relative /l1/ll1, full /cgroup/cpu///l1/ll1
path lll1, parent ll1, relative /l1/ll1/lll1, full /cgroup/cpu///l1/ll1/lll1
path a, parent , relative /a, full /cgroup/cpu///a
path e, parent a, relative /a/e, full /cgroup/cpu///a/e
path f, parent e, relative /a/e/f, full /cgroup/cpu///a/e/f
path f, parent a, relative /a/f, full /cgroup/cpu///a/f
path x, parent a, relative /a/x, full /cgroup/cpu///a/x
path b, parent a, relative /a/b, full /cgroup/cpu///a/b
path c, parent b, relative /a/b/c, full /cgroup/cpu///a/b/c
path d, parent c, relative /a/b/c/d, full /cgroup/cpu///a/b/c/d
path default, parent , relative /default, full /cgroup/cpu///default
root is /cgroup/cpu//a/
path , parent , relative /, full /cgroup/cpu//a/
path e, parent , relative /e, full /cgroup/cpu//a/e
path f, parent e, relative /e/f, full /cgroup/cpu//a/e/f
path f, parent , relative /f, full /cgroup/cpu//a/f
path x, parent , relative /x, full /cgroup/cpu//a/x
path b, parent , relative /b, full /cgroup/cpu//a/b
path c, parent b, relative /b/c, full /cgroup/cpu//a/b/c
Walking the first 5 nodes
root is /cgroup/cpu///
path , parent , relative /, full /cgroup/cpu///
path l3, parent , relative /l3, full /cgroup/cpu///l3
path ll1, parent l3, relative /l3/ll1, full /cgroup/cpu///l3/ll1
path lll1, parent ll1, relative /l3/ll1/lll1, full /cgroup/cpu///l3/ll1/lll1


NOTE: Parent directory is represented by an empty (not NULL) string "".
The length of the string is 0.

Signed-off-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@356 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgroup test: Change dbg to cgroup_dbg</title>
<updated>2009-02-27T20:25:36+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-02-27T20:25:36+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=8044128fa6322f391d4629072954e24ef1c72e4f'/>
<id>8044128fa6322f391d4629072954e24ef1c72e4f</id>
<content type='text'>
Since cgroup_dbg is defined on the basis of CGROUP_DBG, we get
libcgrouptest.h and libcg_ba.cpp to include config.h and change
dbg to cgroup_dbg.

Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Cc: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Cc: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@354 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since cgroup_dbg is defined on the basis of CGROUP_DBG, we get
libcgrouptest.h and libcg_ba.cpp to include config.h and change
dbg to cgroup_dbg.

Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Cc: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Cc: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@354 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest: rename get_controller() to is_subsystem_enabled()</title>
<updated>2009-01-14T17:33:05+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-14T17:33:05+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=267249123c6e97d8b3f13db1cf0f260f8244705a'/>
<id>267249123c6e97d8b3f13db1cf0f260f8244705a</id>
<content type='text'>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

This patch renames the function get_controllers() to a more
meaningful name is_subsystem_enabled().

history:
The code in the patch is part of a patch sent in an earlier patchset,
which somehow got dropped (looks an older version of that patch was
merged to the tree). Adding this patch makes everything upstream upto
the discussion held on the list.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@314 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

This patch renames the function get_controllers() to a more
meaningful name is_subsystem_enabled().

history:
The code in the patch is part of a patch sent in an earlier patchset,
which somehow got dropped (looks an older version of that patch was
merged to the tree). Adding this patch makes everything upstream upto
the discussion held on the list.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@314 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest: open may fail wrt permissions, so use stat</title>
<updated>2009-01-09T16:30:28+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-09T16:30:28+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=3ab8f66d9afc44d39b6a7b95a9651d744b74bb23'/>
<id>3ab8f66d9afc44d39b6a7b95a9651d744b74bb23</id>
<content type='text'>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

The patch was adding a warning
"test_functions.c:359: warning: unused variable ‘ret’"
Hence resending correcting it.

open may fail in case there is not proper permissions and hence giving
a wrong result. This patch uses stat instead which is always better.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@312 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

The patch was adding a warning
"test_functions.c:359: warning: unused variable ‘ret’"
Hence resending correcting it.

open may fail in case there is not proper permissions and hence giving
a wrong result. This patch uses stat instead which is always better.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@312 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest: let check_task() receive a pid as argument</title>
<updated>2009-01-09T16:27:48+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-09T16:27:48+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=5e0a47a2382b58e15336a742017a57e24611375f'/>
<id>5e0a47a2382b58e15336a742017a57e24611375f</id>
<content type='text'>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

The patch would get a reject because of modifications in an earlier
patch. Hence updating the patch by fixing the reject.

This patch makes the function check_task() capable of checking if a pid
other than the calling process is attached to a particlular group. Earlier
it was checking for the calling process only.
For optimization purpose 0 is used to indicate that the task to be attached
is the current task and hence call cgroup_gettid() only once.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@311 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

The patch would get a reject because of modifications in an earlier
patch. Hence updating the patch by fixing the reject.

This patch makes the function check_task() capable of checking if a pid
other than the calling process is attached to a particlular group. Earlier
it was checking for the calling process only.
For optimization purpose 0 is used to indicate that the task to be attached
is the current task and hence call cgroup_gettid() only once.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@311 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest:attach exclusive pid support in test_cgroup_attach_task() function</title>
<updated>2009-01-09T16:26:15+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-09T16:26:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=216ef3fa583b751c3f76f8812f947fe3b61c58d9'/>
<id>216ef3fa583b751c3f76f8812f947fe3b61c58d9</id>
<content type='text'>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

The function test_attach_task_pid() was attaching the process calling the
function to a group and did not have support to take any pid for attaching
it to a group. This patch does that.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@310 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

The function test_attach_task_pid() was attaching the process calling the
function to a group and did not have support to take any pid for attaching
it to a group. This patch does that.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@310 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest: Move functions into a new file to reuse</title>
<updated>2009-01-09T16:23:01+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-09T16:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=8b53bf5107f1e7540e91972b2bebf8484fa43fa5'/>
<id>8b53bf5107f1e7540e91972b2bebf8484fa43fa5</id>
<content type='text'>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

There were some coding style warnings that have been fixed in this
patch. Basicaly the ones reported by checkpatch.pl


This patch puts the test functions in a separate file so that they
can be reused for further testing. Some of the functions were static
and hence changed to be non static. It also edits the Makefile so
that the patch compiles.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@309 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

There were some coding style warnings that have been fixed in this
patch. Basicaly the ones reported by checkpatch.pl


This patch puts the test functions in a separate file so that they
can be reused for further testing. Some of the functions were static
and hence changed to be non static. It also edits the Makefile so
that the patch compiles.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;



git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@309 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest: Avoid external variables usage</title>
<updated>2009-01-09T10:19:02+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-09T10:19:02+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=a6fd09eca79d1626bba110fb2dc77c00a8eddf24'/>
<id>a6fd09eca79d1626bba110fb2dc77c00a8eddf24</id>
<content type='text'>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

A lack of proper initial thought let me use some variables globaly, which
is not a good idea at all. However fixing this issue at this stage is not
very good from the point that it changes variables for a lot of functions.
But still it has to be done for a better and reusable code. This patch does
that while putting related variables in meaningful structs.
Thanks to Balbir for a good suggestion.

TODO:
Fill these data structures from a configuration file after analyzing
requirements from different test functions.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@307 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;

A lack of proper initial thought let me use some variables globaly, which
is not a good idea at all. However fixing this issue at this stage is not
very good from the point that it changes variables for a lot of functions.
But still it has to be done for a better and reusable code. This patch does
that while putting related variables in meaningful structs.
Thanks to Balbir for a good suggestion.

TODO:
Fill these data structures from a configuration file after analyzing
requirements from different test functions.

Signed-off-by: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@307 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest: Cleanup valgrind output for libcgroup tests</title>
<updated>2009-01-05T16:25:54+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-05T16:25:54+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=3fc3c9027a4d41b09686ee8298259c99a8c74c4d'/>
<id>3fc3c9027a4d41b09686ee8298259c99a8c74c4d</id>
<content type='text'>
Fixes a few memory leaks, and leaked file handles.

[root@gondor tests]# make
g++ -g -O2 -Wall -DDEBUG -I .. -o libcgrouptest01 libcgrouptest01.c -L .. -lcgroup -lpthread
libcgrouptest01.c: In function ‘int group_modified(char*, int)’:
libcgrouptest01.c:1060: warning: format ‘%d’ expects type ‘int*’, but argument 3 has type ‘bool*’
s[root@gondor tests]# sh runlibcgrouptest.sh

Running first set of testcases
==============================
==14758== Memcheck, a memory error detector.
==14758== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==14758== Using LibVEX rev 1804, a library for dynamic binary translation.
==14758== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==14758== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==14758== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==14758== For more details, rerun with: -v
==14758==
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
==14758==
==14758== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 18 from 1)
==14758== malloc/free: in use at exit: 0 bytes in 0 blocks.
==14758== malloc/free: 18 allocs, 18 frees, 32,293 bytes allocated.
==14758== For counts of detected errors, rerun with: -v
==14758== All heap blocks were freed -- no leaks are possible.

Running second set of testcases
==============================
==14774== Memcheck, a memory error detector.
==14774== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==14774== Using LibVEX rev 1804, a library for dynamic binary translation.
==14774== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==14774== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==14774== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==14774== For more details, rerun with: -v
==14774==
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
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x40070D8: strncat (mc_replace_strmem.c:214)
==14774==    by 0x804BC92: main (libcgrouptest01.c:1271)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804BC9D: main (libcgrouptest01.c:252)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804BC9D: main (libcgrouptest01.c:252)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x8049471: _ZL14group_modifiedPci (libcgrouptest01.c:1076)
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
==14774==
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x8049479: _ZL14group_modifiedPci (libcgrouptest01.c:1076)
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007470: strncmp (mc_replace_strmem.c:314)
==14774==    by 0x804949B: _ZL14group_modifiedPci (libcgrouptest01.c:1076)
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
TEST 8:PASS : cgroup_modify_cgroup()             Ret Value = 0   Parameter same cgroup
TEST 9:PASS : cgroup_new_cgroup()                Ret Value = 0
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BD35: main (libcgrouptest01.c:286)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BD35: main (libcgrouptest01.c:286)
TEST10:PASS : cgroup_modify_cgroup()             Ret Value = 0
TEST11:PASS : cgroup_modify_cgroup()             Ret Value = 50007
TEST12:PASS : cgroup_new_cgroup()                Ret Value = 0
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BDF3: main (libcgrouptest01.c:314)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BDF3: main (libcgrouptest01.c:314)
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
==14774==
==14774== ERROR SUMMARY: 45 errors from 10 contexts (suppressed: 18 from 1)
==14774== malloc/free: in use at exit: 0 bytes in 0 blocks.
==14774== malloc/free: 187 allocs, 187 frees, 234,711 bytes allocated.
==14774== For counts of detected errors, rerun with: -v
==14774== All heap blocks were freed -- no leaks are possible.
Cleanup done

Running third set of testcases
==============================
==14827== Memcheck, a memory error detector.
==14827== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==14827== Using LibVEX rev 1804, a library for dynamic binary translation.
==14827== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==14827== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==14827== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==14827== For more details, rerun with: -v
==14827==
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 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
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C1D6: main (libcgrouptest01.c:498)
TEST13:PASS : cgroup_modify_cgroup()             Ret Value = 0
TEST14:PASS : cgroup_new_cgroup()                Ret Value = 0
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C23C: main (libcgrouptest01.c:519)
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C23C: main (libcgrouptest01.c:519)
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
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C464: main (libcgrouptest01.c:622)
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C464: main (libcgrouptest01.c:622)
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
==14827==
==14827== ERROR SUMMARY: 79 errors from 5 contexts (suppressed: 18 from 1)
==14827== malloc/free: in use at exit: 66,044 bytes in 15 blocks.
==14827== malloc/free: 196 allocs, 181 frees, 228,734 bytes allocated.
==14827== For counts of detected errors, rerun with: -v
==14827== searching for pointers to 15 not-freed blocks.
==14827== checked 6,381,180 bytes.
==14827==
==14827==
==14827== 66,044 (18,064 direct, 47,980 indirect) bytes in 4 blocks are definitely lost in loss record 1 of 3
==14827==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==14827==    by 0x4030D9A: cgroup_new_cgroup (wrapper.c:28)
==14827==    by 0x8049656: new_cgroup(char*, char*, char*, int, int) (libcgrouptest01.c:1132)
==14827==    by 0x8049917: create_new_cgroup_ds(int, char const*, int, int) (libcgrouptest01.c:744)
==14827==    by 0x804C190: main (libcgrouptest01.c:485)
==14827==
==14827==
==14827== 20,980 bytes in 5 blocks are indirectly lost in loss record 2 of 3
==14827==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==14827==    by 0x4030C2C: cgroup_add_value_string (wrapper.c:122)
==14827==    by 0x8048FDB: _ZL17add_control_valueP17cgroup_controllerPcS1_i (libcgrouptest01.c:1113)
==14827==    by 0x4030C2C: cgroup_add_value_string (wrapper.c:122)
==14827==    by 0x8048FDB: _ZL17add_control_valueP17cgroup_controllerPcS1_i (libcgrouptest01.c:1113)
==14827==    by 0x80496C9: new_cgroup(char*, char*, char*, int, int) (libcgrouptest01.c:1147)
==14827==    by 0x8049917: create_new_cgroup_ds(int, char const*, int, int) (libcgrouptest01.c:744)
==14827==    by 0x804C190: main (libcgrouptest01.c:485)
==14827==
==14827==
==14827== 27,000 bytes in 6 blocks are indirectly lost in loss record 3 of 3
==14827==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==14827==    by 0x4030F4B: cgroup_add_controller (wrapper.c:62)
==14827==    by 0x80496AE: new_cgroup(char*, char*, char*, int, int) (libcgrouptest01.c:1144)
==14827==    by 0x8049917: create_new_cgroup_ds(int, char const*, int, int) (libcgrouptest01.c:744)
==14827==    by 0x804C190: main (libcgrouptest01.c:485)
==14827==
==14827== LEAK SUMMARY:
==14827==    definitely lost: 18,064 bytes in 4 blocks.
==14827==    indirectly lost: 47,980 bytes in 11 blocks.
==14827==      possibly lost: 0 bytes in 0 blocks.
==14827==    still reachable: 0 bytes in 0 blocks.
==14827==         suppressed: 0 bytes in 0 blocks.
Cleanup done
[root@gondor tests]#


Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@300 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a few memory leaks, and leaked file handles.

[root@gondor tests]# make
g++ -g -O2 -Wall -DDEBUG -I .. -o libcgrouptest01 libcgrouptest01.c -L .. -lcgroup -lpthread
libcgrouptest01.c: In function ‘int group_modified(char*, int)’:
libcgrouptest01.c:1060: warning: format ‘%d’ expects type ‘int*’, but argument 3 has type ‘bool*’
s[root@gondor tests]# sh runlibcgrouptest.sh

Running first set of testcases
==============================
==14758== Memcheck, a memory error detector.
==14758== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==14758== Using LibVEX rev 1804, a library for dynamic binary translation.
==14758== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==14758== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==14758== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==14758== For more details, rerun with: -v
==14758==
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
==14758==
==14758== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 18 from 1)
==14758== malloc/free: in use at exit: 0 bytes in 0 blocks.
==14758== malloc/free: 18 allocs, 18 frees, 32,293 bytes allocated.
==14758== For counts of detected errors, rerun with: -v
==14758== All heap blocks were freed -- no leaks are possible.

Running second set of testcases
==============================
==14774== Memcheck, a memory error detector.
==14774== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==14774== Using LibVEX rev 1804, a library for dynamic binary translation.
==14774== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==14774== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==14774== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==14774== For more details, rerun with: -v
==14774==
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
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x40070D8: strncat (mc_replace_strmem.c:214)
==14774==    by 0x804BC92: main (libcgrouptest01.c:1271)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804BC9D: main (libcgrouptest01.c:252)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804BC9D: main (libcgrouptest01.c:252)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x8049471: _ZL14group_modifiedPci (libcgrouptest01.c:1076)
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
==14774==
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x8049479: _ZL14group_modifiedPci (libcgrouptest01.c:1076)
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007470: strncmp (mc_replace_strmem.c:314)
==14774==    by 0x804949B: _ZL14group_modifiedPci (libcgrouptest01.c:1076)
==14774==    by 0x804C583: main (libcgrouptest01.c:254)
TEST 8:PASS : cgroup_modify_cgroup()             Ret Value = 0   Parameter same cgroup
TEST 9:PASS : cgroup_new_cgroup()                Ret Value = 0
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BD35: main (libcgrouptest01.c:286)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BD35: main (libcgrouptest01.c:286)
TEST10:PASS : cgroup_modify_cgroup()             Ret Value = 0
TEST11:PASS : cgroup_modify_cgroup()             Ret Value = 50007
TEST12:PASS : cgroup_new_cgroup()                Ret Value = 0
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BDF3: main (libcgrouptest01.c:314)
==14774==
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14774==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14774==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14774==    by 0x804BDF3: main (libcgrouptest01.c:314)
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
==14774==
==14774== ERROR SUMMARY: 45 errors from 10 contexts (suppressed: 18 from 1)
==14774== malloc/free: in use at exit: 0 bytes in 0 blocks.
==14774== malloc/free: 187 allocs, 187 frees, 234,711 bytes allocated.
==14774== For counts of detected errors, rerun with: -v
==14774== All heap blocks were freed -- no leaks are possible.
Cleanup done

Running third set of testcases
==============================
==14827== Memcheck, a memory error detector.
==14827== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==14827== Using LibVEX rev 1804, a library for dynamic binary translation.
==14827== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==14827== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==14827== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==14827== For more details, rerun with: -v
==14827==
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 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
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C1D6: main (libcgrouptest01.c:498)
TEST13:PASS : cgroup_modify_cgroup()             Ret Value = 0
TEST14:PASS : cgroup_new_cgroup()                Ret Value = 0
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C23C: main (libcgrouptest01.c:519)
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C23C: main (libcgrouptest01.c:519)
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
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007271: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C464: main (libcgrouptest01.c:622)
==14827==
==14827== Conditional jump or move depends on uninitialised value(s)
==14827==    at 0x4007285: strcpy (mc_replace_strmem.c:268)
==14827==    by 0x402F24B: cgroup_modify_cgroup (api.c:1012)
==14827==    by 0x804A3E7: test_cgroup_modify_cgroup(int, cgroup*, char const*, int, int, int, int, int) (libcgrouptest01.c:889)
==14827==    by 0x804C464: main (libcgrouptest01.c:622)
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
==14827==
==14827== ERROR SUMMARY: 79 errors from 5 contexts (suppressed: 18 from 1)
==14827== malloc/free: in use at exit: 66,044 bytes in 15 blocks.
==14827== malloc/free: 196 allocs, 181 frees, 228,734 bytes allocated.
==14827== For counts of detected errors, rerun with: -v
==14827== searching for pointers to 15 not-freed blocks.
==14827== checked 6,381,180 bytes.
==14827==
==14827==
==14827== 66,044 (18,064 direct, 47,980 indirect) bytes in 4 blocks are definitely lost in loss record 1 of 3
==14827==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==14827==    by 0x4030D9A: cgroup_new_cgroup (wrapper.c:28)
==14827==    by 0x8049656: new_cgroup(char*, char*, char*, int, int) (libcgrouptest01.c:1132)
==14827==    by 0x8049917: create_new_cgroup_ds(int, char const*, int, int) (libcgrouptest01.c:744)
==14827==    by 0x804C190: main (libcgrouptest01.c:485)
==14827==
==14827==
==14827== 20,980 bytes in 5 blocks are indirectly lost in loss record 2 of 3
==14827==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==14827==    by 0x4030C2C: cgroup_add_value_string (wrapper.c:122)
==14827==    by 0x8048FDB: _ZL17add_control_valueP17cgroup_controllerPcS1_i (libcgrouptest01.c:1113)
==14827==    by 0x4030C2C: cgroup_add_value_string (wrapper.c:122)
==14827==    by 0x8048FDB: _ZL17add_control_valueP17cgroup_controllerPcS1_i (libcgrouptest01.c:1113)
==14827==    by 0x80496C9: new_cgroup(char*, char*, char*, int, int) (libcgrouptest01.c:1147)
==14827==    by 0x8049917: create_new_cgroup_ds(int, char const*, int, int) (libcgrouptest01.c:744)
==14827==    by 0x804C190: main (libcgrouptest01.c:485)
==14827==
==14827==
==14827== 27,000 bytes in 6 blocks are indirectly lost in loss record 3 of 3
==14827==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==14827==    by 0x4030F4B: cgroup_add_controller (wrapper.c:62)
==14827==    by 0x80496AE: new_cgroup(char*, char*, char*, int, int) (libcgrouptest01.c:1144)
==14827==    by 0x8049917: create_new_cgroup_ds(int, char const*, int, int) (libcgrouptest01.c:744)
==14827==    by 0x804C190: main (libcgrouptest01.c:485)
==14827==
==14827== LEAK SUMMARY:
==14827==    definitely lost: 18,064 bytes in 4 blocks.
==14827==    indirectly lost: 47,980 bytes in 11 blocks.
==14827==      possibly lost: 0 bytes in 0 blocks.
==14827==    still reachable: 0 bytes in 0 blocks.
==14827==         suppressed: 0 bytes in 0 blocks.
Cleanup done
[root@gondor tests]#


Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@300 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
<entry>
<title>libcgrouptest: Initialize uninitialized pointers in test cases</title>
<updated>2009-01-02T16:52:49+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-01-02T16:52:49+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/jsafrane/public_git/libcg.git/commit/?id=71f83660f99a20e2b6fcb4c4aa9747c207e2934a'/>
<id>71f83660f99a20e2b6fcb4c4aa9747c207e2934a</id>
<content type='text'>
Pointers should be initialized to NULL. In the multi mount test case
path, we had an uninitialized cgroup_filled which caused a
segmentation fault. Fix it for this test case.

TODO:
Fix for all test cases.

Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Cc: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@297 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pointers should be initialized to NULL. In the multi mount test case
path, we had an uninitialized cgroup_filled which caused a
segmentation fault. Fix it for this test case.

TODO:
Fix for all test cases.

Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Cc: Sudhir Kumar &lt;skumar@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;


git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@297 4f4bb910-9a46-0410-90c8-c897d4f1cd53
</pre>
</div>
</content>
</entry>
</feed>
