Description
Windows Terminal version
Commit c52ba7d
Windows build number
10.0.19045.4412
Other Software
No response
Steps to reproduce
I've had this crash quite frequently in the preview build (I think possibly since v1.21), but I couldn't easily reproduce it. However, I've just discovered I can reproduce it consistently when running Windows Terminal from within the debugger with the following steps:
- Start Windows Terminal.
- Open a second tab with the debug tap.
- Type
exit
to close the second tab.
In both tabs I'm using a WSL bash shell, but I don't think that's relevant. The key thing is typing exit
to close the tab rather than clicking on the close button.
Expected Behavior
The tab should close without crashing the terminal.
Actual Behavior
The terminal crashes with an exception in the Pane::_CloseChild
method:
Unhandled exception thrown: read access violation.
this->_content.**m_ptr** was nullptr.
On this line:
terminal/src/cascadia/TerminalApp/Pane.cpp
Line 1433 in a7e2b46
And with the following stack trace:
> TerminalApp.dll!Pane::_CloseChild(const bool closeFirst) Line 1433 C++
TerminalApp.dll!winrt::impl::delegate<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>,`Pane::_CloseChildRoutine'::`2'::<lambda_1>>::Invoke(void * sender, void * args) Line 883 C++
[External Code]
WindowsTerminal.exe!WindowEmperor::_createNewWindowThread::__l2::<lambda_1>::operator()() Line 222 C++
[External Code]
When I've had this crash in the preview build (assuming it was the same thing), it was usually when I was attempting to compile Windows Terminal and my system was low on memory. At the time I thought the lack of memory might have been a factor, but I suspect now that it might be a timing issue, and the low memory was just slowing the system enough for it to trigger the problem. Either way I'm hoping the trace above is enough for someone to figure out the cause.
I had also initially thought this might be the same bug as #17305, but my dev build has both PR #17333 and PR #17358 applied, so it can't be that.