# 致命错误：所有 goroutine 都处于休眠状态 - 死锁！

- **ID:** `go/fatal-error-all-goroutines-asleep-deadlock`
- **领域:** go
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

所有 goroutine 都阻塞在 channel 或锁上，无法继续推进，Go 运行时死锁检测器触发。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.0+ | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   ch := make(chan int, 1)
ch <- 1 // no receiver needed for buffered channel
   ```
2. **** (90% 成功率)
   ```
   select {
case v := <-ch:
    _ = v
case <-time.After(time.Second):
    return errors.New("timeout")
}
   ```

## 无效尝试

- **** — Sleep does not unblock the sender; the deadlock detector still fires once all goroutines park. (90% 失败率)
- **** — fatal error from the runtime is not recoverable via recover(); it calls exit directly. (95% 失败率)
