{
  "id": "go/race-condition-detected-race",
  "signature": "WARNING: DATA RACE\nWrite at 0x00c0000b4010 by goroutine 7:\n  main.main.func1()",
  "signature_zh": "警告：数据竞态\n由 goroutine 7 在 0x00c0000b4010 处写入：\n  main.main.func1()",
  "regex": "WARNING:\\ DATA\\ RACE\\\nWrite\\ at\\ 0x00c0000b4010\\ by\\ goroutine\\ 7:\\\n\\ \\ main\\.main\\.func1\\(\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Two goroutines accessed the same memory location concurrently, at least one being a write, without synchronization. Detected when running with the -race flag.",
  "root_cause_type": "generic",
  "root_cause_zh": "两个 goroutine 并发访问同一内存位置，且至少有一个是写操作，未使用同步。使用 -race 标志运行时被检测到。",
  "versions": [
    {
      "version": "1.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The race still exists in production and can cause corrupted data or crashes; the flag only hides detection.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Mixing atomic and non-atomic access to the same variable is itself a race and still flagged by the detector.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "var mu sync.Mutex\nmu.Lock()\ncounter++\nmu.Unlock()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "var counter int64\natomic.AddInt64(&counter, 1)\nn := atomic.LoadInt64(&counter)",
      "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-09-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}