Crash in Windows Terminal TerminalControl!TextBuffer::Reflow #6860

Closed
opened 2026-01-31 00:49:08 +00:00 by claunia · 11 comments
Owner

Originally created by @Treit on GitHub (Mar 13, 2020).

Originally assigned to: @DHowett on GitHub.

While running a stress test on Windows Terminal version 0.10.721.0, I was able to cause a crash in TerminalControl!TextBuffer::Reflow.

I was running https://github.com/Treit/TerminalStress, the application I wrote some time back to reproduce a different bug (that was since fixed.)

I was running something like 5 instances in parallel in different panes on the same tab, then rapidly pressing Alt+Enter to switch from full screen to normal and back.

WindowsTerminal11.txt

I have attached some additional output from the debugger that might be helpful.

Originally created by @Treit on GitHub (Mar 13, 2020). Originally assigned to: @DHowett on GitHub. While running a stress test on Windows Terminal version 0.10.721.0, I was able to cause a crash in TerminalControl!TextBuffer::Reflow. I was running https://github.com/Treit/TerminalStress, the application I wrote some time back to reproduce a different bug (that was since fixed.) I was running something like 5 instances in parallel in different panes on the same tab, then rapidly pressing Alt+Enter to switch from full screen to normal and back. [WindowsTerminal11.txt](https://github.com/microsoft/terminal/files/4331632/WindowsTerminal11.txt) I have attached some additional output from the debugger that might be helpful.
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 18, 2020):

Finger-in-the-air guess is P3: if this only reproduces when you're murdering your terminal by resizing it multiple times a second while printing megabytes of output, I'm going to say it won't strike too many people too often.

It's still worth fixing.

@DHowett-MSFT commented on GitHub (Mar 18, 2020): Finger-in-the-air guess is P3: if this only reproduces when you're murdering your terminal by resizing it multiple times a second while printing megabytes of output, I'm going to say it won't strike too many people too often. It's still worth fixing.
Author
Owner

@DHowett-MSFT commented on GitHub (May 4, 2020):

I can't repro this on v0.11.1212, even resizing like mad with five open panes printing our 6MB test file simultaneously.

I'm gonna call this one no-repro. @Treit please let me know if you can still repro!

@DHowett-MSFT commented on GitHub (May 4, 2020): I can't repro this on v0.11.1212, even resizing like mad with five open panes printing our 6MB test file simultaneously. I'm gonna call this one no-repro. @Treit please let me know if you can still repro!
Author
Owner

@Treit commented on GitHub (May 4, 2020):

I can't repro this on v0.11.1212, even resizing like mad with five open panes printing our 6MB test file simultaneously.

I'm gonna call this one no-repro. @Treit please let me know if you can still repro!

@DHowett-MSFT Yes I can still reproduce it on 0.11.1212.0

@Treit commented on GitHub (May 4, 2020): > I can't repro this on v0.11.1212, even resizing like mad with five open panes printing our 6MB test file simultaneously. > > I'm gonna call this one no-repro. @Treit please let me know if you can still repro! @DHowett-MSFT Yes I can still reproduce it on 0.11.1212.0
Author
Owner

@Treit commented on GitHub (May 5, 2020):

@DHowett-MSFT here is a brief video I just made demonstrating how I reproduced the issue on 0.11.1212.0:
https://1drv.ms/v/s!Alav93a0o3vchOwF91dG-jJ5He1g0w?e=2Lm59k

@Treit commented on GitHub (May 5, 2020): @DHowett-MSFT here is a brief video I just made demonstrating how I reproduced the issue on 0.11.1212.0: https://1drv.ms/v/s!Alav93a0o3vchOwF91dG-jJ5He1g0w?e=2Lm59k
Author
Owner

@DHowett-MSFT commented on GitHub (May 5, 2020):

Perfect. Thank you.

@DHowett-MSFT commented on GitHub (May 5, 2020): Perfect. Thank you.
Author
Owner

@DHowett-MSFT commented on GitHub (May 5, 2020):

The problem is, as always, double-width characters. Somehow, the source buffer (during the reflow operation) is getting a hanging DBCS Trailing character that we dutifully try to reflect into the new buffer.

@DHowett-MSFT commented on GitHub (May 5, 2020): The problem is, as always, double-width characters. Somehow, the source buffer (during the reflow operation) is getting a hanging DBCS Trailing character that we dutifully try to reflect into the new buffer.
Author
Owner

@kasper93 commented on GitHub (May 16, 2020):

Would you share some of the glyphs that are in your powerlevel10k theme?

In fact it is powerleve9k, default setup nothing fancy.

I'll mark this as a /dup of #4907 in the meantime -- same call stack, same symptoms, same repro (go wild on resizing with garb in the buffer)

@DHowett-MSFT Since the other issue has been closed I replying here.

For me the problems started with 7ae34336da probably because ✔ has been made wide.

To summarize my problems:

  1. tmux drawing is broken. I needed to select pane to redraw vertical separator. Tick mark draw over separator. Also when resizing it glitches visually. https://streamable.com/xwrs5z
  2. WT crashes https://streamable.com/xwrs5z It is very easy to reproduce in tmux, I did reproduce it also without, but it is harder. (watch after 27s, before I tried not to crash it, also I cut video before window closed, but it crashed in the end, you can see it is not responding anymore)
  3. Changing this tick mark to wide (or smth else) made it mess up really bad when resizing. After 7ae34336da: https://streamable.com/2wanng and before 7ae34336da: https://streamable.com/rd2a8v

I initially though that crashes and other issues are related, but while they are introduced by the same commit for me, it looks like they are separate problems. We might reopen my issue for drawing problems and discuss crash in this one.

@kasper93 commented on GitHub (May 16, 2020): > Would you share some of the glyphs that are in your powerlevel10k theme? In fact it is powerleve9k, default setup nothing fancy. > I'll mark this as a /dup of #4907 in the meantime -- same call stack, same symptoms, same repro (go wild on resizing with garb in the buffer) @DHowett-MSFT Since the other issue has been closed I replying here. For me the problems started with https://github.com/microsoft/terminal/commit/7ae34336da0be8428738df5e13dfc4c5f1df6f75 probably because ✔ has been made wide. To summarize my problems: 1. tmux drawing is broken. I needed to select pane to redraw vertical separator. Tick mark draw over separator. Also when resizing it glitches visually. https://streamable.com/xwrs5z 2. WT crashes https://streamable.com/xwrs5z It is very easy to reproduce in tmux, I did reproduce it also without, but it is harder. (watch after 27s, before I tried not to crash it, also I cut video before window closed, but it crashed in the end, you can see it is not responding anymore) 3. Changing this tick mark to wide (or smth else) made it mess up really bad when resizing. After 7ae34336da0be8428738df5e13dfc4c5f1df6f75: https://streamable.com/2wanng and before 7ae34336da0be8428738df5e13dfc4c5f1df6f75: https://streamable.com/rd2a8v I initially though that crashes and other issues are related, but while they are introduced by the same commit for me, it looks like they are separate problems. We might reopen my issue for drawing problems and discuss crash in this one.
Author
Owner

@DHowett commented on GitHub (May 21, 2020):

So @kasper93, we fixed the width of ✔ at least! This bug'll remain to track the resizing issue 😄

@DHowett commented on GitHub (May 21, 2020): So @kasper93, we fixed the width of ✔ at least! This bug'll remain to track the resizing issue :smile:
Author
Owner

@DHowett commented on GitHub (Apr 7, 2021):

Fixing as part of MSFT-17364373, which is a conhost crash that hits moderately often (~500 hits in the past 14 days!)

@DHowett commented on GitHub (Apr 7, 2021): Fixing as part of MSFT-17364373, which is a conhost crash that hits moderately often (~500 hits in the past 14 days!)
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

🎉Windows Terminal v1.7.1033.0 has been released which incorporates this pull request.🎉

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:`Windows Terminal v1.7.1033.0` has been released which incorporates this pull request.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.7.1033.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

🎉Windows Terminal Preview v1.8.1032.0 has been released which incorporates this pull request.🎉

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:`Windows Terminal Preview v1.8.1032.0` has been released which incorporates this pull request.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1032.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6860