{
  "id": "unity/il2cpp-stack-overflow-recursive",
  "signature": "IL2CPP error: Stack overflow in method 'PlayerController.Update' due to infinite recursion",
  "signature_zh": "IL2CPP 错误：方法“PlayerController.Update”中因无限递归导致堆栈溢出",
  "regex": "IL2CPP error: Stack overflow in method",
  "domain": "unity",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A recursive method call without a base case, or an unintended circular reference, causes the call stack to exceed the maximum depth.",
  "root_cause_type": "generic",
  "root_cause_zh": "没有基本情况的递归方法调用，或意外的循环引用，导致调用堆栈超过最大深度。",
  "versions": [
    {
      "version": "Unity 2022.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2023.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2023.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase the stack size in Player Settings under 'IL2CPP Code Generation'.",
      "why_fails": "Increasing stack size only delays the crash; the underlying infinite recursion is not fixed.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Comment out the entire Update method.",
      "why_fails": "This removes functionality and does not address the recursion in other methods.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Identify and fix the recursion by adding a base case or using an iterative approach. For example, change a recursive function to a loop.",
      "success_rate": 0.95,
      "how": "Identify and fix the recursion by adding a base case or using an iterative approach. For example, change a recursive function to a loop.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a recursion depth counter to break the loop after a certain number of calls.",
      "success_rate": 0.85,
      "how": "Add a recursion depth counter to break the loop after a certain number of calls.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过添加基本情况或使用迭代方法来识别并修复递归。例如，将递归函数更改为循环。",
    "添加递归深度计数器，在达到一定调用次数后中断循环。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.unity3d.com/Manual/IL2CPP-Optimizing.html",
  "official_doc_section": null,
  "error_code": "IL2CPP-404",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.93,
  "resolvable": "true",
  "first_seen": "2025-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}