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

Freeze & crash Windows Terminal Preview 1.21.1272.0 with these few simple steps, you'll never guess what the 3rd one is! #17202

Open
PhMajerus opened this issue May 7, 2024 · 14 comments
Labels
Area-Quality Stability, Performance, Etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Milestone

Comments

@PhMajerus
Copy link

PhMajerus commented May 7, 2024

Windows Terminal version

1.21.1272.0

Windows build number

10.0.22631.3527 x64

Other Software

Just Terminal Preview, crashes with any shell (tested cmd.exe, bash in Ubuntu in WSL2).

Steps to reproduce

  1. Open Windows Terminal Preview with your default shell
  2. Click the [v] menu, and select Settings to display the settings page
  3. Tear-off the Settings panel into its own window, making both settings and your shell visible
  4. Select any shell profile, click [Appearance >]
  5. Close the Settings tab, which closes its individual window.
  6. Wait ~30 seconds (could be longer apparently if focus is changed)
  7. Give the focus to some other app, then click on your shell panel to give it the focus again
  8. ?
  9. Profit!

I've crashed it 10 times using these steps, it works every single time.

Edit: I'm still trying to reduce the steps to the minimum required.

Expected Behavior

Windows Terminal should keep running

Actual Behavior

Windows Terminal freezes, its client area gets ghosty transparent, it receives the dreaded (Not Responding) suffix, and Dr. Watson comes along to put it out if its misery.

@PhMajerus PhMajerus added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 7, 2024

This comment has been minimized.

@DHowett
Copy link
Member

DHowett commented May 7, 2024

Dr. Watson as the grimmest reaper. I love it.

Would you be able to file feedback and reproduce the crash in the Apps > Terminal node and share the link with us?

I can't get this to happen locally . . . and I want to see if it's the same bug we just fixed with #17199.

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 7, 2024
@PhMajerus
Copy link
Author

Feedback Hub: https://aka.ms/AAqbvpz
I'm not sure it captured the proper dump though, only Windows Terminal shows in the apps list, no separate entry for Windows Terminal Preview.
Let me know.

@microsoft-github-policy-service microsoft-github-policy-service bot 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 May 7, 2024
@PhMajerus
Copy link
Author

I can get it to freeze every single time on a Surface Book 2 15", but cannot reproduce on an Intel NUC (NUC13ANKI50WC).

Could it be something GPU-related? The Surface Book 2 has always been a bit unreliable, even Edge sometimes restarts its rendering engine.

@DHowett
Copy link
Member

DHowett commented May 7, 2024

I'm seeing a thread tearing down a TSF::Implementation for a shell handwriting input method, a couple shell worker threads also stuck tearing down, and a window trying to update its acrylic background policy hanging also waiting for a shell worker thread. That's weird.

Watson cab 97512468-57cc-48ca-97d5-9721b4e3ec53

@PhMajerus
Copy link
Author

PhMajerus commented May 7, 2024

It's really weird, I could narrow it down to showing the appearance page for any shell, not necessarily the one being used in the other window.
But the settings has to be the tab tore off, if it's another shell window and then that window is used to show the settings and do everything similarly, then it won't crash.

So it has to be the settings page that is tore off to create a new window, and it has to show the appearance with the preview. You can navigate to another setting page again, as long as the preview has been displayed, it will crash.
If the settings is shown in the primary window or in a window created by tearing off another shell tab, it doesn't crash.

Is there some Atlas resources that are shared with the preview and may be freed when Settings is closed? Why would it only happen when the settings is tore off?

It is pretty easy to avoid the bug, and I cannot reproduce it on another system, so it's not a blocking issue by any means, but I feel like there must be some underlying issue that just happens to get less noticeable on other systems.

@carlos-zamora carlos-zamora added Product-Terminal The new Windows Terminal. Area-Quality Stability, Performance, Etc. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels May 8, 2024
@carlos-zamora carlos-zamora added this to the Backlog milestone May 8, 2024
@PhMajerus
Copy link
Author

Could this be related?

image

I know Microsoft Surface Book 2 display drivers are somewhat unreliable, and Microsoft's Surface team never fixed the issue, Edge also sometimes has to restart its rendering, blacking out all rendering windows and recovering.

@PhMajerus
Copy link
Author

PhMajerus commented May 10, 2024

Attached another crash dump to the Feedback Hub report.
This one does not even freeze, it crashes directly, and doesn't involve the Settings page, it's just opening an Ubuntu WSL2 tab, doing apt update/upgrade/autoremove/autoclean, then exit to close the tab. Terminal shows the original cmd tab again and crashes immediately.
Again, this could be replicated every single time on my Surface Book 2.

@scc23456
Copy link

try to disable "Shell handwriting" option in Windows Settings...

@PhMajerus
Copy link
Author

@scc23456 Good catch!
Indeed disabling the Shell handwriting feature seems to fix both crashes, and that would explain the shell handwriting input method that DHowett saw in the crash dump.

So there seems to be a problem between Terminal and "write anywhere", and this shows why it is important to try to test software on some devices with 👆 touch and 🖊️ pen, not only on typical workstations.

@lhecker lhecker self-assigned this May 16, 2024
@lhecker
Copy link
Member

lhecker commented May 17, 2024

I've got a laptop with touchscreen, I'm on 22635.3575, and I don't have a Shell Handwriting setting:
image

Does this only work with pens?

@PhMajerus
Copy link
Author

Does this only work with pens?

Yeah, it's a recent feature the shell team introduced to write directly in many common controls. For example we can ink directly inside a textbox or address bar using the pen.

image

This is intended to be a faster way to input text without having to display the tablet input panel (TabTip).
You'll need a device with a pen digitizer to test it out.

I suspect you're using or subclassing some common control, the shell attaches some overlay inking panel on top of it, and you destroy it without going through the original code that ensures the attached inking panel is properly disposed of, then it crashes when trying to access its parent HWND or something. This is just a wild guess though, I haven't checked how they implemented the Ink Anywere feature yet.

@lhecker lhecker removed their assignment May 17, 2024
@PhMajerus
Copy link
Author

@lhecker Are you giving up on this one? I didn't see any similar crash with that feature in other apps, there is probably something Terminal does that makes it crash when that feature extends its controls.

@DHowett
Copy link
Member

DHowett commented May 17, 2024

Are you giving up on this one?

Please don't read too much into how we manage our issue assignments. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Quality Stability, Performance, Etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants