{
  "id": "go/rwmutex-unlock-of-unlocked",
  "signature": "fatal error: sync: RUnlock of unlocked RWMutex",
  "signature_zh": "致命错误：sync：解锁未加读锁的 RWMutex",
  "regex": "fatal\\ error:\\ sync:\\ RUnlock\\ of\\ unlocked\\ RWMutex",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "RUnlock() is called without a matching RLock(), often because the lock was acquired with Lock() but released with RUnlock().",
  "root_cause_type": "generic",
  "root_cause_zh": "在没有对应 RLock() 的情况下调用 RUnlock()，常见于用 Lock() 加锁却用 RUnlock() 解锁的情况。",
  "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": "Hides the panic but leaves the RWMutex in a corrupted state, causing deadlocks later.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "It removes read concurrency and may mask but not fix the mismatched lock/unlock pairs.",
      "fail_rate": 0.55,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.94,
      "how": "mu.RLock()\ndefer mu.RUnlock()\n// read-only section",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "type RLocked struct{ mu *sync.RWMutex }\nfunc (r RLocked) Unlock() { r.mu.RUnlock() }",
      "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-10-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}