# fatal error: sync: RUnlock of unlocked RWMutex

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

## Root Cause

RUnlock() is called without a matching RLock(), often because the lock was acquired with Lock() but released with RUnlock().

## Version Compatibility

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

## Workarounds

1. **** (94% success)
   ```
   mu.RLock()
defer mu.RUnlock()
// read-only section
   ```
2. **** (85% success)
   ```
   type RLocked struct{ mu *sync.RWMutex }
func (r RLocked) Unlock() { r.mu.RUnlock() }
   ```

## Dead Ends

- **** — Hides the panic but leaves the RWMutex in a corrupted state, causing deadlocks later. (80% fail)
- **** — It removes read concurrency and may mask but not fix the mismatched lock/unlock pairs. (55% fail)
