Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
Arm Community blogs
Arm Community blogs
Architectures and Processors blog Valgrind 3.6.0 for ARM-Linux
  • Blogs
  • Mentions
  • Sub-Groups
  • Tags
  • Jump...
  • Cancel
More blogs in Arm Community blogs
  • AI blog

  • Announcements

  • Architectures and Processors blog

  • Automotive blog

  • Embedded and Microcontrollers blog

  • Internet of Things (IoT) blog

  • Laptops and Desktops blog

  • Mobile, Graphics, and Gaming blog

  • Operating Systems blog

  • Servers and Cloud Computing blog

  • SoC Design and Simulation blog

  • Tools, Software and IDEs blog

Tell us what you think
Tags
  • partner
  • Debugger
  • Linux
Actions
  • RSS
  • More
  • Cancel
Related blog posts
Related forum threads

Valgrind 3.6.0 for ARM-Linux

Guest Partner Blogger
Guest Partner Blogger
September 11, 2013
2 minute read time.

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!

Anonymous
Architectures and Processors blog
  • When a barrier does not block: The pitfalls of partial order

    Wathsala Vithanage
    Wathsala Vithanage
    Acquire fences aren’t always enough. See how LDAPR exposed unsafe interleavings and what we did to patch the problem.
    • September 15, 2025
  • Introducing GICv5: Scalable and secure interrupt management for Arm

    Christoffer Dall
    Christoffer Dall
    Introducing Arm GICv5: a scalable, hypervisor-free interrupt controller for modern multi-core systems with improved virtualization and real-time support.
    • April 28, 2025
  • Getting started with AARCHMRS Features.json using Python

    Joh
    Joh
    A high-level introduction to the Arm Architecture Machine Readable Specification (AARCHMRS) Features.json with some examples to interpret and start to work with the available data using Python.
    • April 8, 2025