Tags

, ,

In order to improve cost of software quality of our VoIP recorder product, I will introduce Valgrind, http://www.valgrind.org to our build ecosystem. Up to now, we set up code repository Git to trigger Jenkins (https://sifaserdarozen.wordpress.com/2015/02/02/trigger-jenkins-jobs-by-git-commit/, https://sifaserdarozen.wordpress.com/2015/01/26/using-jenkins-as-build-automation/) and obtain cross platform builds. Then the FitNesse tests are run to perform a system wide check (https://sifaserdarozen.wordpress.com/2015/02/17/introducing-fitnesse-to-a-c-project/). Cppcheck is triggered to do a static analysis (https://sifaserdarozen.wordpress.com/2015/04/16/introducing-cppcheck-to-jenkins/), and now, with introducing Valgrind, there will also be a dynamic check. The test cases are a bare minimum, and ecosystem is still far from an optimal, however these will sure be a step forward.

Valgrind is a well known dynamic analyzer, that will run in many platforms running Linux.

valgrind integration - valgrind logo

Here I will run it in our Debian build system. First install Valgrind.

valgrind integration - installing valgrind to debian

Valgrind plugin should also be installed to Jenkins.

valgrind integration - installing valgrind to jenkins

In our case, running program under test requires network operations which needs privilege. For sake of simplicity, give passwordless sudo access by modifying /etc/sudoers and harden security later (which is a shame)

valgrind integration - preparing for passwordless sudo

Then, a Jenkins job should be configured to publish Valgrind result.

valgrind integration - configuration the job

Here, for a reason that I am not able to find, there appears an error about the output of Valgrind xml.

valgrind integration - xml file error

When I analyzed the file, it is seen that one of the tags, valgrindoutput is not closed. Closing the tag manually, will lead to expected operation.

valgrind integration - extension to configuration the job

For my case, the error is in the package,

valgrind integration - valgrind version

When the error in package is fixed, this last extra line should be removed. The result is list of (hopefully zero) Valgrind errors.

valgrind integration - error list

In our case, most of the errors are due to need for wrapper around third party code.

Advertisements