RE: Running Valgrind with CIM provider

"Kandepu, Anusha" <[email protected]> Fri, 26 Oct 2012 09:06:05 +0000
Newsgroups gmane.network.open-pegasus.general
Message-ID <BE12E5A23C3D7F45AFEC46E5CC6F2CE42D131DDF@G1W3781.americas.hpqcorp.net>
Hi Visakh,
                  You can't run cimprovgt bin alone with valgrind .It should be invoked by cimserver only. So here if you want to collect the leaks for cimprovgt then have a wrapper script for cimserver also and start cimserver.So that cimserver bin will start with valgrind enabled and internally it invokes cimprovgt also with valgrind enabled .I have mentioned below, the process of how do we run  memory leaks test as part of OP Nightly Build and tests.

Example :

We have wrapper scripts for each binary under PEGASUS_HOME /bin(From this directory all the binaries are loaded) directory .In the wrapper script, each binary has been pointed  to the exact location of binaries as mentioned in the sample script below. In this example actual binaries are present under "PEGASUS_HOME /bin_exe" directory and wrapper script is present under "PEGASUS_HOME /bin" directory. The wrapper script for cimserver/cimprovgt  is mentioned below.

#!/bin/bash
valgrind --log-file=/var/buildMAIN/pegasus/build/valgrind_log/cimserver --num-callers=25 --tool=memcheck --leak-check=full --error-limit=no /var/buildMAIN/pegasus/build/bin_exe/cimserver "$@"

#!/bin/bash
valgrind --log-file=/var/buildMAIN/pegasus/build/valgrind_log/cimprovagt --num-callers=25 --tool=memcheck --leak-check=full --error-limit=no /var/buildMAIN/pegasus/build/bin_exe/cimprovagt "$@"

Hope this has clarified your doubt !! .

Regards,
Anusha.

From: Visakh Sreekumar [mailto:[email protected]]
Sent: Monday, October 22, 2012 5:49 PM
To: [email protected]
Subject: RE: Running Valgrind with CIM provider

CIM Server used is OpenPegasus 2.11.0 and valgrind version is 3.7.0.

From: Visakh Sreekumar
Sent: Monday, October 22, 2012 5:31 PM
To: '[email protected]'
Subject: Running Valgrind with CIM provider


Hi



This is Visakh, I am new to this group. I am trying to do memory leak analysis of our CIM provider with valgrind and has so far been unsuccessful in my attempt. Hope to get some expert advice in this regard.



I have a wrapper script for executing cimprovagt which is as given below:

==========================================================================

module=$5

VALGRIND_ARGS="--leak-check=yes --trace-children=yes --log- file=/tmp/$module.valgrind"

if [ -e /tmp/$module.valgrind -o -e /tmp/LogAll.valgrind ]; then exec /usr/bin/valgrind $VALGRIND_ARGS \ /opt/pegasus/bin/cimprovagt.orig "$@"

else

exec /opt/pegasus/bin/cimprovagt.orig "$@"

fi

==========================================================================

Here /opt/pegasus/bin/cimprovagt.orig is the renamed original cimprovagt executable.



Now when I run valgrind -v cimprovagt(which is the wrapper), it reports the

error:

"cimprovagt is an internal program used by cimserver.

cimprovagt should not be invoked directly."



This is seen irrespective of whether "forceProviderProcesses" is true/false.



Please let me know if I am missing anything here.



Regards,

Visakh