# fatal error: concurrent map writes

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

## Root Cause

Multiple goroutines write to the same Go map without synchronization. Go's runtime detects the concurrent write and aborts the program; this is not recoverable via recover().

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.18 | active | — | — |
| 1.20 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   var mu sync.RWMutex; mu.Lock(); m[k]=v; mu.Unlock() — guard every access (read and write) with the same mutex
   ```
2. **** (90% success)
   ```
   Use sync.Map for read-mostly or disjoint-key workloads: var m sync.Map; m.Store(k, v); m.Load(k)
   ```

## Dead Ends

- **** — fatal error is thrown by the runtime and bypasses the normal panic/recover mechanism entirely (95% fail)
- **** — Partial locking still leaves a write racing a read; the runtime still aborts (80% fail)
