{
  "id": "go/map-concurrent-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 or more goroutines write to the same map without synchronization. The runtime detects overlapping writes and aborts the program.",
  "root_cause_type": "generic",
  "root_cause_zh": "多个 goroutine 在无同步的情况下写入同一个 map，运行时检测到重叠写入并中止程序。",
  "versions": [
    {
      "version": "1.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The runtime detector may still fire and the race is not eliminated, only made less frequent.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Atomic values do not protect the map's internal buckets; the map itself is still raced.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.94,
      "how": "var mu sync.RWMutex\nmu.Lock()\nm[key] = value\nmu.Unlock()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "var m sync.Map\nm.Store(key, value)\nv, ok := m.Load(key)",
      "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-04-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}