# fatal error: all goroutines are asleep - deadlock!

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

## Root Cause

All goroutines are blocked waiting on channel operations (send/receive) or sync primitives, and the runtime detects no goroutine can make progress. Common when an unbuffered channel send has no receiver, or a receive has no sender.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   ch := make(chan int, 1)
ch <- 42 // no longer blocks
// or:
go func() { ch <- 42 }()
<-ch
   ```
2. **** (85% success)
   ```
   select {
case ch <- v:
case <-time.After(time.Second):
	log.Println("send timeout")
}
   ```

## Dead Ends

- **** — Sleep does not unblock a channel operation; the deadlock persists and only adds latency. The runtime still detects all goroutines asleep. (95% fail)
- **** — Deadlock is a fatal runtime error, not a panic; recover() cannot intercept it and the program aborts. (99% fail)
