{
  "id": "go/concurrent-map-write",
  "signature": "fatal error: concurrent map writes",
  "signature_zh": "fatal error: 并发写 map",
  "regex": "fatal\\ error:\\ concurrent\\ map\\ writes",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Two goroutines wrote to the same map without synchronization. The runtime detects concurrent map writes and aborts the process; it is not recoverable.",
  "root_cause_type": "generic",
  "root_cause_zh": "两个 goroutine 在无同步的情况下写同一个 map。运行时检测到并发写 map 会直接终止进程，无法 recover。",
  "versions": [
    {
      "version": "1.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "fatal error is not a panic; recover cannot intercept it. The process dies regardless.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If reads also race with writes, the runtime may still report concurrent map read and map write. Both paths need protection.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.97,
      "how": "var mu sync.RWMutex\nmu.Lock()\nm[k] = v\nmu.Unlock()\n\nmu.RLock()\nv := m[k]\nmu.RUnlock()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "var m sync.Map\nm.Store(k, v)\nif v, ok := m.Load(k); ok { _ = v }",
      "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.92,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}