{
  "id": "go/goroutine-blocked-on-mutex",
  "signature": "fatal error: all goroutines are asleep - deadlock! (goroutine 1 [semacquire])",
  "signature_zh": "致命错误：所有 goroutine 都处于休眠状态 - 死锁！（goroutine 1 [信号量获取]）",
  "regex": "fatal\\ error:\\ all\\ goroutines\\ are\\ asleep\\ \\-\\ deadlock!\\ \\(goroutine\\ 1\\ \\[semacquire\\]\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A goroutine is blocked trying to acquire a mutex that is already locked by another goroutine that is also blocked, causing a deadlock.",
  "root_cause_type": "generic",
  "root_cause_zh": "一个 goroutine 在尝试获取一个已被另一个也阻塞的 goroutine 锁定的互斥锁时阻塞，导致死锁。",
  "versions": [
    {
      "version": "1.20",
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If logic requires same mutex, deadlock persists.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Sleep doesn't resolve circular wait.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "mu1.Lock(); mu2.Lock(); defer mu1.Unlock(); defer mu2.Unlock()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "if mu.TryLock(time.Second) { defer mu.Unlock() } else { handleTimeout() }",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}