debug-with-valgrind

Debug Rust test crashes and memory errors with Valgrind via Nextest.

7|3|Updated Nov 15, 2025
One-click install
npx skills add https://github.com/aRustyDev/ai --skill debug-with-valgrind
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-with-valgrind
Source: https://github.com/aRustyDev/ai/tree/main/components/skills/lang-rust-valgrind-ops
Command: npx skills add https://github.com/aRustyDev/ai --skill debug-with-valgrind

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill demonstrates debugging memory errors and leaks in Rust projects using Valgrind and Nextest integration.

Core Features & Use Cases

  • Valgrind wrappers: Pre-configured wrapper to run tests under Valgrind.
  • Profiling: Callgrind integration for performance profiling.
  • Nextest integration: Preconfigured nextest profiles for consistent runs.

Quick Start

Run a test with the Valgrind profile and inspect the output for leaks or errors; use callgrind to profile hotspots.

Frequently Asked Questions about debug-with-valgrind

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug memory leaks and segfaults in Rust tests?

Debug memory leaks and segfaults by running tests under Valgrind, which detects invalid memory access, heap corruption, and leaks. This Skill integrates Valgrind with Nextest to automate test execution and produce detailed diagnostic output identifying the exact source of memory errors.

Can I use Valgrind with Nextest on Linux Rust projects?

Yes. This Skill provides a preconfigured Valgrind wrapper and Nextest profile for Linux-based Rust projects using cargo nextest, enabling you to run your test suite under memory profiling without manual configuration.

What's the difference between Valgrind and Callgrind for profiling Rust tests?

Valgrind detects memory errors like leaks and invalid access; Callgrind is Valgrind's profiling tool that identifies performance hotspots and call patterns. This Skill supports both—use Valgrind to find correctness issues and Callgrind to optimize slow test execution.

How do I identify which test is crashing or leaking memory?

Run tests with the Valgrind profile via the preconfigured Nextest integration, which isolates each test and captures Valgrind's output. The diagnostic report shows which test crashed or leaked, with a full call stack and memory location details.

Do I need to modify my Rust code to use Valgrind debugging?

No. Valgrind runs your compiled test binary directly without code changes. This Skill wraps the test execution process, so memory debugging works on your existing Rust project as-is.

What platforms does Valgrind integration support?

This Skill targets Linux environments running Rust with cargo nextest. Valgrind is Linux-specific and does not support macOS or Windows natively; ensure your project runs on Linux before using this Skill.