Valgrind
$ valgrind Community Low Riskvalgrind instruments compiled binaries to catch memory leaks, invalid reads/writes, and data races (memcheck, helgrind) or profile cache/call graphs (callgrind). It supports non-interactive execution with --error-exitcode=1 and structured --xml=yes --xml-file=..., though macOS/ARM64 support is absent.
brew install valgrind Local Linux dynamic binary instrumentation framework; no MCP equivalent.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive with --error-exitcode=1 and --xml=yes --xml-file=..., but emits XML or verbose stderr text rather than JSON and slows execution 10x–30x.
- Supports
--xml=yesfor memcheck structured output - No JSON output; stderr mixes target output with Valgrind logs unless redirected
Zero network/credential exposure; executes the target binary locally in an instrumented JIT VM.
- Local binary analysis; target program side effects still apply
Standard on Linux (x86_64/arm64), but lacks official support on modern macOS (especially Apple Silicon) and native Windows.
- Primarily Linux-only in practice; macOS support lags/unmaintained
Gold standard for uninstrumented binary leak checking on Linux, though ASan/UBSan are 10x faster when recompiling is possible.
- Requires no recompilation, though 10–30x runtime slowdown applies
Long-standing GPLv2 project hosted at valgrind.org (sourceware.org), releasing annually for Linux architectures.
- Mature open-source project on sourceware.org
Extensive HTML manual and --help, though output interpretation and suppression files take expertise.
- Detailed official manual at valgrind.org
Security, Auth & Guardrails
No credentials required; executes local ELF binaries under dynamic instrumentation.
GPL-2.0-or-later open-source GNU/Linux analysis suite; free.
# Valgrind Agent Rules - Always pass `--error-exitcode=1 --leak-check=full` when gating CI or C/C++ fixes. - Use `--xml=yes --xml-file=<path>` for structured parsing and `--quiet` to avoid verbose stderr banners. - Do not expect `valgrind` to run on macOS Apple Silicon or native Windows; use Linux or ASan/LSan instead.
Agent-Ready Command Recipes
Safe Read-Only Queries
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 --quiet ./build/app
Runs ./build/app under memcheck, suppresses banner noise, and exits 1 if memory errors are found.
Controlled Writes & Previews
valgrind --tool=memcheck --leak-check=full --xml=yes --xml-file=valgrind.xml ./build/app
Writes machine-parseable memcheck XML error reports to valgrind.xml.
Strengths for Agents
- + Detects leaks, use-after-free, and uninitialized reads without recompiling binaries.
- +
--error-exitcode=1and--xml=yes --xml-file=...enable deterministic CI checks.
Caveats & Pitfalls
- ! Effectively Linux-only on modern hardware (unsupported on macOS Apple Silicon and native Windows).
- ! 10x–30x execution slowdown and no native JSON output.