Windows & BSOD · critical

How to fix UNEXPECTED_KERNEL_MODE_TRAP (0x7F)

Windows & BSOD troubleshooting guide

What this error means

Windows stopped because the processor raised an error (a trap) inside the Windows kernel that the kernel could not handle. A common example is a double fault: an error that happens while the processor is already handling another one. Microsoft says this stop code typically occurs after installing faulty or mismatched hardware, especially memory, or when installed hardware fails. Overclocking can cause it too. Less often, drivers that stack on top of each other, such as several antivirus or backup programs, overflow the kernel stack.

Updated

Applies to
Windows 11 and Windows 10
Difficulty
Intermediate
Before changes
Low; opening a desktop needs care

Reviewed by Matyáš Rada · Documentation checked: 2026-10-31 · Checked against Microsoft's bug check documentation; not tested on every configuration.

Before you begin

Photograph the blue screen and note any recent hardware change. This stop code points to hardware more often than most, so start with the hardware steps. If Windows cannot start, see the startup guide.

Work through these checks

0 of 7 complete
01Remove recently added hardware

Microsoft says this stop code typically follows installing faulty or mismatched hardware, especially memory.

  1. If you added RAM, a graphics card, an expansion card or another device before the crashes began, remove it and test.
  2. If you mixed different RAM kits, test with only the original kit.
  3. Check that new memory is on your motherboard's supported list.

Switch off and unplug the PC before opening it.

What to expect

The crashes stop without the new hardware.

If it does not help

If the new part causes the crash, check its compatibility and BIOS support, or return it.

Browse related errors
02Reset overclocks to default

Microsoft names running the CPU above its rated speed as a cause and says to return it to the default clock speed.

  1. In the BIOS, choose Load optimized defaults, or turn off CPU overclocking and XMP/EXPO memory profiles.
  2. Uninstall overclocking or tuning tools that apply settings at startup.
  3. Test with stock settings for a few days.
What to expect

The PC is stable at default settings.

If it does not help

If the crashes stop, re-enable settings one at a time; keep the last stable one.

Browse related errors
03Test the memory

Microsoft recommends testing all system memory with the Windows memory diagnostic, because memory corruption is a common cause.

  1. Run Windows Memory Diagnostic (Win + R, mdsched.exe) > Restart now and check for problems.
  2. After the restart, check Event Viewer > Windows Logs > System, source MemoryDiagnostics-Results.
  3. On a desktop with several RAM modules, test with one module at a time.
What to expect

The memory test passes on every module.

If it does not help

If a module fails, replace it. The memory test errors guide on this site explains the details.

Browse related errors
04Remove a new or updated driver

Microsoft recommends removing or replacing a driver that was installed or updated just before the error.

  1. Roll back recently updated drivers in Device Manager > device Properties > Driver > Roll Back Driver.
  2. Uninstall recently installed antivirus, backup, encryption or disk tools; their file system filter drivers can overflow the kernel stack, especially when two are installed together.
  3. If the crash happens at startup, do this in Safe Mode (recovery menu > Troubleshoot > Advanced options > Startup Settings > Restart > 4).

Do not run two real-time antivirus programs at the same time.

What to expect

Windows runs without the stop code.

If it does not help

Before a Windows upgrade, Microsoft also advises removing third-party drivers and services and disabling virus scanners.

Browse related errors
05Update the BIOS and controller drivers

Microsoft recommends checking for ACPI/BIOS, disk controller and network card updates.

  1. Install the latest BIOS/UEFI from your PC or motherboard maker.
  2. Install the latest chipset, storage controller and network drivers for your exact model.
  3. Run Windows Update.

Do not switch off the PC during a BIOS update.

What to expect

Firmware and drivers are current and the crashes stop.

If it does not help

Check BIOS settings after the update; they may be reset.

Browse related errors
06Run hardware diagnostics and check the power supply

Microsoft lists failed components, motherboard defects and failing power supplies as causes.

  1. Run the hardware diagnostics from your PC or laptop maker.
  2. Check CPU temperatures under load and clean dust from coolers and fans.
  3. If crashes happen mainly under heavy load, test with a known-good power supply if you can.

Never open a power supply; it can hold dangerous voltage.

What to expect

You find the failing component, or the hardware tests pass.

If it does not help

Replace components that fail diagnostics, or have the PC checked by a technician.

Browse related errors
07Check the trap type in the crash details

The first parameter of the stop code tells which trap occurred, which points toward hardware or software.

  1. In Event Viewer > Windows Logs > System, open the BugCheck event (ID 1001). The first value in brackets after 0x0000007f is the trap number.
  2. 0x00000008 is a double fault: Microsoft names a kernel stack overflow (often filter drivers, step 4) or a hardware problem.
  3. 0x00000006 (invalid opcode) most often comes from hardware memory corruption (steps 1 to 3).
What to expect

You know whether to focus on drivers or hardware.

If it does not help

Give the files in C:\Windows\Minidump to a technician if you need a deeper analysis.

Browse related errors

Possible causes

  • Faulty, mismatched or newly installed RAM
  • A CPU or memory overclock
  • Failing hardware: motherboard, power supply or another component
  • A new or updated driver, including file system filter drivers from antivirus or backup software
  • Outdated BIOS or disk controller drivers

Useful Windows tools

These commands open Windows tools. Review changes before applying them.

mdsched.exe
eventvwr.msc
devmgmt.msc

Sources & further reading