{
  "id": "go/goroutine-goroutine-leak",
  "signature": "fatal error: runtime: goroutine stack exceeds 1000000000-byte limit",
  "signature_zh": "致命错误：运行时：协程栈超过1000000000字节限制",
  "regex": "fatal\\ error:\\ runtime:\\ goroutine\\ stack\\ exceeds\\ 1000000000\\-byte\\ limit",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Goroutines are leaked because they are blocked forever on channels or locks, causing stack memory to grow unboundedly.",
  "root_cause_type": "generic",
  "root_cause_zh": "协程因在通道或锁上永久阻塞而泄漏，导致栈内存无限制增长。",
  "versions": [
    {
      "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": "Increasing stack limit",
      "why_fails": "Does not fix the leak; only delays the crash.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using time.Sleep to periodically check",
      "why_fails": "Sleep does not unblock goroutines; they remain blocked.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use context with timeout to unblock goroutines",
      "success_rate": 0.95,
      "how": "ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\ndefer cancel()\nselect {\ncase <-ch:\ncase <-ctx.Done():\n    // timeout, handle cleanup\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure every goroutine has a clear exit path",
      "success_rate": 0.98,
      "how": "done := make(chan struct{})\ngo func() {\n    defer close(done)\n    // work\n}()\n<-done",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-04-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}