Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

valgrind mac os sierra 10.12.1

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).
like image 223
Glement Avatar asked Dec 01 '16 18:12

Glement


People also ask

Does valgrind work on macOS?

Valgrind integration in CLion works on Linux, macOS, and Windows via WSL (see Valgrind on WSL).

Does valgrind work on M1 Mac?

Valgrind does not seem to work on M1 Macs. Issue #5 · LouisBrunner/homebrew-valgrind · GitHub.


1 Answers

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.

like image 178
Joost Huizinga Avatar answered Sep 27 '22 17:09

Joost Huizinga