# fatal error: all goroutines are asleep - deadlock!

- **ID:** `go/deadlock-all-goroutines-asleep`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

All goroutines are blocked waiting on channels or locks with no way to proceed, causing a program deadlock.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Use buffered channels or select with default to avoid blocking indefinitely. Ensure there is a way for goroutines to exit.
   ```
2. **** (85% success)
   ```
   Implement a timeout using context.WithTimeout to break deadlocks.
   ```

## Dead Ends

- **** — If the existing goroutines are waiting on each other, adding more will not resolve the circular wait. (90% fail)
- **** — Sleep does not resolve the underlying synchronization issue; it only delays the deadlock detection. (80% fail)
- **** — This breaks the program's logic and may introduce data races. (70% fail)
