-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Tabs leak GDI handles on tab title resizes #5949
Comments
This is leaking before any of the user mode GDI code is being hit. I see a single DC getting left behind every time. But breakpointing on literally all the GDI Create and Delete functions... the handle is leaked before we even hit our user mode code. |
I think this will have to be found with a KD. Also, I think it's not really our fault as ONE handle is leaked when the tab is stood up by MUX. It's just not leaked again otherwise because it doesn't resize. |
@miniksa I wonder if that leak exists in 2.4 preview of WinUI. Because this sounds alot like it's coming from there. |
Looks like this is a bug in WIL, actually. I failed to update WIL months ago because of static analysis failures, but in so doing I missed microsoft/wil#100. |
Oof good catch, Dustin. |
## Summary of the Pull Request When resizing the window title, a GDI object would be leaked. This has to do with our island message handler using `wil` to track these objects and `wil` having a bug. ## References microsoft/wil#100 ## PR Checklist * [x] Closes #5949 * [x] I work here. * [x] Tested manually * [x] Doc not required. * [x] Am core contributor. ## Validation Steps Performed * [x] Added the GDI Objects column to Task Manager, set the Terminal to use the `titleWidth` size tabs, then changed the title a bunch with PowerShell. Confirmed repro before (increasing GDI count). Confirmed it's gone after (no change to object count).
🎉This issue was addressed in #6229, which has now been successfully released as Handy links: |
## Summary of the Pull Request When resizing the window title, a GDI object would be leaked. This has to do with our island message handler using `wil` to track these objects and `wil` having a bug. ## References microsoft/wil#100 ## PR Checklist * [x] Closes #5949 * [x] I work here. * [x] Tested manually * [x] Doc not required. * [x] Am core contributor. ## Validation Steps Performed * [x] Added the GDI Objects column to Task Manager, set the Terminal to use the `titleWidth` size tabs, then changed the title a bunch with PowerShell. Confirmed repro before (increasing GDI count). Confirmed it's gone after (no change to object count). (cherry picked from commit 48b3262)
🎉This issue was addressed in #6229, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
"tabWidthMode": "titleLength"
or any other configuration that allows for variably-sized tab titles (to trigger this bug)Expected behavior
Windows Terminal should keep running, keep updating the tab title, without leaking GDI handles.
Actual behavior
Windows Terminal keeps allocating new GDI handles (as seen in Task Manager/ProcessHacker) and will eventually crash and just vanish.
The leaked GDI handles will be retained even when the corresponding tab is closed
Please note
It is not enough to just update the title when tabs are in
equal
mode/are not resized.The text was updated successfully, but these errors were encountered: