conhost crashes silently after SetConsoleScreenBufferSize #3322

Closed
opened 2026-01-30 23:18:35 +00:00 by claunia · 1 comment
Owner

Originally created by @alabuzhev on GitHub (Aug 8, 2019).

Environment

Windows build number: [run "ver" at a command prompt]
- 10.0.18362.116
- 10.0.18362.267

Windows Terminal version (if applicable):
- No

Any other software?
- No

Steps to reproduce

  • Unpack the attached project: BufferSizeBug.zip
  • Open in Visual Studio
  • Compile & Run
  • After a MessageBox appears: open window properties, go to Layout tab, uncheck "Wrap text output on resize", close the properties window.
  • Press OK in the MessageBox

Expected behavior

Conhost doesn't crash.

Actual behavior

Conhost crashes silently.

If you attach the VS debugger to conhost.exe before triggering a crash, it will show something like:

onecore\windows\core\console\open\src\buffer\out\textbuffercelliterator.cpp(49)\conhost.exe!00007FF6AD97FB34: (caller: 00007FF6AD95CACE) Exception(1) tid(22a0) 80070057 The parameter is incorrect.

Exception thrown at 0x00007FFFE34EA839 in conhost.exe: Microsoft C++ exception: wil::ResultException at memory location 0x000000EE660FDFB0.

Stack trace:

 	KernelBase.dll!RaiseException()	Unknown
 	ucrtbase.dll!_CxxThrowException()	Unknown
 	conhost.exe!wil::details::ThrowResultExceptionInternal(struct wil::FailureInfo const &)	Unknown
 	conhost.exe!wil::details::ReportFailure()	Unknown
 	conhost.exe!wil::details::ReportFailure_Hr(void *,unsigned int,char const *,char const *,char const *,void *,enum wil::FailureType,long)	Unknown
 	conhost.exe!wil::details::in1diag3::Throw_Hr(void *,unsigned int,char const *,long)	Unknown
 	conhost.exe!TextBufferCellIterator::TextBufferCellIterator()	Unknown
 	conhost.exe!RenderData::IsCursorDoubleWidth()	Unknown
 	conhost.exe!Microsoft::Console::Render::Renderer::_PaintFrameForEngine()	Unknown
 	conhost.exe!Microsoft::Console::Render::Renderer::PaintFrame()	Unknown
 	conhost.exe!Microsoft::Console::Render::RenderThread::_ThreadProc()	Unknown
 	kernel32.dll!BaseThreadInitThunk()	Unknown
 	ntdll.dll!RtlUserThreadStart()	Unknown

Presumably here: textBufferCellIterator.cpp

Originally created by @alabuzhev on GitHub (Aug 8, 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: [run "ver" at a command prompt] - 10.0.18362.116 - 10.0.18362.267 Windows Terminal version (if applicable): - No Any other software? - No ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> - Unpack the attached project: [BufferSizeBug.zip](https://github.com/microsoft/terminal/files/3483795/BufferSizeBug.zip) - Open in Visual Studio - Compile & Run - After a MessageBox appears: open window properties, go to Layout tab, **uncheck "Wrap text output on resize"**, close the properties window. - Press OK in the MessageBox # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> Conhost doesn't crash. # Actual behavior <!-- What's actually happening? --> Conhost crashes silently. If you attach the VS debugger to conhost.exe before triggering a crash, it will show something like: ``` onecore\windows\core\console\open\src\buffer\out\textbuffercelliterator.cpp(49)\conhost.exe!00007FF6AD97FB34: (caller: 00007FF6AD95CACE) Exception(1) tid(22a0) 80070057 The parameter is incorrect. Exception thrown at 0x00007FFFE34EA839 in conhost.exe: Microsoft C++ exception: wil::ResultException at memory location 0x000000EE660FDFB0. ``` Stack trace: ``` KernelBase.dll!RaiseException() Unknown ucrtbase.dll!_CxxThrowException() Unknown conhost.exe!wil::details::ThrowResultExceptionInternal(struct wil::FailureInfo const &) Unknown conhost.exe!wil::details::ReportFailure() Unknown conhost.exe!wil::details::ReportFailure_Hr(void *,unsigned int,char const *,char const *,char const *,void *,enum wil::FailureType,long) Unknown conhost.exe!wil::details::in1diag3::Throw_Hr(void *,unsigned int,char const *,long) Unknown conhost.exe!TextBufferCellIterator::TextBufferCellIterator() Unknown conhost.exe!RenderData::IsCursorDoubleWidth() Unknown conhost.exe!Microsoft::Console::Render::Renderer::_PaintFrameForEngine() Unknown conhost.exe!Microsoft::Console::Render::Renderer::PaintFrame() Unknown conhost.exe!Microsoft::Console::Render::RenderThread::_ThreadProc() Unknown kernel32.dll!BaseThreadInitThunk() Unknown ntdll.dll!RtlUserThreadStart() Unknown ``` Presumably here: [textBufferCellIterator.cpp](https://github.com/microsoft/terminal/blob/6c747c565b52b377410b317469efe3ef5e0beb50/src/buffer/out/textBufferCellIterator.cpp#L43)
claunia added the Resolution-Duplicate label 2026-01-30 23:18:35 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 9, 2019):

This seems the same as #1976

@DHowett-MSFT commented on GitHub (Aug 9, 2019): This seems the same as #1976
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3322