macOS 12 (Darwin 21) compatibility
git clone https://github.com/LouisBrunner/valgrind-macos
cd valgrind-macos
./autogen.sh
./configure --prefix=/some/directory
# configure: error: Valgrind works on Darwin 10.x-20.x (Mac OS X 10.6-10.11 and macOS 10.12-11.0)
Running the root configure script ends in a configure: error: Valgrind works on Darwin 10.x-20.x (Mac OS X 10.6-10.11 and macOS 10.12-11.0). On x86_64 macOS 12 beta 9 (21A5543b).
I am still working on 11.0 support at the moment, hopefully 12.0 will be fairly straight-forward.
@LouisBrunner how can I make some contributions on support 12.0
Hello, is this solution good for MacOS12 ? Or i Will break something. https://stackoverflow.com/questions/69792467/memory-check-on-macos-12-monterey
@gsq7474741 Check the thread (#19) around macOS 11 support, that is the main blocker
@rahmed42 While it might build, there is no guarantee you will actually get valid information, it is worth a shot though.
Hi :) is there some update about macOS Monterey 12 compatibility (on M1 chip) ? I tried to install your version of valgrind, but it always says it's incompatible. :(
It still incompatible:
brew install --HEAD LouisBrunner/valgrind/valgrind
==> Cloning https://github.com/LouisBrunner/valgrind-macos.git
Cloning into '/Users/paulo/Library/Caches/Homebrew/valgrind--git'...
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> Installing valgrind from louisbrunner/valgrind
==> ./autogen.sh
==> ./configure --prefix=/opt/homebrew/Cellar/valgrind/HEAD-6ff08b6 --enable-only64bit --build=amd64-darwin
Last 15 lines from /Users/paulo/Library/Logs/Homebrew/valgrind/02.configure:
checking for perl... /usr/bin/perl
checking for gdb... /no/gdb/was/found/at/configure/time
checking dependency style of clang... none
checking for diff -u... yes
checking for xcrun... yes
checking for Xcode SDK and includes... /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk (includes: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include)
checking for a supported version of gcc... ok (Apple LLVM version 14.0.0)
checking build system type... x86_64-pc-darwin
checking host system type... x86_64-pc-darwin
checking for a supported CPU... ok (x86_64)
checking for a 64-bit only build... yes
checking for a 32-bit only build... no
checking for a supported OS... ok (darwin)
checking for the kernel version... unsupported (21.6.0)
configure: error: Valgrind works on Darwin 10.x-20.x (Mac OS X 10.6-10.11 and macOS 10.12-11.0)
Do not report this issue to Homebrew/brew or Homebrew/core!
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels.
==> Cloning https://github.com/LouisBrunner/valgrind-macos.git
Cloning into '/Users/luowencai/Library/Caches/Homebrew/valgrind--git'...
Updating files: 100% (6493/6493), done.
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> Installing valgrind from louisbrunner/valgrind
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/valgrind/HEAD-59136a1 --enable-only64
==> make
Last 15 lines from /Users/luowencai/Library/Logs/Homebrew/valgrind/03.make:
for f in vgpreload_core-amd64-darwin.so ; do \
rm -f ../.in_place/$f.dSYM; \
ln -f -s ../coregrind/$f.dSYM ../.in_place; \
done
mkdir -p ../.in_place; \
for f in m_gdbserver/32bit-core-valgrind-s1.xml m_gdbserver/32bit-core-valgrind-s2.xml m_gdbserver/32bit-core.xml m_gdbserver/32bit-linux-valgrind-s1.xml m_gdbserver/32bit-linux-valgrind-s2.xml m_gdbserver/32bit-linux.xml m_gdbserver/32bit-sse-valgrind-s1.xml m_gdbserver/32bit-sse-valgrind-s2.xml m_gdbserver/32bit-sse.xml m_gdbserver/64bit-avx-valgrind-s2.xml m_gdbserver/64bit-avx-valgrind-s1.xml m_gdbserver/64bit-avx.xml m_gdbserver/64bit-core-valgrind-s1.xml m_gdbserver/64bit-core-valgrind-s2.xml m_gdbserver/64bit-core.xml m_gdbserver/64bit-linux-valgrind-s1.xml m_gdbserver/64bit-linux-valgrind-s2.xml m_gdbserver/64bit-linux.xml m_gdbserver/64bit-sse-valgrind-s1.xml m_gdbserver/64bit-sse-valgrind-s2.xml m_gdbserver/64bit-sse.xml m_gdbserver/amd64-avx-coresse-valgrind.xml m_gdbserver/amd64-avx-coresse.xml m_gdbserver/amd64-avx-linux-valgrind.xml m_gdbserver/amd64-avx-linux.xml m_gdbserver/amd64-coresse-valgrind.xml m_gdbserver/amd64-linux-valgrind.xml m_gdbserver/arm-core-valgrind-s1.xml m_gdbserver/arm-core-valgrind-s2.xml m_gdbserver/arm-core.xml m_gdbserver/arm-vfpv3-valgrind-s1.xml m_gdbserver/arm-vfpv3-valgrind-s2.xml m_gdbserver/arm-vfpv3.xml m_gdbserver/arm-with-vfpv3-valgrind.xml m_gdbserver/arm-with-vfpv3.xml m_gdbserver/i386-coresse-valgrind.xml m_gdbserver/i386-linux-valgrind.xml m_gdbserver/power64-core-valgrind-s1.xml m_gdbserver/power64-core-valgrind-s2.xml m_gdbserver/power64-core.xml m_gdbserver/power64-core2-valgrind-s1.xml m_gdbserver/power64-core2-valgrind-s2.xml m_gdbserver/power64-linux-valgrind-s1.xml m_gdbserver/power64-linux-valgrind-s2.xml m_gdbserver/power64-linux.xml m_gdbserver/power-altivec-valgrind-s1.xml m_gdbserver/power-altivec-valgrind-s2.xml m_gdbserver/power-altivec.xml m_gdbserver/power-vsx-valgrind-s1.xml m_gdbserver/power-vsx-valgrind-s2.xml m_gdbserver/power-vsx.xml m_gdbserver/power-core-valgrind-s1.xml m_gdbserver/power-core-valgrind-s2.xml m_gdbserver/power-core.xml m_gdbserver/power-fpu-valgrind-s1.xml m_gdbserver/power-fpu-valgrind-s2.xml m_gdbserver/power-fpu.xml m_gdbserver/power-linux-valgrind-s1.xml m_gdbserver/power-linux-valgrind-s2.xml m_gdbserver/power-linux.xml m_gdbserver/powerpc-altivec32l-valgrind.xml m_gdbserver/powerpc-altivec32l.xml m_gdbserver/powerpc-altivec64l-valgrind.xml m_gdbserver/powerpc-altivec64l.xml m_gdbserver/s390-acr-valgrind-s1.xml m_gdbserver/s390-acr-valgrind-s2.xml m_gdbserver/s390-acr.xml m_gdbserver/s390-fpr-valgrind-s1.xml m_gdbserver/s390-fpr-valgrind-s2.xml m_gdbserver/s390-fpr.xml m_gdbserver/s390x-core64-valgrind-s1.xml m_gdbserver/s390x-core64-valgrind-s2.xml m_gdbserver/s390x-core64.xml m_gdbserver/s390x-generic-valgrind.xml m_gdbserver/s390x-generic.xml m_gdbserver/s390x-linux64-valgrind-s1.xml m_gdbserver/s390x-linux64-valgrind-s2.xml m_gdbserver/s390x-linux64.xml m_gdbserver/s390-vx-valgrind-s1.xml m_gdbserver/s390-vx-valgrind-s2.xml m_gdbserver/s390-vx.xml m_gdbserver/s390x-vx-linux-valgrind.xml m_gdbserver/s390x-vx-linux.xml m_gdbserver/mips-cp0-valgrind-s1.xml m_gdbserver/mips-cp0-valgrind-s2.xml m_gdbserver/mips-cp0.xml m_gdbserver/mips-cpu-valgrind-s1.xml m_gdbserver/mips-cpu-valgrind-s2.xml m_gdbserver/mips-cpu.xml m_gdbserver/mips-linux.xml m_gdbserver/mips-linux-valgrind.xml m_gdbserver/mips-fpu-valgrind-s1.xml m_gdbserver/mips-fpu-valgrind-s2.xml m_gdbserver/mips-fpu.xml m_gdbserver/mips64-cp0-valgrind-s1.xml m_gdbserver/mips64-cp0-valgrind-s2.xml m_gdbserver/mips64-cp0.xml m_gdbserver/mips64-cpu-valgrind-s1.xml m_gdbserver/mips64-cpu-valgrind-s2.xml m_gdbserver/mips64-cpu.xml m_gdbserver/mips64-linux.xml m_gdbserver/mips64-linux-valgrind.xml m_gdbserver/mips64-fpu-valgrind-s1.xml m_gdbserver/mips64-fpu-valgrind-s2.xml m_gdbserver/mips64-fpu.xml; do \
rm -f ../.in_place/$f; \
ln -f -s ../coregrind/$f ../.in_place; \
done
2 errors generated.
make[3]: *** [m_syswrap/libcoregrind_amd64_darwin_a-syswrap-darwin.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Hi @luowencai,
What version of macOS and Xcode are you using? (configure will give them for you which you can find in the brew logs)
brew install --HEAD LouisBrunner/valgrind/valgrind
xcode-select --version
xcode-select version 2395.
brew config
HOMEBREW_VERSION: 3.6.15
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 11cdffb4fef84828a7e02860212b30ce4fac85f5
Last commit: 4 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c749c5d468150f031d1374374d5d42ff74b808c7
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 14.0.0 build 1400
Git: 2.37.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.4-x86_64
CLT: 14.1.0.0.1.1666437224
Xcode: N/A
@luowencai Could you run xcrun --sdk macosx --show-sdk-version as that's the way valgrind checks for the current Xcode version?
@luowencai Could you run
xcrun --sdk macosx --show-sdk-versionas that's the way valgrind checks for the current Xcode version?
xcrun --sdk macosx --show-sdk-version 13.0
> git clone https://github.com/LouisBrunner/valgrind-macos.git
> cd valgrind
> ./autogen.sh
> ./configure
> make
> make install
> export VALGRIND_LAUNCHER=/usr/local/bin/valgrind
> gdb /usr/local/libexec/valgrind/lackey-amd64-darwin
...
(gdb) handle SIGILL SIGSEGV nostop noprint
Signal Stop Print Pass to program Description
SIGILL No No Yes Illegal instruction
SIGSEGV No No Yes Segmentation fault
(gdb) b valgrind_main
Breakpoint 1 at 0x2580e96d9: file m_main.c, line 1262.
(gdb) r
...
[18756 inferior]: darwin_xfer_partial(0x00000002580e9c18, 1, rbuf=0x7ff7bbd86527, wbuf=0x0) pid=21283
[18756 inferior]: darwin_read_write_inferior(task=0x1703, 0x00000002580e9c18, len=1)
1394 the_iicii.clstack_end = VG_(am_startup)( the_iicii.sp_at_startup );
(gdb)
[18756 inferior]: darwin_xfer_partial(0x00000002580e96d9, 1, rbuf=0x7ff7bbd862c0, wbuf=0x0) pid=21283
[18756 inferior]: darwin_read_write_inferior(task=0x1703, 0x00000002580e96d9, len=1)
...
[18756 inferior]: darwin_resume: ptid=21283.0.0, step=0, signal=0
[18756 inferior]: darwin_resume_thread: state=2, thread=0x1303, step=0 nsignal=0
[18756 inferior]: darwin_set_sstep (thread=0x1303, enable=0)
[18756 inferior]: darwin_wait: waiting for a message ptid=-1.0.0
[18756 inferior]: darwin_wait: pid=21283 received signal 9
Program terminated with signal SIGKILL, Killed.
The program no longer exists.
[18756 inferior]: task=0x1703, prev=0x7ff7, notify_port=0x1103
(gdb)
Hello, I tried to install the compiled binaries. But, the process of valgrind was terminated under some unusual condition. Also tried to reproduce and debug valgrind with GDB while blocked by SIGKILL on x86_64 macOS 13.0.1/ xcode 13.1.
Hi @s311354,
macOS 13 currently has a crash at start, hopefully this should be resolved quite soon, please follow #54 for details.
brew install --HEAD LouisBrunner/valgrind/valgrind
xcode-select --version xcode-select version 2395.brew config HOMEBREW_VERSION: 3.6.15 ORIGIN: https://github.com/Homebrew/brew.git HEAD: 11cdffb4fef84828a7e02860212b30ce4fac85f5 Last commit: 4 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: c749c5d468150f031d1374374d5d42ff74b808c7 Core tap last commit: 2 hours ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit kabylake Clang: 14.0.0 build 1400 Git: 2.37.1 => /Library/Developer/CommandLineTools/usr/bin/git Curl: 7.79.1 => /usr/bin/curl macOS: 12.4-x86_64 CLT: 14.1.0.0.1.1666437224 Xcode: N/A
Install success!But when i use valgrind command,It faild with invalid system call error.
luowencai@luowencaideMacBook-Pro bin % valgrind
zsh: invalid system call valgrind
@luowencai Could you check if it generates a crash report in Console.app (you can find it through Launchpad or Spotlight) and check under Crash Reports? If you can paste here the latest one for Valgrind (if there is any) or potentially zsh it would be a great help, thanks.
@luowencai Could you check if it generates a crash report in
Console.app(you can find it through Launchpad or Spotlight) and check underCrash Reports? If you can paste here the latest one for Valgrind (if there is any) or potentially zsh it would be a great help, thanks.
{"app_name":"memcheck-amd64-darwin","timestamp":"2023-01-05 11:17:54.00 +0800","app_version":"","slice_uuid":"296243ec-c652-3402-9904-4eddd0dc1937","build_version":"","platform":0,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.4 (21F79)","incident_id":"39A8D119-746D-4131-9D7B-B6D14BE9B103","name":"memcheck-amd64-darwin"}
{
"uptime" : 4900,
"procLaunch" : "2023-01-05 11:17:54.8045 +0800",
"procRole" : "Unspecified",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "MacBookPro15,1",
"procStartAbsTime" : 4982087624469,
"coalitionID" : 1316,
"osVersion" : {
"train" : "macOS 12.4",
"build" : "21F79",
"releaseType" : "User"
},
"captureTime" : "2023-01-05 11:17:54.8189 +0800",
"incident" : "39A8D119-746D-4131-9D7B-B6D14BE9B103",
"bug_type" : "309",
"pid" : 1758,
"procExitAbsTime" : 4982101629514,
"cpuType" : "X86-64",
"procName" : "memcheck-amd64-darwin",
"procPath" : "\/usr\/local\/Cellar\/valgrind\/HEAD-fddc2c5\/libexec\/valgrind\/memcheck-amd64-darwin",
"parentProc" : "zsh",
"parentPid" : 1301,
"coalitionName" : "com.apple.Terminal",
"crashReporterKey" : "AE20D78F-5D45-CBC9-DBF8-F3BBF5506964",
"responsiblePid" : 1299,
"responsibleProc" : "Terminal",
"sip" : "disabled",
"isCorpse" : 1,
"exception" : {"codes":"0x000000000000002f, 0x0000000000000001","rawCodes":[47,1],"type":"EXC_SYSCALL","signal":"SIGSYS"},
"termination" : {"flags":0,"code":12,"namespace":"SIGNAL","indicator":"Bad system call: 12","byProc":"exc handler","byPid":1758},
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"legacyInfo" : {
"threadHighlighted" : 0
},
"trialInfo" : {
"rollouts" : [
{
"rolloutId" : "60da5e84ab0ca017dace9abf",
"factorPackIds" : {
},
"deploymentId" : 240000008
},
{
"rolloutId" : "6112e14f37f5d11121dcd519",
"factorPackIds" : {
"SIRI_TEXT_TO_SPEECH" : "62f3b99fd7b78f3a74434a79"
},
"deploymentId" : 240000231
}
],
"experiments" : [
]
},
"reportNotes" : [
"_dyld_process_info_create failed with 5",
"dyld_process_snapshot_get_shared_cache failed",
"Failed to create CSSymbolicatorRef - corpse still valid ¯\\_(ツ)_\/¯"
]
}
@luowencai I managed to reproduce the issue in the CI, which is now passing. Hopefully it should work on your computer as well.
@luowencai I managed to reproduce the issue in the CI, which is now passing. Hopefully it should work on your computer as well.
It works! thanks.
Looks like apart from leak tracking, macOS 12 seems to be working alright so I will close this for now. Feel free to open a new issue if you have a macOS 12-related issue which isn't Apple Silicon support or leak tracking.