# fatal error: concurrent map writes

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

## Root Cause

Two goroutines wrote to the same map without synchronization. The runtime detects concurrent map writes and aborts the process; it is not recoverable.

## Version Compatibility

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

## Workarounds

1. **** (97% success)
   ```
   var mu sync.RWMutex
mu.Lock()
m[k] = v
mu.Unlock()

mu.RLock()
v := m[k]
mu.RUnlock()
   ```
2. **** (90% success)
   ```
   var m sync.Map
m.Store(k, v)
if v, ok := m.Load(k); ok { _ = v }
   ```

## Dead Ends

- **** — fatal error is not a panic; recover cannot intercept it. The process dies regardless. (99% fail)
- **** — If reads also race with writes, the runtime may still report concurrent map read and map write. Both paths need protection. (60% fail)
