The Valgrind Project releases version 3.4.0
Valgrind is a suite of code analysis and debugging tools for Linux:
Valgrind version 3.4.0 was recently released, it adds a long list of improvements. The release notes explain the changes, which include:
- The Memcheck utility now reports the origin of uninitialized values.
- The Helgrind thread error detector's race detection algorithm has been redesigned for better scalability.
- Major improvements have been made to the DRD thread debugging tool.
- A new experimental Ptrcheck tool has been added, it checks for misused pointers.
- The exp-Omega instantaneous leak-detecting tool has been deprecated.
- Support has been added for the latest Linux distributions and Gnu toolchain components.
- Suppressions now have support for frame-level wild cards.
- Support has been added for the amd64/SSSE3 and IBM Power6 architectures.
- It is now possible to cross-compile Valgrind so that it runs on one architecture while supporting another.
- The command-line arguments have been added and improved.
- The code has been cleaned up and numerous bugs have been fixed.
- The documentation has been improved and updated.
- Version 1.4.0 of the Valkyrie GUI for Memcheck is coming soon.
Building and installing the Valgrind 3.4.0 source code on an Ubuntu 8.10 system was straightforward. For those who don't need the latest release, version 3.3.1 is available as a standard Ubuntu package. The source code was downloaded, uncompressed and extracted with tar. The standard Unix configure, make and make install steps were run, the code built and installed with no problems.
A test run of Valgrind was done on a fairly simple interactive C program. The Quick Start Guide was consulted, the program was compiled with the -g flag and valgrind was run: valgrind --leak-check=yes ./program options . This produced a report with a list of some still reachable memory and a hint of how to get more information on the problem. Following the hint, Valgrind was run again with: valgrind --leak-check=full --show-reachable=yes ./program options and the location of the code that produced the still reachable memory was revealed.
This experiment only showed the most basic of Valgrind's utility in debugging the simplest of test cases. Even so, it quickly revealed a small memory leak in the tested code. The lengthy online user manual explains the depth of Valgrind's testing capabilities in full. Those who maintain large projects could likely improve their code by running Valgrind and correcting any issues that it finds.
