Fix it now
0x00000139 means the kernel detected the corruption of a critical data structure. Parameter 1 is the whole diagnostic: it names the kind of corruption, and the three you are most likely to meet are a stack-based buffer overrun, a corrupted doubly linked list, and an array bounds violation.
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
chkdsk C: /scan
- Get parameter 1 from the BugCheck event in the System log, or from
!analyze -von the newest dump. It is not on the stop screen. - Parameter 1 of 0 or 2 is a stack-based buffer overrun – the same fault 0x000000F7 reports – so read the stack for the last routine before the overrun handlers.
- Parameter 1 of 3 is LIST_ENTRY corruption, which Microsoft says is hard to track down and which is nearly always a driver defect rather than hardware.
- Update every third-party driver from its hardware vendor, and remove kernel-level software you no longer use.
- Test memory with Windows Memory Diagnostics using the extended test mix, and read the result in the System log.
Parameter 1 of 6 has a very specific meaning: the loader did not properly initialise the stack security cookie, which can happen when a driver built only for Windows 8 is loaded on an earlier version. It is a compatibility problem, not corruption.
If the machine is stable with drivers current and memory clean, stop here. The next section explains what the checks are and how to read the parameter table.
Why it happens
Windows compiles its kernel and much of its driver surface with security instrumentation: stack cookies below return addresses, bounds checks the compiler inserts on array indexing, Control Flow Guard checks on indirect calls, and consistency checks on the doubly linked lists the kernel uses everywhere. When one of those checks finds something impossible, continuing is not an option – the machine may already be executing whatever an overrun wrote – so it stops immediately with 0x00000139.
Parameter 1 is what the check found, and the published table is long enough to be genuinely useful. 0 is a legacy stack-buffer overrun and 2 is a stack cookie violation – both mean a routine wrote past a local buffer far enough to reach its own return address. 1 is a corrupted virtual function table. 3 is LIST_ENTRY corruption. 5 is an invalid parameter passed to a function that treats invalid parameters as fatal. 8 is a compiler-inserted array bounds check catching an illegal index. 10 is an indirect call guard check catching an invalid control transfer. 11 is a write guard check. 29 is a corrupted red-black tree node.
Subtype 3 deserves its own paragraph because it is common and because Microsoft publishes the driver-side causes. A doubly linked list has been made inconsistent, and the inconsistency is usually not detected when it happened. The documented causes are a corrupted kernel synchronisation object – a KEVENT double-initialised while a thread waits on it, or a stack-based KEVENT going out of scope while another thread is using it; a corrupted periodic KTIMER; calling RemoveEntryList twice on the same entry without reinserting it; freeing a structure containing a LIST_ENTRY without unlinking it first; and concurrent list access with no synchronisation, producing a torn update.
0x000000F7 is the same class of fault reported separately: a driver overran a stack-based buffer in a way that would have overwritten the return address, which Microsoft calls the classic buffer overrun attack, and the system stops to prevent it. Its parameters are the actual cookie found, the expected cookie and its bit-complement. 0x0000013A is the heap manager rather than the stack, with its own parameter 1 table of corruption kinds. 0x00000109 is critical kernel code or data corruption, which has three documented causes and only one of them is corruption in the ordinary sense.
A driver overrunning a stack buffer
You have this one if Parameter 1 of 0, 2 or 8 on 0x139, or the code is 0x000000F7.
- Run
kbon the dump. Microsoft says the last routine on the stack before the buffer overrun handlers and the bug check call is the one that overran its local variable. - Update that driver from the vendor, or remove the product that supplies it.
- If the crash started after a driver update, roll back and confirm the machine is stable on the previous version.
- Report the dump to the vendor. A named routine and a cookie mismatch is an unambiguous defect.
A corrupted linked list
You have this one if Parameter 1 of 3, and often a stack in nt!Ke or nt!Ki code, which makes it look like Windows itself is at fault.
- In the debugger, walk the list forwards and backwards with
dlanddlband compare. Where the two disagree is where the corruption is. - Look closely at the neighbours of the corrupted entry – Microsoft notes they are often the real culprit.
- Update the third-party drivers involved in that path, particularly anything that owns timers or events.
- On a test machine, run the standard Driver Verifier option set against the suspects to force the fault onto the writer.
Failing memory
You have this one if The subtype varies between crashes, and other memory-manager codes such as 0x0000001A or 0x00000050 appear in the same history.
- Run Windows Memory Diagnostics with the test mix set to Extended and read the MemoryDiagnostics-Results entry in the System log.
- Return firmware to stock settings, including memory profiles, before drawing any conclusion.
- Test one module at a time where more than one is fitted.
- Run the manufacturer’s own diagnostics as well, which usually cover more than memory.
A debugger left half-attached, or a driver patching the kernel
You have this one if The code is 0x00000109 rather than 0x139, on a development or lab machine.
- Check whether a normal breakpoint was set with a debugger that was not attached when the system started. Microsoft documents that as a cause:
bprequires the debugger to be attached at start time, whilebacan be set at any time. - On x64 Windows the kernel cannot legitimately be patched except through authorised Microsoft hot patches, so a driver modifying kernel code or data is the second documented cause.
- Hardware corruption is the third – kernel code or data stored in memory that failed.
- Parameter 4 identifies the type of the corrupted region, which separates these.
Full reference
0x00000139 parameter 1, the values worth recognising
| Value | What the check found |
|---|---|
0 |
A stack-based buffer was overrun (legacy /GS violation) |
1 |
VTGuard detected an attempt to use an illegal virtual function table, typically a corrupted C++ object |
2 |
Stack cookie instrumentation detected a stack-based buffer overrun |
3 |
A LIST_ENTRY is corrupted, for example a double remove |
5 |
An invalid parameter was passed to a function that treats that as fatal |
6 |
The loader did not properly initialise the stack security cookie |
8 |
A compiler-inserted array bounds check detected an illegal indexing operation |
10 |
An indirect call guard check detected an invalid control transfer |
11 |
A write guard check detected an invalid memory write |
14 |
The reference count for an object is invalid |
19 |
An unsafe modification was made to read-only data |
21 |
An invalid exception chain was detected |
28 |
An out of bounds buffer access was detected |
29 |
An RTL_BALANCED_NODE red-black tree entry is corrupted |
0x0000013A, the heap side
| Value | What the heap manager found |
|---|---|
0x3, 0x4, 0x5 |
A corrupt entry header, several of them, or one in a large allocation |
0x6 |
Corruption with features consistent with a buffer overrun |
0x7 |
Corruption with features consistent with a buffer underrun |
0xB |
Features consistent with using a block after freeing it |
0xD |
A corrupt free list – a use-after-free, or an overflow of an adjacent block |
0x11 |
Invalid internal state, possibly a double free or heap corruption |
0x17 |
A block corrupted in a delay free list, likely a use-after-free or an adjacent overflow |
!heap in the debugger displays heap usage, controls breakpoints in the heap manager, detects leaked blocks and shows page heap information, and it is the documented companion to that table.
Reading 0x00000109 without jumping to conclusions
CRITICAL_STRUCTURE_CORRUPTION has three documented causes and they lead in completely different directions. The first is a driver modifying critical kernel code or data, which on x64 from Windows Server 2003 SP1 onwards is not permitted except through authorised hot patches. The second is a developer setting a normal breakpoint with a kernel debugger that was not attached at start time. The third is hardware corruption, such as kernel code stored in memory that failed. Parameter 4 identifies which region was corrupted. Reading only the first cause is how a lab machine with a stray breakpoint ends up being rebuilt.
Commands that apply across all four codes
| Command | What it does |
|---|---|
!analyze -v |
Automated analysis, including the parameter breakdown |
kb |
The stack backtrace – on 0xF7, the routine before the overrun handlers |
dl / dlb |
Walk a linked list forwards and backwards to find where they disagree |
!heap |
Heap usage, page heap information and heap manager breakpoints |
sfc /scannow |
Repairs missing or corrupted system files |
DISM /Online /Cleanup-Image /RestoreHealth |
Repairs the component store when sfc cannot |
When every check comes back clean
- Compare parameter 1 across several dumps. A stable subtype points at one defect; a varying one points at memory.
- Check the System log for storage and WHEA events in the same window as each crash.
- Remove kernel-level software you do not need – virtual drive tools, old backup agents, monitoring suites.
- On a test machine, enable the standard Driver Verifier set against third-party drivers and let it force the fault onto the writer.
- If the machine is virtual, check the host as well: a guest can be handed corrupted memory by a host with failing hardware.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0x00000139 |
KERNEL_SECURITY_CHECK_FAILURE: the kernel detected the corruption of a critical data structure. Parameter 1 is the corruption type – 0 and 2 stack-buffer overruns, 1 an illegal virtual function table, 3 LIST_ENTRY corruption, 8 an array bounds violation, 10 an indirect call guard failure, and others | Microsoft Learn |
0x000000F7 |
DRIVER_OVERRAN_STACK_BUFFER: a driver overran a stack-based buffer in a way that would have overwritten the function’s return address. Parameters 1 to 3 are the actual security cookie, the expected cookie and its bit-complement | Microsoft Learn |
0x0000013A |
KERNEL_MODE_HEAP_CORRUPTION: the kernel mode heap manager detected corruption in a heap. Parameter 1 names the kind – corrupt entry header, buffer overrun, buffer underrun, use-after-free, corrupt free list, double free and others | Microsoft Learn |
0x00000109 |
CRITICAL_STRUCTURE_CORRUPTION: the kernel detected critical kernel code or data corruption. Three documented causes – a driver modifying critical kernel code or data, a normal breakpoint set with a debugger that was not attached at start time, and hardware corruption. Parameter 4 identifies the corrupted region | Microsoft Learn |
Confirm the fix worked
sfc /scannowreports no integrity violations and DISM completes without errors.- Windows Memory Diagnostics passes an extended run, recorded in the System log.
- The machine runs its full workload for several days with no new dump files.
- If a driver was replaced, the parameter 1 subtype that used to appear no longer does.
verifier /querysettingsreports no active verification if you used it during the investigation.
Questions people ask about this
Is 0x00000139 a virus?
No. The name refers to compiler and kernel security instrumentation – stack cookies, bounds checks, control flow guard – not to malware detection. The checks exist because buffer overruns are exploitable, but what they usually catch is an ordinary driver defect.
Where do I find parameter 1?
The BugCheck event in the System log records the code and its parameters, and !analyze -v on the dump gives the same. Current stop screens do not display them.
Parameter 1 is 3. What am I looking for?
A corrupted doubly linked list. Microsoft’s documented driver-side causes are a double RemoveEntryList, freeing a structure containing a LIST_ENTRY without unlinking it, a stack-based KEVENT going out of scope while another thread waits on it, a corrupted periodic KTIMER, and unsynchronised concurrent list access.
Should I reinstall Windows?
Not as a first step. sfc /scannow and DISM repair the system files, driver updates address the usual cause, and a memory test covers the hardware case. A reinstall replaces the files but not a faulty third-party driver, which will be reinstalled with everything else.
Is 0x00000109 always someone patching the kernel?
No, and assuming so wastes time. A normal breakpoint set from a debugger that was not attached at start time is a documented cause, as is hardware corruption. Parameter 4 tells you which region was affected.
