{
  "id": "go/data-race-detected-by-race-detector",
  "signature": "WARNING: DATA RACE\nWrite at 0x00c0000b4010 by goroutine 7:\n  main.increment()\n      /app/main.go:12 +0x44",
  "signature_zh": "WARNING: DATA RACE\n写入 0x00c0000b4010 由 goroutine 7：\n  main.increment()\n      /app/main.go:12 +0x44",
  "regex": "WARNING:\\ DATA\\ RACE\\\nWrite\\ at\\ 0x00c0000b4010\\ by\\ goroutine\\ 7:\\\n\\ \\ main\\.increment\\(\\)\\\n\\ \\ \\ \\ \\ \\ /app/main\\.go:12\\ \\+0x44",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The race detector observed unsynchronized concurrent access to the same memory. Common with shared counters, slices, or struct fields accessed from multiple goroutines.",
  "root_cause_type": "generic",
  "root_cause_zh": "竞态检测器观察到对同一内存的未同步并发访问。常见于多 goroutine 访问的共享计数器、slice 或结构体字段。",
  "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": "The bug still exists; you just stop seeing reports while corrupt data and crashes continue.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Yielding does not provide memory ordering or mutual exclusion; races remain.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.97,
      "how": "var mu sync.Mutex\nfunc inc() {\n    mu.Lock()\n    counter++\n    mu.Unlock()\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "var counter int64\natomic.AddInt64(&counter, 1)",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}