Fix ERROR_TIMER_NOT_CANCELED (0X0000021D) on Windows 10/11
Windows timer that won't cancel? Here's why that happens and how to fix it. Three tiers: quick reboot, driver cleanup, or kernel debug.
What's actually happening here
ERROR_TIMER_NOT_CANCELED, bugcheck code 0x0000021D, means the Windows kernel tried to cancel a timer object – a scheduled callback – but the timer wouldn't stop. This isn't a normal app error. It's a system crash (blue screen) that happens when a driver or kernel component sets a timer, then needs to tear it down, but the timer's dispatch routine is still running or blocked. The bugcheck is a safety mechanism: the kernel refuses to unload that driver while its timer is live. You'll see this most often when plugging in or unplugging USB devices, changing power states (sleep/hibernate), or loading/unloading third-party drivers.
Tier 1: Simple fix (30 seconds)
Reboot cleanly
Before you blame hardware, reboot from a full shutdown, not a restart. In Windows 10/11, "Restart" sometimes skips driver reinitialization. Do this instead:
- Open a command prompt as admin.
- Type:
shutdown /s /f /t 0 - Hit Enter. Wait for the machine to power off completely.
- Boot back up normally.
Why this works sometimes: The /f flag forces all running processes – including stuck timer callbacks – to terminate. A cold boot reinitializes the kernel timer subsystem from scratch. If the timer was orphaned by a misbehaving service, this clears it. If the error comes back, you've got a deeper problem.
Also check for pending Windows updates. Run wuauclt /detectnow or just hit Settings > Windows Update > Check for updates. Microsoft has patched timer-related bugs in cumulative updates for Windows 10 22H2 and Windows 11 23H2.
Tier 2: Moderate fix (5 minutes)
Clean up problematic drivers
The real culprit is usually a driver that either creates timers incorrectly or fails to cancel them before unloading. Focus on these categories:
- USB controllers: common with third-party USB 3.0/3.1 drivers (especially ASMedia, Renesas, VIA).
- Network adapters: Realtek PCIe GbE, Killer Ethernet, or Wi-Fi drivers often have timer bugs on sleep/wake cycles.
- Virtual machine software: VMware, VirtualBox, Hyper-V integration components.
- Antivirus: some low-level AV hooks call
KeSetTimerinternally.
Here's the procedure:
- Open Device Manager (
devmgmt.msc). - For each suspect category, right-click the device > Properties > Driver tab > Roll Back Driver if available. If not, uninstall the device, check "Delete the driver software for this device," then reboot. Windows will reinstall its own signing-certified version.
- For network adapters, download the latest driver from the hardware vendor's site (Intel, Realtek, etc.) – not from Windows Update. Install manually.
- Run
verifier /resetfrom an admin command prompt to clear any stale driver verifier settings that might cause false positives.
Why this works: The error 0x0000021D is often triggered when a driver's DriverUnload routine calls KeCancelTimer but the timer's DPC (Deferred Procedure Call) is still queued on another CPU core. Windows sees the timer object still armed and refuses to let the driver unload. Replacing that driver with a more stable version eliminates the race condition.
If you're not sure which driver is guilty, check the minidump file (C:\Windows\Minidump\*.dmp) using WinDbg or BlueScreenView. Look for the IMAGE_NAME field – that's the driver module in memory when the crash happened. Uninstall or update that specific driver.
Tier 3: Advanced fix (15+ minutes)
Manual timer cleanup using Kernel Debugging
If you're still crashing after Tier 2, the driver is genuinely buggy or there's corrupted kernel memory. You can verify and sometimes force-clean the stuck timer using WinDbg (part of Windows SDK). This assumes you're comfortable with command-line debugging.
- Install Windows SDK and launch WinDbg as admin.
- Open the minidump: File > Open Crash Dump > select the latest .dmp from C:\Windows\Minidump.
- Run this in the debugger console:
!analyze -v - Look for the
BUGCHECK_CODEline – it should read0x1d. Below that, find theFAILURE_BUCKET_IDandMODULE_NAME. That's your driver. - To inspect the timer itself, type:
!timer
This lists all active kernel timers. Find one with aDueTimefar in the future or aPeriodthat's suspicious (like 0xffffffff). Note itsTimerObjaddress. - Cancel the timer manually with:
!cancelTimer address
(replace address with the hex address from step 5). - If the timer can't be canceled (you get "Timer already signaled" or "Timer in DPC"), the driver's DPC routine is stuck. You'll need to check the DPC queue:
!dpcs
Look for any DPC that hasType = 0x1andDeferredRoutinepointing back to the same driver. That's your smoking gun.
If manual cancel doesn't work, the only safe path is to:
- Disable the offending driver via Device Manager or
sc config. - Contact the driver vendor with the exact crash dump and timer address. They can fix the race condition in their
KeCancelTimercall.
Why this works (when it does): !cancelTimer in WinDbg calls the kernel's KeCancelTimer routine directly, bypassing the driver's buggy unload path. But this is a debugging command, not a permanent fix – the timer will reoccur on next driver load. The real fix is to eliminate the driver that can't properly cancel its timers.
If nothing works
You're likely dealing with a hardware issue – failing CPU, motherboard VRM, or RAM corruption that causes kernel timer structures to go stale. Run MemTest86+ for 4 passes. If errors appear, replace the RAM. No errors? Try reseating all power connectors and the CPU. I've seen this error twice in 10 years on systems with dying northbridge chipsets. The timer subsystem is extremely sensitive to memory corruption.
"The kernel doesn't crash because it wants to. It crashes because a driver lied about cleaning up its timers."
Was this solution helpful?