{
  "id": "go/select-empty-deadlock",
  "signature": "fatal error: all goroutines are asleep - deadlock! (select with no cases)",
  "signature_zh": "fatal error: 所有 goroutine 都休眠了 - 死锁！（select 无 case）",
  "regex": "fatal\\ error:\\ all\\ goroutines\\ are\\ asleep\\ \\-\\ deadlock!\\ \\(select\\ with\\ no\\ cases\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A select statement with no cases blocks forever, and if all goroutines are blocked, the runtime detects deadlock.",
  "root_cause_type": "generic",
  "root_cause_zh": "select 语句没有任何 case，会永远阻塞，如果所有 goroutine 都阻塞，运行时会检测到死锁。",
  "versions": [
    {
      "version": "1.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Default case may cause busy loop and still not solve logical deadlock",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Sleep does not help; select with no cases is invalid",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.98,
      "how": "select {\ncase <-ch:\n    // handle\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "select {\ncase <-done:\n    return\ncase <-ch:\n    // handle\n}",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}