# fatal error: all goroutines are asleep - deadlock! (empty select{})

- **ID:** `go/select-empty-blocks-forever`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

An empty select{} blocks forever with no cases. If the main goroutine hits it without other live goroutines, the runtime reports deadlock.

## Version Compatibility

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

## Workarounds

1. **** (96% success)
   ```
   sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt, syscall.SIGTERM)
<-sig
   ```
2. **** (95% success)
   ```
   <-ctx.Done()
   ```

## Dead Ends

- **** — Busy-spins and consumes 100% CPU; not a real fix for missing shutdown logic. (85% fail)
- **** — The select{} never returns, so the sleep is unreachable. (95% fail)
