# fatal error: all goroutines are asleep - deadlock!

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

## Root Cause

Every goroutine is blocked on a channel operation, mutex, or WaitGroup with no runnable goroutine to unblock them. The runtime detects total quiescence and aborts.

## Version Compatibility

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

## Workarounds

1. **** (93% success)
   ```
   ch := make(chan int)
done := make(chan struct{})
go func() { defer close(done); for v := range ch { _ = v } }()
for i := 0; i < 10; i++ { ch <- i }
close(ch)
<-done
   ```
2. **** (88% success)
   ```
   // runtime: kill -QUIT <pid> or send SIGQUIT; inspect 'goroutine N [chan send/receive]' lines
   ```

## Dead Ends

- **** — Timeout converts the deadlock into a silent timeout error, hiding the missing sender/receiver. The program still fails to make progress. (70% fail)
- **** — If no receiver ever reads, buffering only delays the deadlock; once the buffer fills, the sender blocks again. (75% fail)
