sanitizers

Diagnose C/C++ sanitizer reports from GCC and Clang builds.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill sanitizers-awfixers-stuff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sanitizers
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/sanitizers
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill sanitizers-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Guide developers to choose, enable, and interpret compiler runtime sanitizers to find memory errors, undefined behavior, data races, and leaks in C and C++ programs, reducing debugging time and false positives.

Core Features & Use Cases

  • Sanitizer selection: decision tree mapping bug classes (out-of-bounds, use-after-free, uninitialized reads, undefined behavior, races, leaks) to ASan, MSan, UBSan, TSan, and LSan.
  • Build and runtime guidance: recommended compiler flags and environment options, CMake integration, and CI run patterns for GCC and Clang.
  • Report interpretation & suppressions: explain common sanitizer reports, diagnose allocation vs access frames, and provide suppression file examples to reduce noise in CI.

Quick Start

Enable ASan and UBSan in your build and run tests to capture and interpret sanitizer reports.

Frequently Asked Questions about sanitizers

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

FAQPage Schema
How do I choose the right sanitizer for a specific memory error or data race?

A sanitizer decision tree maps bug classes like out-of-bounds, use-after-free, and data races to specific tools. ASan targets memory errors, UBSan catches undefined behavior, TSan detects races, and MSan finds uninitialized reads.

What do allocation and access stack frames mean in an ASan report?

Allocation and access stack frames in an ASan report pinpoint where memory was allocated versus where the invalid access occurred. Diagnosing both frames isolates the exact use-after-free or out-of-bounds memory violation.

How do I enable ASan and UBSan compiler flags in a CMake project?

Enable ASan and UBSan by applying recommended compiler flags like -fsanitize=address,undefined within your CMake build configuration. This integrates sanitizer instrumentation into local testing and CI runs for diagnosing runtime bugs.

Can I suppress false positive sanitizer reports during CI runs?

Yes, you can suppress false positive sanitizer reports during CI runs. Suppression file examples and runtime option suggestions reduce noise by ignoring specific known issues while continuing to catch real memory errors.

Does this sanitizer guidance work with both GCC and Clang builds?

Yes, the sanitizer guidance works with both GCC and Clang builds. It provides recommended compiler flags, runtime options, and CI patterns specifically for diagnosing ASan, UBSan, TSan, MSan, and LSan reports across both compilers.