ControlCore::_refreshSizeUnderLock crash #16418

Closed
opened 2026-01-31 05:08:04 +00:00 by claunia · 7 comments
Owner

Originally created by @kierenj on GitHub (Jan 16, 2022).

Originally assigned to: @zadjii-msft on GitHub.

Windows Terminal version

1.11.3471.0

Windows build number

10.0.22523.0

Other Software

wsl --list -v

  NAME                   STATE           VERSION
* docker-desktop-data    Running         2
  Ubuntu                 Running         2
  docker-desktop         Running         2

Typically I'm using multiple panes, one or more tabs, with both Windows 11 Powershell and Ubuntu. For ubuntu:

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

Steps to reproduce

Day-to-day use of the terminal. Sometimes WSL and Windows Powershell tabs/panes, sometimes just one or the other. Somtimes using software like k9s, other times just sitting at a prompt.

Expected Behavior

Everything to remain responsive.

Actual Behavior

After some nondescript amount of time, the window hangs, Terminal is unresponsive and must be quit. Windows crash reporting pops up.

If I leave it long enough (say a few hours), it's more likely to have occurred. Sometimes it's during active use though. If I'm using k9s (kubernetes tool) on a Windows powershell and press e to open Notepad to edit some yaml, recently that pane has then stopped responding to input (but output still updates). Unsure if related.

Feedback Hub link: https://aka.ms/AAfh1tt

Originally created by @kierenj on GitHub (Jan 16, 2022). Originally assigned to: @zadjii-msft on GitHub. ### Windows Terminal version 1.11.3471.0 ### Windows build number 10.0.22523.0 ### Other Software ```` wsl --list -v NAME STATE VERSION * docker-desktop-data Running 2 Ubuntu Running 2 docker-desktop Running 2 ```` Typically I'm using multiple panes, one or more tabs, with both Windows 11 Powershell and Ubuntu. For ubuntu: ```` cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS" ```` ### Steps to reproduce Day-to-day use of the terminal. Sometimes WSL *and* Windows Powershell tabs/panes, sometimes just one or the other. Somtimes using software like k9s, other times just sitting at a prompt. ### Expected Behavior Everything to remain responsive. ### Actual Behavior After some nondescript amount of time, the window hangs, Terminal is unresponsive and must be quit. Windows crash reporting pops up. If I leave it long enough (say a few hours), it's more likely to have occurred. Sometimes it's during active use though. If I'm using `k9s` (kubernetes tool) on a Windows powershell and press `e` to open Notepad to edit some yaml, recently that pane has then stopped responding to input (but output still updates). Unsure if related. Feedback Hub link: https://aka.ms/AAfh1tt
Author
Owner

@zadjii-msft commented on GitHub (Jul 29, 2022):

Sorry we apparently never triaged this one! If there were dumps in the FH link, then they've unfortunately timed out by now.

After some nondescript amount of time, the window hangs

Hmm. Some psychic debugging makes me think this might be #12607. We don't have a solid repro for that. That would only be if you had an nvidia graphics card.

I think I might have been able to track down a crash that came from your device. One that repros on Terminal 1.13, but I'm not sure we have hits on 1.14... Bucket 9309a65f-d928-c838-cea1-5b6a7536dc5b, failure b25565e7-86c6-5d2e-1f06-ae88a038c74a, MSFT:39723014, NULL_POINTER_READ_c0000005_Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::ControlCore::_refreshSizeUnderLock

Hmm. Stack looks like we're above the AppHost dtor, and fired off a _SwapChainScaleChanged, and that caused a resize, but hey guess what, the TermControl is null already. er, no it's not, debugger is just trying.

_SwapChainScaleChanged is bound in XAML:

                <SwapChainPanel x:Name="SwapChainPanel"
                                CompositionScaleChanged="_SwapChainScaleChanged"
                                SizeChanged="_SwapChainSizeChanged">

Frankly, the app is already closing here, so this might be a different crash than what you're seeing.

I suppose ControlCore::_refreshSizeUnderLock might want to check _IsClosing - not sure it actually ever does. Ot if any of the callers ever do. Huh.

Yea one of the dumps definitely had a _closing=true in it.

@zadjii-msft commented on GitHub (Jul 29, 2022): Sorry we apparently never triaged this one! If there were dumps in the FH link, then they've unfortunately timed out by now. > After some nondescript amount of time, the window hangs Hmm. Some psychic debugging makes me think this might be #12607. We don't have a solid repro for that. That would only be if you had an nvidia graphics card. I think I might have been able to track down a crash that came from your device. One that repros on Terminal 1.13, but I'm not sure we have hits on 1.14... Bucket `9309a65f-d928-c838-cea1-5b6a7536dc5b`, failure `b25565e7-86c6-5d2e-1f06-ae88a038c74a`, MSFT:39723014, `NULL_POINTER_READ_c0000005_Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::ControlCore::_refreshSizeUnderLock` Hmm. Stack looks like we're above the `AppHost` dtor, and fired off a `_SwapChainScaleChanged`, and that caused a resize, but ~hey guess what, the `TermControl` is null already~. er, no it's not, debugger is just trying. `_SwapChainScaleChanged` is bound in XAML: ```xaml <SwapChainPanel x:Name="SwapChainPanel" CompositionScaleChanged="_SwapChainScaleChanged" SizeChanged="_SwapChainSizeChanged"> ``` Frankly, the app is already closing here, so this might be a different crash than what you're seeing. I suppose `ControlCore::_refreshSizeUnderLock` might want to check `_IsClosing` - not sure it actually ever does. Ot if any of the callers ever do. Huh. Yea one of the dumps definitely had a `_closing=true` in it.
Author
Owner

@kierenj commented on GitHub (Jul 29, 2022):

Hi Mike - thanks very much.

I’m not sure if it’s the cause of this - but other apps hung in a similar way (especially Firefox) and the cause of that was audio redirection on RDC.

I was also using the k9s tool frequently with the console, and upgrading that.. I haven’t had a hang since.

So maybe not terminal related after all!

@kierenj commented on GitHub (Jul 29, 2022): Hi Mike - thanks very much. I’m not sure if it’s the cause of this - but other apps hung in a similar way (especially Firefox) and the cause of that was audio redirection on RDC. I was also using the k9s tool frequently with the console, and upgrading *that*.. I haven’t had a hang since. So maybe not terminal related after all!
Author
Owner

@zadjii-msft commented on GitHub (Jul 29, 2022):

That's great to hear!

I might pivot this thread then, to the other crash I discovered. That's just about 1% of our crashes, so not super high, but we've got a beat on it so may as well keep tracking. Thanks!

@zadjii-msft commented on GitHub (Jul 29, 2022): That's great to hear! I might pivot this thread then, to the other crash I discovered. That's just about 1% of our crashes, so not super high, but we've got a beat on it so may as well keep tracking. Thanks!
Author
Owner

@zadjii-msft commented on GitHub (Aug 5, 2022):

bumping to 1.16 cause there's a bit of a spike in hits, and the fix seems kinda easy.

@zadjii-msft commented on GitHub (Aug 5, 2022): bumping to 1.16 cause there's a bit of a spike in hits, and the fix seems kinda easy.
Author
Owner

@zadjii-msft commented on GitHub (Aug 23, 2022):

This is actually our top crash these days. Maybe not in the wild so much, but definitely on the test machines. Let's knock this out, and see if it goes away in 1.16.

@zadjii-msft commented on GitHub (Aug 23, 2022): This is actually our top crash these days. Maybe not in the wild so much, but definitely on the test machines. Let's knock this out, and see if it goes away in 1.16.
Author
Owner

@ghost commented on GitHub (Sep 13, 2022):

:tada:This issue was addressed in #13857, which has now been successfully released as Windows Terminal v1.15.252.🎉

Handy links:

@ghost commented on GitHub (Sep 13, 2022): :tada:This issue was addressed in #13857, which has now been successfully released as `Windows Terminal v1.15.252`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.15.252) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Sep 13, 2022):

:tada:This issue was addressed in #13857, which has now been successfully released as Windows Terminal Preview v1.16.252.🎉

Handy links:

@ghost commented on GitHub (Sep 13, 2022): :tada:This issue was addressed in #13857, which has now been successfully released as `Windows Terminal Preview v1.16.252`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.16.252) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16418