{
  "id": "go/select-no-cases-blocks-forever",
  "signature": "fatal error: all goroutines are asleep - deadlock! (empty select{})",
  "signature_zh": "致命错误: 所有 goroutine 都处于休眠状态 - 死锁!（空 select{}）",
  "regex": "fatal\\ error:\\ all\\ goroutines\\ are\\ asleep\\ \\-\\ deadlock!\\ \\(empty\\ select\\{\\}\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "An empty select{} blocks the goroutine forever. If it's the main goroutine and nothing else can make progress, the runtime reports deadlock.",
  "root_cause_type": "generic",
  "root_cause_zh": "空 select{} 永久阻塞 goroutine。若为主 goroutine 且无其他进度，运行时会报告死锁。",
  "versions": [
    {
      "version": "1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Still blocks; program never exits and deadlock detection is defeated.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Goroutine leaks and main may exit before work completes.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Block on a signal channel instead of empty select:\n\nquit := make(chan os.Signal, 1)\nsignal.Notify(quit, os.Interrupt)\n<-quit",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Use sync.WaitGroup to wait for real work completion:\n\nwg.Wait()",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}