KERNEL_MODE_HEAP_CORRUPTION when launching Windows Terminal with my default profile set to WSL, before Ubuntu has loaded. #13517

Closed
opened 2026-01-31 03:44:49 +00:00 by claunia · 5 comments
Owner

Originally created by @AleksandrHovhannisyan on GitHub (Apr 17, 2021).

Windows Terminal version (or Windows build number)

1.7.1033.0

Other Software

No response

Steps to reproduce

  1. Set your default Windows Terminal profile to be your WSL distro/profile.
  2. Restart your machine for a clean slate.
  3. Open Windows Terminal without first launching WSL/your Linux distro.
  4. On my end, I get a BSOD with KERNEL_MODE_HEAP_CORRUPTION shortly after clicking the Windows Terminal icon on my taskbar.

This may help narrow down the issue: The error does not occur if I first start up WSL/Ubuntu separately and wait for my profile to fully load before I launch Windows Terminal. I do this with Windows+R and run the command ubuntu (alternatively, you can search for your distro and run it via the start menu). Windows Terminal then loads just fine.

Expected Behavior

Windows Terminal should not crash my PC.

Actual Behavior

As soon as I click Windows Terminal on a fresh restart, it crashes my PC with a BSOD and KERNEL_MODE_HEAP_CORRUPTION as the error.

Originally created by @AleksandrHovhannisyan on GitHub (Apr 17, 2021). ### Windows Terminal version (or Windows build number) 1.7.1033.0 ### Other Software _No response_ ### Steps to reproduce 1. Set your default Windows Terminal profile to be your WSL distro/profile. 2. Restart your machine for a clean slate. 3. Open Windows Terminal without first launching WSL/your Linux distro. 4. On my end, I get a BSOD with `KERNEL_MODE_HEAP_CORRUPTION` shortly after clicking the Windows Terminal icon on my taskbar. This may help narrow down the issue: The error does **not** occur if I first start up WSL/Ubuntu separately and wait for my profile to fully load before I launch Windows Terminal. I do this with `Windows+R` and run the command `ubuntu` (alternatively, you can search for your distro and run it via the start menu). Windows Terminal then loads just fine. ### Expected Behavior Windows Terminal should not crash my PC. ### Actual Behavior As soon as I click Windows Terminal on a fresh restart, it crashes my PC with a BSOD and `KERNEL_MODE_HEAP_CORRUPTION` as the error.
claunia added the Product-WSLNeeds-TriageResolution-ExternalNeeds-Tag-Fix labels 2026-01-31 03:44:49 +00:00
Author
Owner

@DanPinGF commented on GitHub (Dec 9, 2021):

Can you try debugging the crash, at least through WinDbg?

@DanPinGF commented on GitHub (Dec 9, 2021): Can you try debugging the crash, at least through WinDbg?
Author
Owner

@AleksandrHovhannisyan commented on GitHub (Dec 9, 2021):

Hmm, not sure how I'd do that since it would give me a blue screen of death (crashing my OS).

It's also only on fresh boots, so it would be a bit time-consuming to repro. I guess we can just close this if it's too hard to debug.

@AleksandrHovhannisyan commented on GitHub (Dec 9, 2021): Hmm, not sure how I'd do that since it would give me a blue screen of death (crashing my OS). It's also only on fresh boots, so it would be a bit time-consuming to repro. I guess we can just close this if it's too hard to debug.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Dec 9, 2021):

If you have another computer that runs Windows, or can reproduce the BSOD in a virtual machine, see Setting Up Kernel-Mode Debugging.

Otherwise, you could check the memory dump options and see if the previous BSOD has left a dump that you can open in WinDbg.

I don't know whether Secure Boot makes these things more difficult nowadays.

@KalleOlaviNiemitalo commented on GitHub (Dec 9, 2021): If you have another computer that runs Windows, or can reproduce the BSOD in a virtual machine, see [Setting Up Kernel-Mode Debugging](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/setting-up-kernel-mode-debugging-in-windbg--cdb--or-ntsd). Otherwise, you could check the [memory dump options](https://docs.microsoft.com/en-us/troubleshoot/windows-server/performance/memory-dump-file-options) and see if the previous BSOD has left a dump that you can open in WinDbg. I don't know whether Secure Boot makes these things more difficult nowadays.
Author
Owner

@zadjii-msft commented on GitHub (Dec 9, 2021):

Huh, sorry we missed this one.

We've seen something like this before in #3268. To be totally honest though, I think the right place for this issue is over at https://github.com/microsoft/WSL. I don't have any idea why this would only repro with the Terminal and not just running wsl -d {distro} directly in conhost - maybe this is another facet of that "the console driver hasn't loaded yet" bug?

Really, I've got no idea, but the WSL folks would be better equipped to investigate. Sorry for the runaround!

@zadjii-msft commented on GitHub (Dec 9, 2021): Huh, sorry we missed this one. We've seen something like this before in #3268. To be totally honest though, I think the right place for this issue is over at https://github.com/microsoft/WSL. I don't have any idea why this would only repro with the Terminal and not just running `wsl -d {distro}` directly in conhost - maybe this is another facet of that "the console driver hasn't loaded yet" bug? Really, I've got no idea, but the WSL folks would be better equipped to investigate. Sorry for the runaround!
Author
Owner

@AleksandrHovhannisyan commented on GitHub (Dec 9, 2021):

No worries, thanks for the update

@AleksandrHovhannisyan commented on GitHub (Dec 9, 2021): No worries, thanks for the update
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13517