Crash on copy after selection goes offscreen because of resizing #1545

Closed
opened 2026-01-30 22:30:00 +00:00 by claunia · 3 comments
Owner

Originally created by @Summon528 on GitHub (Jun 7, 2019).

Originally assigned to: @carlos-zamora on GitHub.

Environment

Windows build number: [run "ver" at a command prompt]
Windows Terminal version (if applicable):

Any other software?

Steps to reproduce

  1. Start terminal
  2. Maximize terminal
  3. Select something that will eventually go offscreen (i.e. top right corner)
  4. Unmaximize terminal
  5. Try pressing copy or right click
Originally created by @Summon528 on GitHub (Jun 7, 2019). Originally assigned to: @carlos-zamora on GitHub. <!-- 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. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: [run "ver" at a command prompt] Windows Terminal version (if applicable): Any other software? ``` # Steps to reproduce 1. Start terminal 2. Maximize terminal 3. Select something that will eventually go offscreen (i.e. top right corner) 4. Unmaximize terminal 5. Try pressing copy or right click <!-- A description of how to trigger this bug. -->
Author
Owner

@Summon528 commented on GitHub (Jun 7, 2019):

I notice that the old conhost just clear selection after any resize event. Should terminal have the same behavior? or should we do something different
Also, might be related to #950, but not necessarily the same, since this one does not involve the scroll bar.

@Summon528 commented on GitHub (Jun 7, 2019): I notice that the old conhost just clear selection after any resize event. Should terminal have the same behavior? or should we do something different Also, might be related to #950, but not necessarily the same, since this one does not involve the scroll bar.
Author
Owner

@beviu commented on GitHub (Mar 1, 2020):

@carlos-zamora

I think that this crash is back. I can reproduce this on master (4393fefb) but not on the Microsoft Store version (0.9.433.0).

 	KernelBase.dll!00007ff81081f12f()	Unknown
>	TerminalControl.dll!wil::details::WilDynamicLoadRaiseFailFastException(_EXCEPTION_RECORD * er, _CONTEXT * cr, unsigned long flags) Line 1731	C++
 	TerminalControl.dll!wil::details::WilRaiseFailFastException(_EXCEPTION_RECORD * er, _CONTEXT * flags, unsigned long) Line 1672	C++
 	TerminalControl.dll!wil::details::WilFailFast(const wil::FailureInfo & failure) Line 3350	C++
 	TerminalControl.dll!wil::details::ReportFailure(void * callerReturnAddress, unsigned int lineNumber, const char * fileName, const char * functionName, const char * code, void * returnAddress, wil::FailureType type, HRESULT hr, const wchar_t * message, wil::details::ReportFailureOptions options) Line 3373	C++
 	TerminalControl.dll!wil::details::ReportFailure_Hr(void * callerReturnAddress, unsigned int lineNumber, const char * fileName, const char * functionName, const char * code, void * returnAddress, wil::FailureType type, HRESULT hr) Line 3451	C++
 	TerminalControl.dll!wil::details::in1diag3::_FailFast_Unexpected(void * callerReturnAddress, unsigned int lineNumber, const char * fileName) Line 4747	C++
 	[Inline Frame] TerminalControl.dll!wil::details::in1diag3::FailFast_If(void * callerReturnAddress, unsigned int) Line 4755	C++
 	[Inline Frame] TerminalControl.dll!Microsoft::Console::Types::Viewport::CompareInBounds(const _COORD &) Line 347	C++
 	TerminalControl.dll!TextBuffer::GetTextRects(_COORD start, _COORD end, bool blockSelection) Line 1338	C++
 	TerminalControl.dll!Microsoft::Terminal::Core::Terminal::_GetSelectionRects() Line 57	C++
 	TerminalControl.dll!Microsoft::Terminal::Core::Terminal::GetSelectionRects() Line 128	C++
 	TerminalControl.dll!Microsoft::Console::Render::Renderer::_GetSelectionRects() Line 953	C++
 	TerminalControl.dll!Microsoft::Console::Render::Renderer::_PaintSelection(Microsoft::Console::Render::IRenderEngine * const pEngine) Line 898	C++
 	TerminalControl.dll!Microsoft::Console::Render::Renderer::_PaintFrameForEngine(Microsoft::Console::Render::IRenderEngine * const pEngine) Line 138	C++
 	TerminalControl.dll!Microsoft::Console::Render::Renderer::PaintFrame() Line 77	C++
 	[Inline Frame] TerminalControl.dll!Microsoft::Console::Render::RenderThread::_ThreadProc() Line 203	C++
 	TerminalControl.dll!Microsoft::Console::Render::RenderThread::s_ThreadProc(void * lpParameter) Line 150	C++
 	[External Code]	

proof

@beviu commented on GitHub (Mar 1, 2020): @carlos-zamora I think that this crash is back. I can reproduce this on master (4393fefb) but not on the Microsoft Store version (0.9.433.0). ``` KernelBase.dll!00007ff81081f12f() Unknown > TerminalControl.dll!wil::details::WilDynamicLoadRaiseFailFastException(_EXCEPTION_RECORD * er, _CONTEXT * cr, unsigned long flags) Line 1731 C++ TerminalControl.dll!wil::details::WilRaiseFailFastException(_EXCEPTION_RECORD * er, _CONTEXT * flags, unsigned long) Line 1672 C++ TerminalControl.dll!wil::details::WilFailFast(const wil::FailureInfo & failure) Line 3350 C++ TerminalControl.dll!wil::details::ReportFailure(void * callerReturnAddress, unsigned int lineNumber, const char * fileName, const char * functionName, const char * code, void * returnAddress, wil::FailureType type, HRESULT hr, const wchar_t * message, wil::details::ReportFailureOptions options) Line 3373 C++ TerminalControl.dll!wil::details::ReportFailure_Hr(void * callerReturnAddress, unsigned int lineNumber, const char * fileName, const char * functionName, const char * code, void * returnAddress, wil::FailureType type, HRESULT hr) Line 3451 C++ TerminalControl.dll!wil::details::in1diag3::_FailFast_Unexpected(void * callerReturnAddress, unsigned int lineNumber, const char * fileName) Line 4747 C++ [Inline Frame] TerminalControl.dll!wil::details::in1diag3::FailFast_If(void * callerReturnAddress, unsigned int) Line 4755 C++ [Inline Frame] TerminalControl.dll!Microsoft::Console::Types::Viewport::CompareInBounds(const _COORD &) Line 347 C++ TerminalControl.dll!TextBuffer::GetTextRects(_COORD start, _COORD end, bool blockSelection) Line 1338 C++ TerminalControl.dll!Microsoft::Terminal::Core::Terminal::_GetSelectionRects() Line 57 C++ TerminalControl.dll!Microsoft::Terminal::Core::Terminal::GetSelectionRects() Line 128 C++ TerminalControl.dll!Microsoft::Console::Render::Renderer::_GetSelectionRects() Line 953 C++ TerminalControl.dll!Microsoft::Console::Render::Renderer::_PaintSelection(Microsoft::Console::Render::IRenderEngine * const pEngine) Line 898 C++ TerminalControl.dll!Microsoft::Console::Render::Renderer::_PaintFrameForEngine(Microsoft::Console::Render::IRenderEngine * const pEngine) Line 138 C++ TerminalControl.dll!Microsoft::Console::Render::Renderer::PaintFrame() Line 77 C++ [Inline Frame] TerminalControl.dll!Microsoft::Console::Render::RenderThread::_ThreadProc() Line 203 C++ TerminalControl.dll!Microsoft::Console::Render::RenderThread::s_ThreadProc(void * lpParameter) Line 150 C++ [External Code] ``` ![proof](https://user-images.githubusercontent.com/56923875/75632685-e8932680-5bfe-11ea-9f63-a089445a77a7.gif)
Author
Owner

@carlos-zamora commented on GitHub (Mar 1, 2020):

Oh no! Thanks for getting the stack. I’ll fix it first thing on Monday.

@carlos-zamora commented on GitHub (Mar 1, 2020): Oh no! Thanks for getting the stack. I’ll fix it first thing on Monday.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1545