# fatal error: concurrent map iteration and map write

- **ID:** `go/concurrent-map-iterations`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A goroutine iterates a map with for range while another goroutine writes to the same map, which the runtime detects and aborts.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0+ | active | — | — |

## Workarounds

1. **** (97% success)
   ```
   mu.Lock()
for k, v := range m { process(k, v) }
mu.Unlock()
   ```
2. **** (93% success)
   ```
   type req struct{ reply chan map[string]int }
for r := range reqs { r.reply <- snapshot(m) }
   ```

## Dead Ends

- **** — Copying without locking still races with the writer during the copy itself. (88% fail)
- **** — Taking the snapshot races with concurrent writes and can still trigger the detector. (86% fail)
