valgrind mac os sierra 10.12.1

11,780

Solution 1

It seems that people are working on trying to get Valgrind to work on MAC OS X 10.12, the most relevant thread of which can be found here: https://bugs.kde.org/show_bug.cgi?id=365327.

The last post includes a patch to revision 16297, which is supposed to provide at least some basic functionality. The patch can be found here: https://bugsfiles.kde.org/attachment.cgi?id=104964.

Obviously this patch is still very much in development, and the author (Louis Brunner) has stated that it is incomplete, the relevant excerpt being:

"I have been working on a patch to support macOS Sierra. At the moment, it works for a variety of programs (python, GIMP, most basic commands like ls, mkdir) but it is still incomplete (warnings in dyld, libsystem_kernel... crash for some GUI programs)."

However, if you, like me, are willing to risk an incomplete version, the installation instructions are as follows:

First, install automake and svn, if those are not already installed on your system. After that, you should be able to build and install Valgrind on MAC OS X 10.12 with the following instructions:

svn checkout -r 16297 svn://svn.valgrind.org/valgrind/trunk
cd trunk
curl https://bugsfiles.kde.org/attachment.cgi?id=105218 > patch.txt
svn patch patch.txt
./autogen.sh
./configure
make
make install

If it doesn't work for your use-case, the only solution is probably to wait until the kinks have been worked out.

Edit: a newer patch can be found here: https://bugsfiles.kde.org/attachment.cgi?id=105218. I have updated the code above with the new patch. While still showing numerous warnings, valgrind now works with "ls", "ls -l", a simple "hello_world" program, and the program that prompted me to download valgrind in the first place.

Solution 2

Valgrind 3.13.0 released on June 14, 2017 (see: Current Releases) has better support for {x86,amd64}-darwin (Mac OS X 10.12). I had no problem installing Valgrind 3.13.0 by running

brew install valgrind

See Homebrew Formulas Homebrew project.

Solution 3

http://valgrind.org/downloads/current.html, this a link for current releases of Valgrind. Download the latest one and follow the instruction in the README.txt. You should also know by now that the support is limited for MAC OS X 10.11 and 10.12.

Share:
11,780

Related videos on Youtube

Glement
Author by

Glement

Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT. Student of FIT CVUT.

Updated on June 04, 2022

Comments

  • Glement
    Glement almost 2 years

    Is there any possible ways to install valgrind on new Mac OS? brew tell

    brew install -HEAD valgrind
    valgrind: This formula either does not compile or function as expected on macOS
    versions newer than El Capitan due to an upstream incompatibility.
    Error: An unsatisfied requirement failed this build.
    
    valgrind ls -l
    valgrind: mmap-FIXED(0x0, 253952) failed in UME (load_segment1) with error 12 (Cannot allocate memory).
    
  • Bartel
    Bartel about 7 years
    The patch has been updated already to v2, so in stead of the attachment link above, use this one: https://bugs.kde.org/attachment.cgi?id=105218
  • Joost Huizinga
    Joost Huizinga about 7 years
    Thank you for the new patch, I have updated the answer.