Valgrind 3.6.0 for ARM-Linux
Version 3.6.0 of Valgrind was released a couple of weeks ago. The largest change this release is the addition of support for Linux running on ARM. Learn more about the release in this blog.

Valgrind is a GPL'd framework for building simulation-based debugging and profiling tools, plus a set of "standard" tools. The best known of these is Memcheck, a memory error detector, but in fact it is only one of eight tools in the standard distribution: two memory checkers, two thread checkers, two performance profilers and two space profilers.
You can download the sources from the Valgrind website. Alternatively, you may be able to get pre-built packages via your Linux distro, or via Linaro, although note that the 3.6.0 upstream release post-dates pre-built packages. 3.6.0 is known to work on Ubuntu 10.04 and 10.10 on ARM, and on the Nokia N900 running Maemo 5.
Also available online is full documentation. For those impatient to get going, the quick start guide tells you the bare minimum needed to get started.
Valgrind runs your code on an instrumented, synthetic CPU. Hence the level of instruction set coverage is important. 3.6.0 contains a fairly complete implementation of the ARMv7-A user space instruction set, including ARM and Thumb integer code, VFPv3, media v6 and NEON instructions, but not including ThumbEE or Jazelle. It works well enough to run multi-million lines of C++ sized applications (OpenOffice scale) as well as a smattering of hand-optimized ARM codecs.
Which tools work?
Valgrind pushes the boundaries of what can be done by runtime code instrumentation, so not everything works on every platform. For 3.6.0 on ARM-Linux, the tool situation is:
- Memcheck (heap error detector) works.
- Cachegrind (low level cache profiler) works.
- Massif and DHAT (heap profilers) work.
- Callgrind (a profiler like Cachegrind but which is call/return aware) doesn't work properly, because of difficulties reliably identifying calls and returns on ARM. Getting this fixed is a priority.
- Ptrcheck (a detector for stack/global array overruns) doesn't work.
- Helgrind and DRD (thread error detectors) should work in principle, but haven't received much testing.
Some caveats
- Stack traces generated by Valgrind will stop in any library for which debug information is not available. This is different from the behavior on all other targets, in which missing debug info merely leads to non-identification of code addresses, but does not break the traces. This is because, on ARM-Linux, stripped objects do not have even the minimal Dwarf CFI needed for unwinding.
- You need to be running a kernel configured for hardware TLS, else all attempts to run Valgrind will segfault at startup. Learn more about the fault.
Apart from that, if you have used Valgrind on other targets, you'll find it very little different on ARM Linux.
If you have questions or difficulties, feel free to mail our users or developers mailing lists. Bugs should be reported.
There will likely be a 3.6.1 release before the end of the year, to clear up any critical issues resulting from the recent 3.6.0 release. So if you want to try Valgrind on ARM-Linux, now would be a good time!
Re-use is only permitted for informational and non-commercial or personal use only.
