Mac OS X Valgrind

Valgrind + Mac OS X update (June 17, 2009)

It’s time for the June update on the progress of the Mac OS X port of Valgrind.

Progress has been good: the DARWIN branch has been merged to the trunk.  With that having happened, we’re now in sight of an actual release (3.5.0) containing Mac OS X support.  There’s some polishing and bug-fixing — both for Mac OS X and in general — to be done before that happens, but hopefully we’ll release 3.5.0 in early August.  That will be before Snow Leopard comes out;  another release may be necessary afterwards, but we want to get this code released sooner rather than later.

One interesting problem we encountered was some users were having Valgrind abort with a SIGTRAP extremely early.  It was very mysterious, and none of the developers were able to reproduce it.  Turns out that a program called Instant Hijack by a company called Rogue Amoeba was the cause of the problem.  Both Valgrind and Instant Hijack do some stuff with dyld, and apparently Instant Hijack’s stuff is a bit dodgy.  Turns out there’s an easy workaround, which involves temporarily disabling Instant Hijack.  This was reported by a Rogue Amoeba developer, fortunately he tried Valgrind himself, had the same SIGTRAP abort, found the bug report, and realised what the problem was.  If it wasn’t for him, we’d still be scratching our heads!

In the meantime, keep reporting any problems you have, in particular any unimplemented syscall wrappers — a number have been added lately but there are still more to be done.  Please report problems via Bugzilla rather than in comments on this blog, as bugzilla reports are more likely to be acted upon.  Thanks!

5 replies on “Valgrind + Mac OS X update (June 17, 2009)”

APE (which not many people are running on Leopard) will also break valgrind if you run it – the injection into the process actually seems to work (at least for a little while), but it tries to read thread-local data which doesn’t work. I don’t really think that’s a valgrind bug, though.

Sean, probably not, although I haven’t tried. Greg Parker listed that as a limitation of the original patch and I’m not aware of any changes that would have affected that. You could try it yourself and see how it goes.

Nicholas, thanks for the quick reply. I’ll give it a try. Is Greg’s list of stuff that does not work still current? He lists:

– PowerPC code
– Signals
– Many system calls
– Objective-C garbage collection
– –db-attach=yes
– Tools other than memcheck

And what about 64 bit apps? Thanks.


– PowerPC doesn’t work, and never will.
– Signals mostly work; should be ok as long as you aren’t doing anything too strange.
– System call coverage is gradually improving.
– Obj-C GC is unchanged.
– –db-attach=yes won’t work.
– Tools other than Memcheck: they all work except for Helgrind and DRD.

Comments are closed.