# fatal error: all goroutines are asleep - deadlock! (buffered channel full)

- **ID:** `go/goroutine-channel-buffer-overflow`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Sending to a buffered channel that is full, with no receiver ready, causing sender to block indefinitely.

## Version Compatibility

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

## Workarounds

1. **Ensure sufficient consumer goroutines to drain channel** (90% success)
   ```
   ch := make(chan int, 10)
go func() {
    for val := range ch {
        // consume
    }
}()
for i := 0; i < 20; i++ {
    ch <- i
}
   ```
2. **Use unbuffered channel with proper synchronization** (85% success)
   ```
   ch := make(chan int)
go func() {
    for val := range ch {
        // consume
    }
}()
ch <- 42 // blocks until receiver ready
   ```

## Dead Ends

- **Increasing buffer size arbitrarily** — Only delays the problem; if consumers are missing, buffer will fill again. (70% fail)
- **Using non-blocking send with select default** — Default case drops data; may lose messages. (60% fail)
