Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

valgrind doesn't install properly #2150

Closed
datanoise opened this issue Aug 12, 2010 · 17 comments
Closed

valgrind doesn't install properly #2150

datanoise opened this issue Aug 12, 2010 · 17 comments

Comments

@datanoise
Copy link

After installing valgrind:

$ valgrind
valgrind: Unknown/uninstalled VG_PLATFORM 'amd64-darwin'

I'm on Mac OS X 10.6.4

@adamv
Copy link
Contributor

adamv commented Aug 12, 2010

Can you post your "brew --config"?

Also, Snow Leopard support for this is VERY preliminary and not at all guaranteed to work.

@datanoise
Copy link
Author

HOMEBREW_VERSION: 0.7
HEAD: 8601eae3b72c9d475a7832c654313cad0da3c6fc
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_CACHE: /Users/kent/Library/Caches/Homebrew
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.6.4
Kernel Architecture: i386
Ruby: 1.8.7-174
GCC-4.0: build 5494 (5493 or newer recommended)
GCC-4.2: build 5664 (5659 or newer recommended)
LLVM: build 2326 (2207 or newer recommended)
MacPorts or Fink? false
X11 installed? true

@sharth
Copy link
Contributor

sharth commented Aug 18, 2010

This also occurs on 10.5.8.

Running valgrind

[12:57pm][wlynch@orange Tiny] valgrind -d ./application
--23881:1:debuglog DebugLog system started by Stage 1, level 1 logging requested
--23881:1:launcher no tool requested, defaulting to 'memcheck'
--23881:1:launcher valgrind_lib = /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind
--23881:1:launcher arch 'x86' IS NOT installed
--23881:1:launcher arch 'amd64' IS NOT installed
--23881:1:launcher arch 'arm' IS NOT installed
--23881:1:launcher arch 'ppc32' IS NOT installed
--23881:1:launcher arch 'ppc64' IS NOT installed
valgrind: Unknown/uninstalled VG_PLATFORM 'x86-darwin'

[12:57pm][wlynch@orange Tiny] valgrind ./application
valgrind: Unknown/uninstalled VG_PLATFORM 'x86-darwin'

Brew Config

[12:57pm][wlynch@orange Tiny] brew --config
HOMEBREW_VERSION: 0.7
HEAD: c4574e208f9c2309e916105a6ebc92c0ea74078c
HOMEBREW_PREFIX: /Users/wlynch/Homebrew
HOMEBREW_CELLAR: /Users/wlynch/Homebrew/Cellar
HOMEBREW_CACHE: /Users/wlynch/Library/Caches/Homebrew
HOMEBREW_REPOSITORY: /Users/wlynch/Homebrew
HOMEBREW_LIBRARY_PATH: /Users/wlynch/Homebrew/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.5.8
Kernel Architecture: i386
Ruby: 1.8.6-369
GCC-4.0: build 5493 (5493 or newer recommended)
GCC-4.2: build 5577 (5577 or newer recommended)
LLVM: N/A 
MacPorts or Fink? false
X11 installed? true

Contents of Valgrind library

[12:57pm][wlynch@orange Tiny] ls -l /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind
total 60024
-r-xr-xr-x  1 wlynch  staff  2184436 Aug 18 12:53 cachegrind-x86-darwin
-r-xr-xr-x  1 wlynch  staff  2274648 Aug 18 12:53 callgrind-x86-darwin
-r--r--r--  1 wlynch  staff    29057 Aug 18 12:53 default.supp
-r-xr-xr-x  1 wlynch  staff  2258196 Aug 18 12:53 drd-x86-darwin
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 drd-x86-darwin.dSYM
-r-xr-xr-x  1 wlynch  staff  2139380 Aug 18 12:53 exp-bbv-x86-darwin
-r-xr-xr-x  1 wlynch  staff  2217220 Aug 18 12:53 exp-ptrcheck-x86-darwin
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 exp-ptrcheck-x86-darwin.dSYM
-r-xr-xr-x  1 wlynch  staff  2278720 Aug 18 12:53 helgrind-x86-darwin
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 helgrind-x86-darwin.dSYM
-r-xr-xr-x  1 wlynch  staff  2147572 Aug 18 12:53 lackey-x86-darwin
-r--r--r--  1 wlynch  staff  4144960 Aug 18 12:53 libcoregrind-x86-darwin.a
-r--r--r--  1 wlynch  staff   229568 Aug 18 12:53 libmpiwrap-x86-darwin.so
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 libmpiwrap-x86-darwin.so.dSYM
-r--r--r--  1 wlynch  staff    54512 Aug 18 12:53 libreplacemalloc_toolpreload-x86-darwin.a
-r--r--r--  1 wlynch  staff  3682320 Aug 18 12:52 libvex-x86-darwin.a
-r-xr-xr-x  1 wlynch  staff  2163964 Aug 18 12:53 massif-x86-darwin
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 massif-x86-darwin.dSYM
-r-xr-xr-x  1 wlynch  staff  2315824 Aug 18 12:53 memcheck-x86-darwin
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 memcheck-x86-darwin.dSYM
-r-xr-xr-x  1 wlynch  staff  2135284 Aug 18 12:53 none-x86-darwin
-r--r--r--  1 wlynch  staff    38020 Aug 18 12:53 vgpreload_core-x86-darwin.so
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 vgpreload_core-x86-darwin.so.dSYM
-r--r--r--  1 wlynch  staff   105756 Aug 18 12:53 vgpreload_drd-x86-darwin.so
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 vgpreload_drd-x86-darwin.so.dSYM
-r--r--r--  1 wlynch  staff    61124 Aug 18 12:53 vgpreload_exp-ptrcheck-x86-darwin.so
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 vgpreload_exp-ptrcheck-x86-darwin.so.dSYM
-r--r--r--  1 wlynch  staff    82840 Aug 18 12:53 vgpreload_helgrind-x86-darwin.so
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 vgpreload_helgrind-x86-darwin.so.dSYM
-r--r--r--  1 wlynch  staff    60140 Aug 18 12:53 vgpreload_massif-x86-darwin.so
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 vgpreload_massif-x86-darwin.so.dSYM
-r--r--r--  1 wlynch  staff    75116 Aug 18 12:53 vgpreload_memcheck-x86-darwin.so
drwxr-xr-x  3 wlynch  staff      102 Aug 18 12:53 vgpreload_memcheck-x86-darwin.so.dSYM

@sharth
Copy link
Contributor

sharth commented Aug 18, 2010

I was looking into this...

The required fix is:

chmod +x /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/*.so

This is due to the following part of code in valgrind. We check that the vgpreload_core-* have execute perissions.

"coregrind/launcher-darwin.c" line 288 of 423

for (i = 0; i < valid_archs_count; i++) {
  char *vgpreload_core;
  asprintf(&vgpreload_core, "%s/vgpreload_core-%s-darwin.so", valgrind_lib, valid_archs[i].valgrind_name);
  if (access(vgpreload_core, R_OK|X_OK) != 0) {
     VG_(debugLog)(1, "launcher", "arch '%s' IS NOT installed\n", valid_archs[i].valgrind_name);
     bzero(&valid_archs[i], sizeof(valid_archs[i]));
  } else {
     VG_(debugLog)(1, "launcher", "arch '%s' IS installed\n", valid_archs[i].valgrind_name);
  }
  free(vgpreload_core);
}

@adamv
Copy link
Contributor

adamv commented Aug 24, 2010

Tweaked in 9779ff5

Probably want to remove your cached download before trying agin...

@sharth
Copy link
Contributor

sharth commented Aug 24, 2010

Same problem. It looks like homebrew is chmodding the libraries after make install. Is that possible?

[12:31pm][wlynch@orange ~] brew rm valgrind
Uninstalling /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0...
[12:32pm][wlynch@orange ~] brew install valgrind
==> Downloading http://www.valgrind.org/downloads/valgrind-3.5.0.tar.bz2
File already downloaded and cached to /Users/wlynch/Library/Caches/Homebrew
==> ./configure --prefix=/Users/wlynch/Homebrew/Cellar/valgrind/3.5.0 --mandir=/Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/share/man
==> make install
/Users/wlynch/Homebrew/Cellar/valgrind/3.5.0: 166 files, 55M, built in 88 seconds
[12:34pm][wlynch@orange ~] ls -al /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/*.so
-r--r--r--  1 wlynch  staff  229568 Aug 24 12:34 /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/libmpiwrap-x86-darwin.so
-r--r--r--  1 wlynch  staff   38020 Aug 24 12:34 /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/vgpreload_core-x86-darwin.so
-r--r--r--  1 wlynch  staff  105756 Aug 24 12:34 /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/vgpreload_drd-x86-darwin.so
-r--r--r--  1 wlynch  staff   61124 Aug 24 12:34 /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/vgpreload_exp-ptrcheck-x86-darwin.so
-r--r--r--  1 wlynch  staff   82840 Aug 24 12:34 /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/vgpreload_helgrind-x86-darwin.so
-r--r--r--  1 wlynch  staff   60140 Aug 24 12:34 /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/vgpreload_massif-x86-darwin.so
-r--r--r--  1 wlynch  staff   75116 Aug 24 12:34 /Users/wlynch/Homebrew/Cellar/valgrind/3.5.0/lib/valgrind/vgpreload_memcheck-x86-darwin.so

@MikeMcQuaid
Copy link
Member

Yeh, sharth has hit the problem here. Adam, how do we tell Homebrew to either not do that or fix it afterwards?

@adamv
Copy link
Contributor

adamv commented Oct 13, 2010

You can use "skip_clean" to prevent Homebrew from changing mods on files; I had to do that in the "resty" formula since some of the scripts don't have #! lines.

(We could add .so to the list of known extensions, and treat them like .dylib, if we had to.)

@MikeMcQuaid
Copy link
Member

How are dylibs treated? Libraries are normally non-executable, this is a strange exception I'd say. skip_clean sounds like a good solution to me if it does to you.

@adamv
Copy link
Contributor

adamv commented Oct 13, 2010

Er, I misread part of this thread, but the "skip_clean" comment still stands.

Please test w/ this commit: http://github.com/adamv/homebrew/commit/866e227e2aaf69c7e59fbfd0752c8e08998a07c3

I don't have time to compile and test valgrind + boost at the moment.

@MikeMcQuaid
Copy link
Member

Added skip_clean for the lib directory, fixed the issue, closing.

@MikeMcQuaid
Copy link
Member

Sorry Adam, I only just saw your comment after committing my own. Let me know if you think it needs changed:
http://github.com/mxcl/homebrew/commit/a5796a8fb8a0ee091635e8751fc0207ddcc82a10

@twslankard
Copy link

I know this issue is closed, but I found the same problem. (Mac OS 10.6.4, Homebrew 0.7, Valgrind 3.6-pre.) Sharth's "chmod +x" fix got it working.

Brew config:

brew --config
HOMEBREW_VERSION: 0.7
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.6.4
Kernel Architecture: i386
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 3.2.4
GCC-4.0: build 5494
GCC-4.2: build 5664
LLVM: build 2326
MacPorts or Fink? /opt/local/bin/port
X11 installed? true

@MikeMcQuaid
Copy link
Member

Hmm, are you sure? Can you try uninstalling and reinstalling?

@twslankard
Copy link

I tried on another machine and everything worked just fine. (Same OS, Brew, and Valgrind versions.)

Here's the config in case you're interested:

OMEBREW_VERSION: 0.7
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.6.4
Kernel Architecture: i386
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 3.2.4
GCC-4.0: build 5494
GCC-4.2: build 5664
LLVM: build 2326
MacPorts or Fink? /opt/local/bin/port
X11 installed? true

@aspcartman
Copy link

Can't install on Lion 10.7.4 .

Undefined symbols for architecture x86_64:
"___bzero", referenced from:
_hijack_thread_state in libcoregrind-amd64-darwin.a(libcoregrind_amd64_darwin_a-syswrap-amd64-darwin.o)

@sharth
Copy link
Contributor

sharth commented Jun 26, 2012

@aspcartman I've taken this issue that you mention and created it's own bug for it: #13042

Normally, please create a new bug rather than opening up an unrelated bug from 2 years ago.

MikeMcQuaid added a commit that referenced this issue Oct 25, 2012
This reverts commit 24a9737.

This line was originally to fix #2150 which it breaks again.

Fixes #15620.
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
This reverts commit 24a9737.

This line was originally to fix Homebrew#2150 which it breaks again.

Fixes Homebrew#15620.
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants