Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Terminal hangs up and disappears on window resizing. #9547

Closed
Hamayama opened this issue Mar 19, 2021 · 13 comments
Closed

Windows Terminal hangs up and disappears on window resizing. #9547

Hamayama opened this issue Mar 19, 2021 · 13 comments
Labels
Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. Severity-Crash Crashes are real bad news.

Comments

@Hamayama
Copy link

Environment

Windows build number: 10.0.19042.0
Windows Terminal version (if applicable): 1.6.10571.0

Any other software?

vim 8.2

Steps to reproduce

  1. vim aiueo.txt

    ( aiueo.txt is text file including wide characters. )

  2. Narrowing the window width by mouse.

Expected behavior

The window is resized normally.

Actual behavior

Windows Terminal hangs up (few seconds) and disappears.

( the condition seems to be a line wrapping of wide characters. )

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 19, 2021
@Hamayama
Copy link
Author

3002_winterm_issue_9547_size

@zadjii-msft
Copy link
Member

@ghost
Copy link

ghost commented Mar 19, 2021

Hi there!

Can you please send us feedback with the Feedback Hub with this issue and paste the link here so we can more easily find your crash information on the back end?

Thanks!

image image

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 19, 2021
@Hamayama
Copy link
Author

I sent feedback.

https://aka.ms/AAbm3go

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 20, 2021
@zadjii-msft
Copy link
Member

@DHowett Is there anyone on the team that can actually still access feedback hub links? Or are we all locked out now 😑

@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news. labels Mar 22, 2021
@DHowett
Copy link
Member

DHowett commented Mar 22, 2021

If I had to simply guess, this is the PrepareForDoubleByteSequence resize crash we know about. @zadjii-msft hit me up on Teams -- there's a way 😄

@zadjii-msft
Copy link
Member

 "providerName": "Microsoft.Windows.Terminal.Control",
 "lineNumber": "286",
 "fileName": "E:\\BA\\3\\s\\src\\buffer\\out\\textBuffer.cpp",
 "hresult": "2147549183",

Yep, it was _PrepareForDoubleByteSequence, which is #7417, which is #4907

/dup #4907

@ghost
Copy link

ghost commented Mar 26, 2021

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Mar 26, 2021
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements Needs-Attention The core contributors need to come back around and look at this ASAP. labels Mar 26, 2021
@Hamayama
Copy link
Author

I understood this issue is a duplicate of #4907.
But, I will try to investigate a little by myself.

  • type aiueo_unicode.txt → resize → no problem

  • vim aiueo_unicode.txt → resize → problem occurs

So, there might be a display conflict with vim and windows terminal.

--
file: aiueo_unicode.txt

@Hamayama
Copy link
Author

Hamayama commented Apr 12, 2021

I set up VS2019 and checked the call stack.

  • vim aiueo_unicode.txt → resize
src/buffer/out/textBuffer.cpp
  TextBuffer::Reflow
      ↓
  newBuffer.InsertCharacter
      ↓
  _PrepareForDoubleByteSequence
      ↓
  _AssertValidDoubleByteSequence
    // N, T failing case (uncorrectable) or
    // L, N and L, L failing cases (correctable) or
    // T, T failing case (uncorrectable)
    return false;
      ↓
  _PrepareForDoubleByteSequence
    FAIL_FAST_IF → Unhandled exception

@Hamayama
Copy link
Author

I made a quick fix.

diff -u -r src_orig/buffer/out/textBuffer.cpp src/buffer/out/textBuffer.cpp
--- src_orig/buffer/out/textBuffer.cpp	2021-04-11 20:24:10.253074800 +0900
+++ src/buffer/out/textBuffer.cpp	2021-04-12 22:05:31.059636600 +0900
@@ -2192,6 +2192,12 @@
                 const auto dbcsAttr = row.GetCharRow().DbcsAttrAt(iOldCol);
                 const auto textAttr = row.GetAttrRow().GetAttrByColumn(iOldCol);
 
+                // workaround for https://github.com/microsoft/terminal/issues/9547
+                if (!newBuffer._AssertValidDoubleByteSequence(dbcsAttr))
+                {
+                    break;
+                }
+
                 if (!newBuffer.InsertCharacter(glyph, dbcsAttr, textAttr))
                 {
                     hr = E_OUTOFMEMORY;

There seems to be multiple error handling methods.

  1. hr = E_OUTOFMEMORY; break;
  2. CATCH_RETURN();
  3. FAIL_FAST_IF();

But, no method seems to be useful for this issue ...

@DHowett
Copy link
Member

DHowett commented Apr 12, 2021

Sorry -- we actually have a fix for this one coming back in from the Windows OS code. I haven't merged it into this repository yet!

@DHowett
Copy link
Member

DHowett commented Apr 12, 2021

Thanks for the reminder, though -- i need to do that before we ship 1.7 (!)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

No branches or pull requests

3 participants