With the June 15, 2017 release of valgrind 3.13.0, I am able to install and make use of valgrind on macOS Sierra (10.12.5). As a base case, I can successfully evaluate a very basic valgrind ls -l.I will be continuing to evaluate this build of valgrind as I complete the exercises in ZS's LCTHW. Messages like the following indicate a mismatch between Valgrind's memory map and the kernel. Occasional failures are expected in multithreaded programs. If the failure repeats for the same address range, then there may be a problem causing false errors or crashes.
Current release: valgrind-3.16.1. Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools. This is the homepage of the profiling tool Callgrind and the profile data visualization KCachegrind.Both are licensed under GPL V2. Callgrind uses runtime instrumentation via the Valgrind framework for its cache simulation and call-graph generation. This way, even shared libraries and dynamically opened plugins can be profiled.
The complete source code, including documentation, is available as a tarball for the current release. For downloadable / browseable manual packages, go to the Documentation page. For older releases, see the Release Archive page.
If you would like to be notified when a new valgrind release ismade, you can subscribe to the Valgrind announcementsmailing list.
Valgrind 3.16.1
valgrind 3.16.1 (tar.bz2) [17MB] - 22 June 2020.
For {x86,amd64,arm32,arm64,ppc32,ppc64le,ppc64be,s390x,mips32,mips64}-linux, {arm32,arm64,x86,mips32}-android, {x86,amd64}-solaris and {x86,amd64}-darwin (Mac OS X 10.13).
md5: d1b153f1ab17cf1f311705e7a83ef589
PGP signature is here.
3.16.0 updates support for existing platforms, adds support for AArch64 v8.1, and reduces the Memcheck false positive rate on highly optimised code. There are, as ever, many smaller refinements and bug fixes. See the release notes for details.
Valkyrie 2.0.0
valkyrie 2.0.0 (tar.bz2)[260Kb] - 21 October 2010.
md5: a411dfb803f548dae5f988de0160aeb5
Valkyrie is a Qt4-based GUI for the Valgrind 3.6.x and 3.7.x series, that works for the Memcheck andHelgrind tools. It also has an XML merging tool forMemcheck outputs (vk_logmerge). This tarball is known to build and work withvalgrind-3.6.0 and valgrind-3.7.0.
This version of Valkyrie does not support any version of Valgrindprior to 3.6.0. If you want to use Valkyrie with an older Valgrindversion, we recommend you instead upgrade your Valgrind to 3.6.0and use this version of Valkyrie.
RPMs / Binaries
We do not distribute binaries or RPMs. The releases availableon this website contain the source code and have to be compiledin order to be installed on your system. Many Linuxdistributions come with valgrind these days, so if you do notwant to compile your own, go to your distribution's downloadsite.
System Requirements
Programs running under Valgrind run significantly more slowly, anduse much more memory -- e.g. more than twice as much as normal underthe Memcheck tool. Therefore, it's best to use Valgrind on the mostcapable machine you can get your hands on.
Welcome to my blog, where I’ll be discussing some of the work I’m doing for Mozilla.
A little about me
I’m Australian. I live in Melbourne. I’ve also lived in Cambridge, England and Austin, Texas, and so I am fluent in at least three dialects of English. I like spending time with my wife Phoebe and baby daughter Keira, eating food, riding my bike, and following US presidential elections obsessively. Two weeks ago I left the academic/research world and started working for Mozilla.
Valgrind
Valgrind Equivalent For Mac
My first big task for Mozilla is to improve support for Mac OS X in Valgrind. I’ve been involved with Valgrind since before the 1.0 release in 2002, and have done lots of work on it, including writing two tools that are in the Valgrind distribution: Cachegrind, a cache profiler, and Massif, a memory profiler. I even wrote a PhD dissertation about it.
And it seems that lots of Mozilla people find Valgrind useful, which is nice. However, it currently only runs on Linux. (Well, it also runs on AIX, but not many people care about that.)
Valgrind on Mac OS X
More than four years ago, on December 16, 2004, an Apple employee named Greg Parker wrote to the Valgrind developers mailing list to tell us that he was working on a port of Valgrind for Mac OS X. He’s been working on it ever since then. (This must be why Mac OS 10.5 shipped late.)
After such a long time, I’m happy to report that there is now a branch holding Greg’s port in the Valgrind SVN repository. If you want to check it out, do this:
and then build it according to the instructions in the README file. The branch is called DARWIN because Darwin is the name of the Mac OS “core”, which consists of a Mach-based microkernel and a few other bits and pieces.
However, please note that the port currently is, in Greg’s words: “UNSUPPORTED and INCOMPLETE and BUGGY… It may not find bugs in your program, or run your program correctly, or run your program at all.” What Greg has done is very impressive, and goes an awfully long way towards having a complete port of Valgrind on Mac OS X. But it’s not the cleanest patch ever. To give you an idea…
- The patch I imported was 31,144 lines, just over 1MB of text.
- The patch initially didn’t work on 32-bit Macs.
- The patch broke Valgrind on Linux. This took me a couple of days to fix, mostly involving the addition of appropriate #if statements.
- The patch broke the regression test system; they wouldn’t even build, let alone run. After fixing them to run again, more than half of the tests failed on Linux, and almost three-quarters failed on Mac.
- There are lots of compiler warnings. (The Valgrind trunk has none).
- Much of the code in the patch has 4 space indenting; the rest of Valgrind code has 3 space indenting.
So there’s plenty of work to be done to get the branch into a state where it will be suitable for merging with the trunk. It’s hard to estimate how long this will take, it will just be a matter of fixing things one piece at a time. My guess is that three months might suffice, but it’s really just a guess. But here are some metrics I can use to judge progress, and their values just after I got the the system and regression tests building and running again on Mac and Linux:
- The number of regression test failures on Linux: 477 tests, 220 stderr failures, 53 stdout failures, 25 post failures. (“stderr” failures generally indicate that Valgrind’s output had a problem, “stdout” failures generally indicate that the test program’s output had a problem, and “post” failures indicate that the output of a Valgrind post-processing step had a problem.) These numbers roughly indicate how much existing functionality has been broken on Linux by the Darwin changes, and should be fairly easy to get down.
- The number of regression test failures on Mac: 419 tests, 293 stderr failures, 58 stdout failures, 29 post failures. These numbers are the most important, as they roughly indicate how complete the Mac functionality is, and will be much more work to get down.
- The number of compiler warnings: 186. This number should be easy to reduce. (Update, Jan 20: That’s on Linux. On Darwin it was 461.)
- The size of the diff between the branch and the trunk: 55,852 lines, 1.9MB. This is larger than the original patch because some files have been moved on the branch but not yet moved on the trunk, including some tests that are large and have large expected outputs. This number will go down in fits and starts; it will never get to zero, as the final merge will happen when there are many differences between the branch and trunk.
I’ll occasionally post updates to these numbers so people can track progress.
Download Valgrind For Mac
If Valgrind-on-Mac is of interest to you, please try out the new branch and let me know how it goes. Note that I’m working on an old MacBook Pro which is only 32-bit, so it’s possible that I’ve broken the 64-bit Mac support, but have no way to determine this.