I am not sure if this question would be more appropriate for stackoverflow, but I thought I'd ask here first.

The other day, I tried running one of my programs against valgrind to check for memory leaks. To my surprise, the terminal reported that valgrind couldn't be found. Additionally, there seems to be no man page for valgrind either.

I am certain I used to have valgrind on this computer, but haven't used it in a while so I can't say when it disappeared. Could this have something to do with my having updated to OS X Lion? Anyone know?

  • 1
    This is totally fine for here - updates / upgrades to OS X and basic terminal issues are very much on topic here. You can ask for it to be migrated if you feel it's better there, but I'd say you should get several answers here today. – bmike Feb 21 '12 at 17:00

I'd start with a spotlight search from terminal mdfind valgrind as well as checking your path variable to rule out some simple errors before digging deeper. You will want to ensure you have Release 3.7.0 of valgrind as it's the first that states compatibility with Lion in the release notes.

|improve this answer|||||
  • This is what my path is set to echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin Is anything missing/doesn't need to be there? – finiteloop Feb 21 '12 at 17:38
  • 1
    That is the correct default path for Lion. You will have to either add the actual path to your valgrind binary to your path or put a new valgrind binary in your path. /usr/local/bin might be the best place if you just grab and compile the source. If mdfind shows nothing, you need to do the second - go get it again since it's not there. You could look in Time Machine for the old valgrind, but it's likely out of date if older than November 2011. – bmike Feb 21 '12 at 17:41
  • Sounds good. I just went to check out that directory, and to my surprise, it has been removed. Also, I just noticed that I no longer have svn on my computer either (I know I had this as recent as a week or so ago). Do you think its safe to assume that my /usr/local/bin directory was removed recently and that is where my valgrind and svn have gone? – finiteloop Feb 21 '12 at 22:20
  • Without doubt, a clearing of /usr/local/bin is most likely the cause of your difficulties. Watch the homebrew site for an update as Apple has changed Xcode and the open source compilers with version 4.3 so lots of people are going through path adjustment pain at the moment. – bmike Feb 21 '12 at 22:23
  • Just combed through my Time Machine back to march 2011. That directory has never existed on this machine. So scratch that theory. It concerns me that valgrind and svn both seem to have disappeared. Maybe there could be a larger issue at heart? Anybody know if these two things may have been previously installed by the same source or something like that? – finiteloop Feb 21 '12 at 22:24

It is possible that the Lion installation process could have modified your PATH settings to not include the location for valgrind. I would do a search with the locate command or similar and see if its sill installed on you mac, somewhere. If you find it on your mac, then you should add valgrind back on to your path . Also it might not be a bad idea to look for an update to it to better support the Lion upgrade. Worst case you will need to re-download and install valgrind.

|improve this answer|||||

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .