# fatal error: sync: unlock of unlocked mutex

- **ID:** `go/mutex-unlock-of-unlocked`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

mu.Unlock() is called without a matching Lock(), often from a deferred Unlock in a path where Lock was skipped or Unlock ran twice.

## Version Compatibility

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

## Workarounds

1. **** (94% success)
   ```
   mu.Lock()
defer mu.Unlock()
// critical section
   ```
2. **** (90% success)
   ```
   func (s *Store) Get(k string) V {
    s.mu.Lock()
    defer s.mu.Unlock()
    return s.m[k]
}
   ```

## Dead Ends

- **** — Swallowing the fatal error hides the logic bug and can leave the mutex in an inconsistent state. (85% fail)
- **** — TryLock is not a validity check for Unlock and adds races; the double-unlock still occurs. (80% fail)
