{
  "id": "go/channel-deadlock-no-receiver",
  "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": "Sending to an unbuffered channel with no concurrent receiver blocks the only goroutine, leaving no runnable goroutines and triggering the runtime deadlock detector.",
  "root_cause_type": "generic",
  "root_cause_zh": "向无缓冲 channel 发送数据但没有并发的接收方，导致唯一的 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 no receiver ever reads, the spawned goroutine blocks forever and the main goroutine exits or deadlocks elsewhere.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Sleep does not create a receiver; if no goroutine reads, the send still blocks permanently.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "ch := make(chan int)\ngo func() { fmt.Println(<-ch) }()\nch <- 42",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "ch := make(chan int, 1)\nch <- 42 // does not block\nfmt.Println(<-ch)",
      "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-02-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}