You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The system detected an overrun of a stack-based buffer in this application #7763
Needs-Author-FeedbackThe original author of the issue/PR needs to come back and respond to somethingNeeds-Tag-FixDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meetingNo-Recent-ActivityThis issue/PR is going stale and may be auto-closed without further activity.
Windows build number: 19041.388
Windows Terminal version (if applicable): 1.3.2651.0
Steps to reproduce
on Windows PowerShell execute cat <a big file: lager than 2MB>, using vim to edit the big file, list files in the directory, use any terminal program to deal with big files will cause error The system detected an overrun of a stack-based buffer in this application
on WSL execute htop,top,cat <a big file>, using any programs to process file larger than 2MB, use resources intensive programs such as MySQL server will cause error The system detected an overrun of a stack-based buffer in this application
on cmd, PowerShell core, git bash, etc. is the same
the error only occurs when running shell on Windows Terminal , not the programs them self.
screenshots
PS
The shell and programs are still running after Windows Terminal crashed.
Activity
ghost added
Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
I hit something similar on 2020-09-25. Windows Terminal Preview 1.4.2652.0 on Windows 10 build 19041.508 crashed several times with exception code 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN) when I was trying to use "git log". There were no message boxes but the reliability history and the Application event log show this code. I have not been able to reproduce the error later.
The error could temporarily disappear after reboot the computer or logout and login, however, after a period of time, I can still reproduce the error. From Windows Terminal beta to 1.3.2651.0, this is the first time I get those errors. Windows Terminal Preview 1.4.2652.0 crashes on my computer too.
@rekaerst's dump file has Windows_UI_Xaml!CXamlIslandRoot::OnIslandPointerWheelChanged + 0x12 in the call stack of the thread that called KERNELBASE!RaiseFailFastException. I am pretty sure I was not using the mouse wheel when Windows Terminal Preview crashed. But if the bug is in rendering, then it could crash in both situations anyway.
Apparently, WilFailFast uses STATUS_STACK_BUFFER_OVERRUN even if the error is not a buffer overrun. The instructions immediately before the return address TerminalControl!DllGetActivationFactory+0x27a3c set R8 = "E:\BA\127\s\src\buffer\out\textBuffer.cpp" and EDX = 280, so I think it blew up in TextBuffer::_PrepareForDoubleByteSequence here:
So, this is interesting! This dump is the same as in #4907. We've tried to tackle this issue before, but not quite gotten there. It seems that there's some buffer corruption where a DBCS character gets split and the trailing half gets duplicated (by a function that isn't checking its legality), which then explodes when it hits this function (Reflow) that does check.
We usually only see it during resize, which includes mouse wheel scrolling.
Needs-Author-FeedbackThe original author of the issue/PR needs to come back and respond to somethingNeeds-Tag-FixDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meetingNo-Recent-ActivityThis issue/PR is going stale and may be auto-closed without further activity.
Activity
KalleOlaviNiemitalo commentedon Sep 28, 2020
I hit something similar on 2020-09-25. Windows Terminal Preview 1.4.2652.0 on Windows 10 build 19041.508 crashed several times with exception code 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN) when I was trying to use "git log". There were no message boxes but the reliability history and the Application event log show this code. I have not been able to reproduce the error later.
unavaliabl3 commentedon Sep 29, 2020
The error could temporarily disappear after reboot the computer or logout and login, however, after a period of time, I can still reproduce the error. From Windows Terminal beta to 1.3.2651.0, this is the first time I get those errors. Windows Terminal Preview 1.4.2652.0 crashes on my computer too.
DHowett commentedon Sep 29, 2020
I can't reproduce this. Can one of you use task manager to capture a dump file of Terminal when that dialog pops up?
unavaliabl3 commentedon Sep 30, 2020
WindowsTerminal.dmp.zip
KalleOlaviNiemitalo commentedon Sep 30, 2020
@rekaerst's dump file has
Windows_UI_Xaml!CXamlIslandRoot::OnIslandPointerWheelChanged + 0x12in the call stack of the thread that calledKERNELBASE!RaiseFailFastException. I am pretty sure I was not using the mouse wheel when Windows Terminal Preview crashed. But if the bug is in rendering, then it could crash in both situations anyway.unavaliabl3 commentedon Sep 30, 2020
I was not using a mouse when it crashed too. I was just running cat some_text_file command.
KalleOlaviNiemitalo commentedon Sep 30, 2020
Apparently,
WilFailFastusesSTATUS_STACK_BUFFER_OVERRUNeven if the error is not a buffer overrun. The instructions immediately before the return addressTerminalControl!DllGetActivationFactory+0x27a3cset R8 = "E:\BA\127\s\src\buffer\out\textBuffer.cpp" and EDX = 280, so I think it blew up inTextBuffer::_PrepareForDoubleByteSequencehere:terminal/src/buffer/out/textBuffer.cpp
Lines 278 to 280 in d4614bf
DHowett commentedon Sep 30, 2020
So, this is interesting! This dump is the same as in #4907. We've tried to tackle this issue before, but not quite gotten there. It seems that there's some buffer corruption where a DBCS character gets split and the trailing half gets duplicated (by a function that isn't checking its legality), which then explodes when it hits this function (Reflow) that does check.
We usually only see it during resize, which includes mouse wheel scrolling.
Kalle Olavi Niemitalo (@KalleOlaviNiemitalo) I'll keep this open to see if you can produce a dump that's different?
Symbols for 1.4.2652
KalleOlaviNiemitalo commentedon Sep 30, 2020
OK, I added a Registry key as instructed in Collecting User-Mode Dumps, so that I'll get a dump if
WindowsTerminal.execrashes again.DHowett commentedon Oct 1, 2020
Thanks!