Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heap Corruption (0xc0000374) crash when closing terminal window #18330

Closed
bondobrus opened this issue Dec 14, 2024 · 10 comments
Closed

Heap Corruption (0xc0000374) crash when closing terminal window #18330

bondobrus opened this issue Dec 14, 2024 · 10 comments
Assignees
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@bondobrus
Copy link

Windows Terminal version

1.21.3231.0

Windows build number

10.0.26100.0

Other Software

No response

Steps to reproduce

  1. Using Windows Terminal
  2. Close terminal window
  3. Terminal crashes during shutdown with heap corruption error

Expected Behavior

Windows Terminal should close cleanly without any crashes.

Actual Behavior

Terminal crashes during shutdown with heap corruption error (0xc0000374).

Crash analysis from dump file shows:

Error Code: 0xc0000374 (Heap Corruption)
FAILURE_BUCKET_ID: HEAP_CORRUPTION_c0000374_ucrtbase.dll!_free_base
Crash occurs during UI cleanup (TabView, ScrollView components)
Stack trace indicates the issue happens during memory deallocation in ucrtbase.dll

Full stack trace and crash dump analysis:

STACK_COMMAND:  ~93s; .ecxr ; kb
FAILURE_BUCKET_ID:  HEAP_CORRUPTION_c0000374_ucrtbase.dll!_free_base
OS_VERSION:  10.0.22621.1
IMAGE_VERSION:  10.0.22621.3593

The crash consistently happens during the cleanup phase when closing the terminal window, specifically when deallocating UI components' memory.

@bondobrus bondobrus added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 14, 2024
@lhecker
Copy link
Member

lhecker commented Dec 17, 2024

Do you happen to have a dump file as well? If not, this wiki page explains how to get them: https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips

@bondobrus
Copy link
Author

Yes, I've sent the dump file via email to @zadjii-msft
Thank you.

@carlos-zamora
Copy link
Member

Thanks @bondobrus! We've got the dump file. Now just a matter of taking a look at it. Most of the team is already on vacation for the holidays though, so chances are we won't be able to take a look at it until the new year.

We recommend you try out WT Preview or even WT Canary in the meantime.

@bondobrus
Copy link
Author

Thanks @bondobrus! We've got the dump file. Now just a matter of taking a look at it. Most of the team is already on vacation for the holidays though, so chances are we won't be able to take a look at it until the new year.

We recommend you try out WT Preview or even WT Canary in the meantime.

Unfortunately, on Windows Terminal Preview same issue occurs.

@carlos-zamora carlos-zamora added the Needs-Attention The core contributors need to come back around and look at this ASAP. label Jan 8, 2025
@lhecker
Copy link
Member

lhecker commented Jan 15, 2025

I looked at it, but unfortunately, I was unable to figure out where the heap corruption originated from. Maybe I missed something...

Could you try using our Canary version for a while and see if it reproduces? You can find it here: https://aka.ms/terminal-canary-installer
Upon first launch it'll copy the settings from the stable version of Windows Terminal. It'll also cleanly uninstall again. It contains a rewrite of our windowing code which should theoretically make it more robust on shutdown.

@bondobrus
Copy link
Author

I will try with that thanks, if same scenario will occurs I will reply.

@bondobrus
Copy link
Author

For now I haven't noticed crashing during shutdown but surely that's not enough amount of time. What I've noticed is sometimes cursor disappears while it is on terminal canary window.

@lhecker
Copy link
Member

lhecker commented Jan 17, 2025

The cursor disappearing is a known issue which I'll be fixing soon.

@bondobrus
Copy link
Author

Some time passed I can confirm in canary edition terminal don't crash for me on shutdown

@DHowett
Copy link
Member

DHowett commented Jan 23, 2025

Thanks!

@DHowett DHowett closed this as completed Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

4 participants