{
  "id": "go/deadlock-all-goroutines-asleep-channel",
  "signature": "fatal error: all goroutines are asleep - deadlock!",
  "signature_zh": "致命错误：所有 goroutine 都处于休眠状态 - 死锁！",
  "regex": "fatal\\ error:\\ all\\ goroutines\\ are\\ asleep\\ \\-\\ deadlock!",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "All goroutines are blocked waiting on channel operations (send/receive) or sync primitives, and the runtime detects no goroutine can make progress. Common when an unbuffered channel send has no receiver, or a receive has no sender.",
  "root_cause_type": "generic",
  "root_cause_zh": "所有 goroutine 都阻塞在 channel 操作或同步原语上，运行时检测到没有任何 goroutine 能继续推进。常见于无缓冲 channel 发送无接收者，或接收无发送者。",
  "versions": [
    {
      "version": "1.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Sleep does not unblock a channel operation; the deadlock persists and only adds latency. The runtime still detects all goroutines asleep.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deadlock is a fatal runtime error, not a panic; recover() cannot intercept it and the program aborts.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "ch := make(chan int, 1)\nch <- 42 // no longer blocks\n// or:\ngo func() { ch <- 42 }()\n<-ch",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "select {\ncase ch <- v:\ncase <-time.After(time.Second):\n\tlog.Println(\"send timeout\")\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-03-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}