Crash if creating a new tab when the window height is too small #3949

Open
opened 2026-01-30 23:34:01 +00:00 by claunia · 0 comments
Owner

Originally created by @dsafa on GitHub (Sep 20, 2019).

Environment

Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): master

Any other software?

Steps to reproduce

  1. Minimize the height of Terminal. Doesn't even have to be fully minimized.
  2. Create a new tab

WindowsTerminal_cY56ao4860

Expected behavior

A new tab is created

Actual behavior

Terminal crashes

Details
Terminal crashes with the exception Unhandled exception at 0x00007FF8AB012830 (Windows.UI.Xaml.dll) in WindowsTerminal.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0000027E170823C0, 0x0000000000000002).

This should be the actual error.

E:\Code\terminal\src\renderer\dx\DxRenderer.cpp(247)\TerminalControl.dll!00007FF835C818E6: (caller: 00007FF835C7CBCB) ReturnHr(1) tid(2944) 887A0001 The application made a call that is invalid. Either the parameters of the call or the state of some object was incorrect.
Enable the D3D debug layer in order to see details via debug messages.
    [Microsoft::Console::Render::DxEngine::_CreateDeviceResources(_dxgiFactory2->CreateSwapChainForComposition(_d3dDevice.Get(), &SwapChainDesc, nullptr, &_dxgiSwapChain))]
// src\renderer\dx\DxRenderer.cpp(L233-249)
case SwapChainMode::ForComposition:
{
	SwapChainDesc.Width = _displaySizePixels.cx;
	SwapChainDesc.Height = _displaySizePixels.cy;
	
	// omitted

-->	RETURN_IF_FAILED(_dxgiFactory2->CreateSwapChainForComposition(_d3dDevice.Get(),
																  &SwapChainDesc,
																  nullptr,
																  &_dxgiSwapChain));
	break;
}

Height is 0 which I assume is an invalid parameter.

Originally created by @dsafa on GitHub (Sep 20, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18362.0 Windows Terminal version (if applicable): master Any other software? ``` # Steps to reproduce 1. Minimize the height of Terminal. Doesn't even have to be fully minimized. 2. Create a new tab ![WindowsTerminal_cY56ao4860](https://user-images.githubusercontent.com/7334282/65287337-baf66d00-daf7-11e9-92fe-732823faf487.png) # Expected behavior A new tab is created # Actual behavior Terminal crashes <!-- What's actually happening? --> **Details** Terminal crashes with the exception `Unhandled exception at 0x00007FF8AB012830 (Windows.UI.Xaml.dll) in WindowsTerminal.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0000027E170823C0, 0x0000000000000002).` This should be the actual error. ``` E:\Code\terminal\src\renderer\dx\DxRenderer.cpp(247)\TerminalControl.dll!00007FF835C818E6: (caller: 00007FF835C7CBCB) ReturnHr(1) tid(2944) 887A0001 The application made a call that is invalid. Either the parameters of the call or the state of some object was incorrect. Enable the D3D debug layer in order to see details via debug messages. [Microsoft::Console::Render::DxEngine::_CreateDeviceResources(_dxgiFactory2->CreateSwapChainForComposition(_d3dDevice.Get(), &SwapChainDesc, nullptr, &_dxgiSwapChain))] ``` ```cpp // src\renderer\dx\DxRenderer.cpp(L233-249) case SwapChainMode::ForComposition: { SwapChainDesc.Width = _displaySizePixels.cx; SwapChainDesc.Height = _displaySizePixels.cy; // omitted --> RETURN_IF_FAILED(_dxgiFactory2->CreateSwapChainForComposition(_d3dDevice.Get(), &SwapChainDesc, nullptr, &_dxgiSwapChain)); break; } ``` `Height` is 0 which I assume is an invalid parameter.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3949