Valgrind
Contents
The recommended installation method is FreeBSD Ports & Packages.
Supported Platforms
The Valgrind port works on amd64, x86 and aarch64.
Installation
Stable Version
The devel/valgrind port follows the official Valgrind release cycle, which is roughly aligned with the RedHat Fedora release cycle, with bi-annual releases targeted for April and October.
Install using either:
Ports: cd /usr/ports/devel/valgrind && make install OR
Packages: pkg install valgrind
Development Version
The devel/valgrind-devel port will install a version of Valgrind that is tracking the upstream git repository, and is updated if/when there are sufficient fixes between official Valgrind releases.
Install using either:
Ports: cd /usr/ports/devel/valgrind-devel && make install OR
Packages: pkg install valgrind-devel
Building from Source
Pre-Requisites
Building valgrind requires the following ports to be installed:
- devel/gmake
- devel/autoconf
- devel/automake
Obtaining the Valgrind Source
Starting with Valgrind 3.18.1 FreeBSD support has been integrated into the main Valgrind codebase. Prior to 3.18.1 (though still maintained) the source was hosted on on GitHub
To check out pre-3.18.1 versions of the source:
git clone https://github.com/paulfloyd/freebsd_valgrind.git
The mercurial bitbucket repo that was the basis of the FreeBSD Valgrind port up to 3.17 is no longer accessible.
Building
sh autogen.sh ./configure gmake gmake install
TODO
- Improve ioctl checking. At present there is very little checking of ioctl memory accesses. This will also require a significant improvement in the test coverage.
Other platforms? Upstream also supports arm and PPC. There is an out-of-tree port to RISC-V as well.
Implement a FreeBSD fair scheduler. Linux has a futex based scheduler. It uses come GCC __sync builtins (also available with clang). And a couple of syscalls for futex. Shouldn't be too hard to port to use _umtx_op.
- Implement rfork.
- Improve vgdb-invoker.
- Implement some form of lldb-server.
- Improve core dumps. Currently they are just Linux style core dumps with a FreeBSD tag.
Add freeres support to libc FreeBSD Bugzilla Issue #259294
- Much needs to be done for Clang OMP.
- Fix handling of thread TLS allocation for Helgrind.