Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valgrind: mmap-FIXED(...) failed in UME (load_unixthread1) with error 22 (Invalid argument) errors on macOS #99900

Open
abathur opened this issue Oct 6, 2020 · 2 comments
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin

Comments

@abathur
Copy link
Member

abathur commented Oct 6, 2020

I'll describe the immediate problem first, but see the additional context section as well; I've found a macOS-specific fork/port, so I'm curious if anyone has used Nix-packaged valgrind successfully on macOS (and, if not, if using this fork as the source on Darwin may save some pain)?

Describe the bug
Most of my genuine invocations throw mmap errors. Note that I'm using the nulgrind/none tool to demonstrate that this looks like general valgrind behavior, but I see the same behavior on all ~4 tools I've tried.

$ /nix/store/vaw3azxwfqyr96j8j0x4yswwnywf3c2b-valgrind-3.16.1/bin/valgrind --tool=none /bin/cat
valgrind: mmap-FIXED(0x7fff5f400000, 8388608) failed in UME (load_unixthread1) with error 22 (Invalid argument).

$ /nix/store/vaw3azxwfqyr96j8j0x4yswwnywf3c2b-valgrind-3.16.1/bin/valgrind --tool=none cat
valgrind: mmap-FIXED(0x7fff5f400000, 8388608) failed in UME (load_unixthread1) with error 22 (Invalid argument).

$ /nix/store/vaw3azxwfqyr96j8j0x4yswwnywf3c2b-valgrind-3.16.1/bin/valgrind --tool=none jq
valgrind: mmap-FIXED(0x7fff5f400000, 8388608) failed in UME (load_unixthread1) with error 22 (Invalid argument).

$ /nix/store/vaw3azxwfqyr96j8j0x4yswwnywf3c2b-valgrind-3.16.1/bin/valgrind --tool=none /nix/store/mbahl5am0rx7aqf0z2wg34vvcld7124y-jq-1.6-bin/bin/jq
valgrind: mmap-FIXED(0x7fff5f400000, 8388608) failed in UME (load_unixthread1) with error 22 (Invalid argument).

No clue why the below two run. I've tried a few dozen programs so far and ps is the only one I've found that it runs for (perm error expected, SIP).

$ /nix/store/vaw3azxwfqyr96j8j0x4yswwnywf3c2b-valgrind-3.16.1/bin/valgrind --tool=none ps
==11331== 
==11331== Warning: Can't execute setuid/setgid/setcap executable: /bin/ps
==11331== Possible workaround: remove --trace-children=yes, if in effect
==11331== 
valgrind: /bin/ps: Permission denied

$ /nix/store/vaw3azxwfqyr96j8j0x4yswwnywf3c2b-valgrind-3.16.1/bin/valgrind --tool=none /bin/ps
==11344== 
==11344== Warning: Can't execute setuid/setgid/setcap executable: /bin/ps
==11344== Possible workaround: remove --trace-children=yes, if in effect
==11344== 
valgrind: /bin/ps: Permission denied

To Reproduce
Steps to reproduce the behavior:

  1. nix-shell -p valgrind --command "valgrind ls"

Additional context

  • Basic invocations like valgrind --help and valgrind --version work.
  • The Homebrew package for valgrind doesn't work on newer macOS versions, but I found an SO answer that mentions the https://github.com/LouisBrunner/valgrind-macos fork/port. I've installed this version via Homebrew following suggestions in that answer and it appears to work (has handled everything I've thrown at it so far.

Notify maintainers
Since I wonder if anyone's successfully used it on macOS, I'm also pinging some people that I've seen in #nix-darwin just in case anyone knows... @cransom @LnL7 @matthewbauer @thefloweringash @emilazy @burke @alyssais @eraserhd @toonn @dhess

Metadata

  • system: "x86_64-darwin"
  • host os: Darwin 19.5.0, macOS 10.15.5
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 3.0pre20200829_f156513
  • channels(abathur): "darwin, nixpkgs-21.03pre243895.72b9660dc18"
  • nixpkgs: /Users/abathur/.nix-defexpr/channels/nixpkgs
@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Oct 9, 2020
@nbren12
Copy link
Contributor

nbren12 commented Mar 10, 2021

I am also having this problem.

@stale
Copy link

stale bot commented Sep 6, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

3 participants