debug-with-valgrind
Automates memory debugging for Rust tests by integrating Valgrind with cargo-nextest profiles.
Install
mkdir -p .claude/skills/debug-with-valgrind && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4604" && unzip -o skill.zip -d .claude/skills/debug-with-valgrind && rm skill.zipInstalls to .claude/skills/debug-with-valgrind
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Debug crashes, segfaults, and memory errors using valgrind integration with nextest through pre-configured profilesKey capabilities
- →Run tests under Valgrind
- →Perform full leak checking
- →Integrate with nextest profiles
How it works
The skill uses a pre-configured nextest profile that wraps test execution with Valgrind to detect memory errors and leaks.
Inputs & outputs
When to use debug-with-valgrind
- →Identify memory leaks in Rust tests
- →Diagnose segmentation faults
- →Verify memory safety in test suites
About this skill
Debugging with Valgrind + Nextest
When you encounter crashes, segfaults, or memory errors in tests, use valgrind for proper debugging.
Quick Usage
# Run a specific test under valgrind
cargo nextest run --profile valgrind -p PACKAGE --test TEST_FILE TEST_NAME
# Example
cargo nextest run --profile valgrind -p facet-format-json --test jit_deserialize test_jit_option_some
How It Works
The project has valgrind pre-configured in .config/nextest.toml:
-
Wrapper script: Defined as
[scripts.wrapper.valgrind]- Command:
valgrind --leak-check=full --show-leak-kinds=all ... - Automatically wraps test execution
- Command:
-
Profile:
[profile.valgrind]applies the wrapper to all tests on Linux -
Running: Use
--profile valgrindflag with nextest
Benefits
- ✅ Automatic setup - no manual valgrind commands needed
- ✅ Proper configuration - leak checking, error codes pre-configured
- ✅ Integrated - works with nextest filtering and test selection
- ✅ Clean output - nextest captures and formats valgrind output
Don't Do This
❌ Running valgrind manually: valgrind ./target/debug/deps/test-binary
❌ Using raw --no-run + valgrind commands
❌ Playing hunt-the-segfault without proper tools
Do This Instead
✅ Use the pre-configured profile: cargo nextest run --profile valgrind <filters>
✅ Let nextest handle the wrapper script integration
✅ Get clean, actionable valgrind output immediately
Debugging Workflow
- Test crashes with SIGSEGV
- Run:
cargo nextest run --profile valgrind -p PACKAGE --test FILE TEST_NAME - Valgrind shows exact line where invalid read/write occurs
- Fix the bug
- Verify with regular tests
See Also
- Nextest wrapper scripts docs: https://nexte.st/docs/configuration/wrapper-scripts/
- Project nextest config:
.config/nextest.toml
When not to use it
- →When Valgrind is not available on the host
Prerequisites
Limitations
- →Only works on Linux
- →Requires nextest configuration
How it compares
It provides an integrated, automated Valgrind workflow instead of manual command-line execution.
Compared to similar skills
debug-with-valgrind side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| debug-with-valgrind (this skill) | 2 | 7mo | Review | Intermediate |
| gen-rust | 1 | 6mo | Review | Advanced |
| search-code | 2 | 4mo | Review | Intermediate |
| cts-triage | 1 | 4mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by facet-rs
View all by facet-rs →You might also like
gen-rust
MoonshotAI
Sync Rust implementation with Python changes (exclude UI/login) by reviewing recent changes, mapping modules, porting logic, and updating tests.
search-code
JamieMason
Search for code patterns in Syncpack. Use when finding symbols, implementations, or understanding how code is used. Covers ast-grep for Rust and grep/rg for other cases.
cts-triage
gfx-rs
Run CTS test suites and investigate failures
reproduce-reduce-regress
facet-rs
Systematic workflow for debugging by reproducing bugs with real data, reducing test cases to minimal examples, and adding regression tests
fix-bug
ovaar
Debug and fix issues in VaultMark. Use when asked to fix bug, debug this, something is broken, not working, diagnose issue, troubleshoot, or investigate an error.
ci-pr-helper
lance-format
Run local test/style checks and open GitHub PRs for lance-context. Use when asked to run CI-equivalent checks (uv pytest, ruff/pyright, cargo fmt/clippy/test) and then create a PR with a proper title/body.