Quick answer: Exception code 0xc00000fd is STATUS_STACK_OVERFLOW: one thread used up all the stack memory reserved for it. On Windows the default reservation is 1 MB per thread. The cause is almost always recursion that never stops (a property that returns itself, two handlers that trigger each other), recursion that is correct but too deep for the data (flood fill, a cyclic object graph), or a very large local array. A dump shows it at once as the same few frames repeated down the stack.

The game closes with no error dialog, or the engine reports a stack overflow, and Event Viewer shows exception code 0xc00000fd. Compared with other native crash codes this one is friendly: it is deterministic, it is nearly always in your own code, and the call stack names the culprit many times over. This guide covers what the code means, the patterns that cause it in each engine, how to read it from a dump, and the four fixes: break the cycle, replace recursion with a loop, move big buffers off the stack, and give your own threads more room.

The exact error

In Event Viewer > Windows Logs > Application, source Application Error, event ID 1000:

Faulting application name: MyGame.exe, version: 1.2.0.0, time stamp: 0x66f2a1b0
Faulting module name: MyGame.exe, version: 1.2.0.0, time stamp: 0x66f2a1b0
Exception code: 0xc00000fd
Fault offset: 0x00000000001b7c34
Faulting application path: C:\Program Files (x86)\Steam\steamapps\common\My Game\MyGame.exe
Faulting module path: C:\Program Files (x86)\Steam\steamapps\common\My Game\MyGame.exe

Under a debugger:

WinDbg:
(336c.264c): Stack overflow - code c00000fd (first chance)

Visual Studio:
Unhandled exception at 0x00007FF6A1D27C34 in MyGame.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x000000D3F1E03FF8).

Engines put their own words on it:

Unreal Engine:
Unhandled Exception: EXCEPTION_STACK_OVERFLOW

Unity (Editor log, C# recursion):
StackOverflowException: The requested operation caused a stack overflow.

Godot (GDScript, reported as a script error):
Stack overflow (stack size: 1024)

The process IDs, addresses and offsets are examples. The faulting module is whichever module contained the function that made the last, failing call, so it is usually the module that holds the recursive code.

What the code means

Every thread has its own stack: a fixed range of memory that holds the return address, saved registers and local variables of each function call in progress. Windows reserves the range when the thread is created and commits pages as the stack grows, using a guard page to detect growth. When the thread reaches the end of its reservation there is no room for another guard page, and the system raises STATUS_STACK_OVERFLOW, described in the Windows headers as “A new guard page for the stack cannot be created.”

Three numbers matter:

Microsoft’s debugging documentation lists two further causes that have nothing to do with your code: the thread cannot extend its stack because the page file is full, or because the system is in the brief period of extending the page file. These are rare and belong to a machine that is out of memory.

Do not confuse this code with 0xc0000409, STATUS_STACK_BUFFER_OVERRUN. That one reports a write past a stack buffer or a deliberate fail-fast, and it is covered in How to Fix “Unhandled exception code 0xc0000409” (Stack Buffer Overrun) Crashes in Games.

What causes it

CauseExampleWhat the stack looks like
Infinite self-recursionA property whose getter returns the property; a setter that assigns to itself; a method that calls itself with unchanged argumentsOne frame repeated to the limit
Infinite mutual recursionA UI slider’s change handler sets a value whose change handler sets the slider; TakeDamage triggers OnDeath, which calls TakeDamageA group of two to five frames repeated
Deep but finite recursionRecursive flood fill on a large open area; recursive scene-tree, quadtree or JSON traversal; pathfinding written recursivelyOne frame repeated, crash only on large inputs
Cycle in dataA serializer or a “find root” walk over objects that refer back to each other; a parent chain where a node is its own ancestorRepeating frames, crash only with certain saves or scenes
Large localsfloat cost[512][512]; inside a function; a big struct passed or returned by value; alloca with a size taken from dataA short stack whose top frame is the stack probe (_chkstk or __chkstk)
Small thread stackNormal code that works on the main thread overflows when moved to a worker thread created with a smaller stackModerate depth, no repetition

The third and fourth rows are the ones that reach players. The code passed every test on your maps and overflows on a player’s larger base, longer save or modded level.

How it shows up in each engine

Unity

C# recursion is the usual source, and the property getter that returns itself is the classic. What you see depends on where it runs. In the Editor the log may contain StackOverflowException: The requested operation caused a stack overflow., and Unity’s own position is that the Editor cannot recover from a stack overflow, so expect it to close. Do not design around catching this exception in a player build. With the IL2CPP backend your C# is compiled to C++ inside GameAssembly.dll, recursion consumes the native thread stack like any other C++ code, and the player dies with 0xc00000fd and GameAssembly.dll as the usual faulting module. The patterns and their C# fixes are in How to Fix a StackOverflowException in Unity.

Unreal Engine

The crash reporter and log show EXCEPTION_STACK_OVERFLOW. Typical sources are recursive C++ functions, delegates that re-broadcast themselves, and large stack arrays in functions that run on task or worker threads. The Unreal-specific causes and switches are in How to Fix “EXCEPTION_STACK_OVERFLOW” Crashes in Unreal Engine.

Godot

GDScript has its own call depth limit. Runaway script recursion is stopped by the script runtime and reported as the script error Stack overflow (stack size: 1024), which is a different failure from the native code in this article; see How to Fix “Stack overflow (stack size: 1024)” Recursion Errors in Godot. A real 0xc00000fd in a Godot game comes from native code: a GDExtension, a C++ module, or C# scripts, where .NET ends the process on a stack overflow and does not let you catch it.

Custom engines and native plugins

Everything in the causes table applies directly. Pay particular attention to recursive parsers that read save files, level files or network data: the nesting depth is chosen by the file, and a damaged or hostile file can choose a large one.

Reading it from a dump

A crash handler that runs inside the process has a problem with this exception: it has to run on the thread that has no stack left. Engine crash reporters therefore sometimes fail to appear, and the game just vanishes. Windows Error Reporting works from outside the process, so the Event Viewer entry is still written, and a dump can be collected with the registry key described in How to Collect Windows Crash Dumps From Players With WER LocalDumps. If you write your own handler, call SetThreadStackGuarantee on each thread at startup to keep some stack available for it during a stack overflow.

Open the dump in WinDbg with the symbols for the build:

.symfix
.sympath+ C:\builds\1.2.0\symbols
.reload
!analyze -v
.ecxr
kc 100
!teb

kc prints the call stack as module and function names only, which makes repetition easy to see. The number is a frame count and is read as hexadecimal by default, so 100 shows up to 256 frames. A self-recursion looks like this:

00 MyGame!Grid::Fill
01 MyGame!Grid::Fill
02 MyGame!Grid::Fill
03 MyGame!Grid::Fill
...

and a mutual recursion like this:

00 MyGame!HealthBar::SetValue
01 MyGame!Player::OnHealthChanged
02 MyGame!Player::SetHealth
03 MyGame!HealthBar::OnSliderChanged
04 MyGame!HealthBar::SetValue
05 MyGame!Player::OnHealthChanged
...

The repeating group is the bug. To see what started it, raise the frame count until the output reaches the non-repeating frames at the bottom.

!teb prints StackBase and StackLimit for the thread. Their difference is how much stack was in use, and a value close to the reservation confirms a true overflow. If the stack is only a few frames deep and the top frame is _chkstk or __chkstk, you have the large-locals case: the compiler inserts that probe in functions whose locals exceed a threshold (4 KB on x86, 8 KB on x64), and the function directly below it is the one that asked for too much.

Without symbols you can still classify the crash. Many identical return addresses repeating down the stack mean recursion, and the Event Viewer fault offset tells you whether all your reports are the same site. How to read and compare the fault offset is covered in “Faulting module name” in Event Viewer: How to Read a Windows Game Crash Entry.

Fix 1: break the cycle

The self-referencing property, in C#:

// Broken: the getter and setter call themselves
public int Health
{
    get { return Health; }
    set { Health = value; }
}

// Fixed: a backing field with a different name
private int health;

public int Health
{
    get { return health; }
    set { health = value; }
}

Two handlers that feed each other need one of them to stop the echo. Compare before writing, or use an update that does not notify. In Unity UI:

// Broken: setting slider.value raises onValueChanged, which calls SetHealth again
void OnHealthChanged(int health)
{
    slider.value = health;
}

void OnSliderChanged(float value)
{
    player.SetHealth((int)value);   // raises OnHealthChanged
}

// Fixed: update the control without firing its event
void OnHealthChanged(int health)
{
    slider.SetValueWithoutNotify(health);
}

Where no such method exists, a reentrancy flag does the same job in any language:

bool updating = false;

void SetHealth(int value)
{
    if (updating || value == health) return;
    updating = true;
    health = value;
    NotifyHealthChanged(value);
    updating = false;
}

For walks over object graphs, record what you have visited. This turns a cycle from an infinite recursion into a no-op:

void Visit(Node* node, std::unordered_set<Node*>& seen)
{
    if (!seen.insert(node).second) return;   // already visited
    for (Node* next : node->links)
        Visit(next, seen);
}

Fix 2: replace deep recursion with an explicit stack

A visited set stops cycles. It does not help when the recursion is legitimately deep. Recursive flood fill is the standard example: it is correct, and its depth can equal the number of cells in the region.

// Overflows on a large open area. Also recurses forever when from == to.
void Fill(Grid& g, int x, int y, int from, int to)
{
    if (x < 0 || y < 0 || x >= g.width || y >= g.height) return;
    if (g.at(x, y) != from) return;
    g.at(x, y) = to;
    Fill(g, x + 1, y, from, to);
    Fill(g, x - 1, y, from, to);
    Fill(g, x, y + 1, from, to);
    Fill(g, x, y - 1, from, to);
}

Move the pending work from the call stack to a container on the heap, which can grow to whatever the data needs:

void Fill(Grid& g, int startX, int startY, int from, int to)
{
    if (from == to) return;

    std::vector<std::pair<int, int>> open;
    open.push_back({startX, startY});

    while (!open.empty())
    {
        auto [x, y] = open.back();
        open.pop_back();

        if (x < 0 || y < 0 || x >= g.width || y >= g.height) continue;
        if (g.at(x, y) != from) continue;

        g.at(x, y) = to;
        open.push_back({x + 1, y});
        open.push_back({x - 1, y});
        open.push_back({x, y + 1});
        open.push_back({x, y - 1});
    }
}

The same transformation works for tree and scene traversal, dependency resolution and recursive pathfinding. For parsers that read files, keep the recursion if you prefer and add a depth counter that rejects input nested deeper than a fixed limit with a normal error. A save file should be able to fail to load. It should not be able to choose your stack depth.

Fix 3: big buffers and thread stack sizes

Move large locals to the heap. This array is exactly 1,048,576 bytes, the whole default stack, and the function overflows on entry before its first line runs:

void BuildNavGrid()
{
    float cost[512][512];
    // ...
}
void BuildNavGrid()
{
    std::vector<float> cost(512 * 512);
    // index as cost[y * 512 + x]
}

Large frames also multiply with recursion: a 4 KB path buffer inside a recursive directory walk costs 4 KB per level. MSVC’s code analysis warns about big frames as C6262, with a default threshold of 16 KB.

Raising the stack size is a legitimate fix for threads you create when the work is bounded and known to be deep. It is a poor fix for unbounded recursion, because larger input overflows the larger stack too.

// Win32: reserve 8 MB for this thread
HANDLE worker = CreateThread(nullptr, 8 * 1024 * 1024, WorkerMain, nullptr,
                             STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
// C#: the second constructor argument is the maximum stack size in bytes
var worker = new Thread(GenerateWorld, 8 * 1024 * 1024);
worker.Start();

Without STACK_SIZE_PARAM_IS_A_RESERVATION, the size passed to CreateThread is the initial commit and the reservation stays at the executable’s default. std::thread has no stack size parameter. In Unreal, FRunnableThread::Create takes a stack size argument. For an executable you link yourself, the linker option /STACK:reserve sets the default for the main thread and for threads created without an explicit size.

What to ask players, and how to confirm the fix

A stack overflow in game code depends on data, so the most valuable thing a player can send is the data: the save file, the level, the list of mods. Ask for:

  1. The Application Error text from Event Viewer (the faulting module and offset group identical crashes).
  2. The save or level that was loaded, and what they did in the last minute.
  3. Whether it happens every time at the same point. Recursion bugs do.
  4. A dump, if the first three do not let you reproduce it.

Player-side workarounds are limited, and it is better to say so. Loading an earlier save or removing a mod avoids the input that triggers the bug. Verifying the game files helps only when a damaged data file caused the depth. On a PC that is out of memory with a small or disabled page file, closing other programs or letting Windows manage the page file addresses the rare case where the stack could not grow.

To confirm a fix, turn the failing input into a test: the largest map you support filled in one region, an object graph with a deliberate cycle, a file nested a thousand levels deep. Run it on the thread type that runs it in the game, since worker stacks may be smaller than the main thread’s. Then check that the offset you grouped the reports by stops appearing in the new build.

Where Bugnet fits

Bugnet does not capture native crashes as stack traces and does not process minidumps, so a player build that dies with 0xc00000fd sends nothing by itself, and the session is not counted as crashed in the crash-free session rate. The parts of this failure that a game can still observe do arrive. The Unity SDK captures logged exceptions through Application.logMessageReceived, so a StackOverflowException that Unity manages to log is filed with its stack trace and recent log lines, and repeats stack under one title with an occurrence count. The Godot SDK reads the engine log file, where the GDScript Stack overflow (stack size: 1024) error is written, provided File Logging is enabled for the export. The Unreal SDK binds the engine’s fatal error delegate, which may not get to run when the crashing thread has no stack left.

For the native case, the in-game report form is the practical route: a player who restarts and writes “crashes when I load my big base” produces a report with OS version, CPU, GPU, RAM and game version, and if they left a contact email you can ask them for the save. Save the copied Event Viewer entry or your kc output as a text file and attach it to that report, as described in the bug reports docs, so the repeating frames sit next to the reproduction steps.

Frequently asked questions

What does exception code 0xc00000fd mean?

It is STATUS_STACK_OVERFLOW. A thread used all of the stack memory reserved for it, almost always because of recursion that never ends, recursion that is too deep for the data, or a very large local variable.

What is the default stack size on Windows?

The linker's default reservation is 1 MB. It is stored in the executable's header and used for the main thread and for threads created without an explicit size. Engines and runtimes can choose different sizes for the worker threads they create.

Can I fix a stack overflow by increasing the stack size?

Only when the depth is bounded and you know the bound, for example a worker thread that runs a deep but finite algorithm. For recursion whose depth depends on player data, a larger stack just moves the limit, and the fix is an explicit stack on the heap or a guard that breaks the cycle.

Why does my game close without an error message on a stack overflow?

A crash handler inside the process has to run on the thread that has no stack left, so engine crash dialogs often fail to appear. Windows Error Reporting works from outside the process and still writes the Application Error event, and it can write a dump if local dumps are enabled.

How is 0xc00000fd different from 0xc0000409?

0xc00000fd means the stack ran out of space. 0xc0000409 is STATUS_STACK_BUFFER_OVERRUN, which reports a write past the end of a buffer on the stack or a deliberate fast-fail by the runtime. They have different causes and different fixes.

A stack overflow is the most readable native crash there is, because the dump shows the same frames repeating. Break the cycle or move the recursion onto a heap-allocated stack, and treat a bigger thread stack as the last option.