# Memory Race Condition

> Detects concurrent memory access without proper synchronization in C/C++ and Go programs.

- Skill: `zakirkun/memory-race-condition` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/memory-race-condition`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/memory-race-condition/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/memory-race-condition

---


# Memory Race Condition

## Overview
Memory race conditions occur when two threads access shared memory simultaneously without synchronization, and at least one access is a write. This leads to:
- Data corruption (non-deterministic results)
- Security bypass (auth state race)
- Potential exploitation via crafted timing

## Remediation
- Use mutex/lock primitives for all shared data access
- Use atomic operations for simple counters and flags
- Design for lock-free or copy-on-write patterns where performance matters
- Use Go race detector: `go test -race`

