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

Don't throw in GetProposedDimensions #10260

Merged
3 commits merged into from
May 28, 2021
Merged

Don't throw in GetProposedDimensions #10260

3 commits merged into from
May 28, 2021

Conversation

zadjii-msft
Copy link
Member

I cannot for the life of me repro the original bug. I've got fonts with bad permissions SxS, I've tried installing a font twice, I've tried stopping the font cache service. No idea how to manually repro the original bug.

BUT theoretically, this function should never throw. So lets just switch this to a LOG_IF_FAILED, and hope that this goes away?

Unclear if this can get cherry-picked trivially to 1.8. Code's pretty trivial though so if we need another PR for that, it can be arranged.

@ghost ghost added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news. labels May 28, 2021
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also just make the font fallback loader non-fatal? There are a bunch of THROW_IF_FAILEDs in DxFontRenderData::NearbyCollection, which contributes to this bug blowing up.

The caller, DxFontReenderData::_FindFontFace should treat failures coming out of NearbyCollection as non-fatal -- you can probably wrap the entire "if the system collection missed" conditional in a try/CATCH_LOG.

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 28, 2021
@zadjii-msft
Copy link
Member Author

@DHowett I'm pretty those are all in try/catch's. It's just they are all bubbling up to an HRESULT, getting here, and this particular method is throwing it.

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 28, 2021
@DHowett
Copy link
Member

DHowett commented May 28, 2021

Failing out the entire font load is the quickest way to get to a DX renderer that just doesn't have a font, and fails every time it tries to get one (which will probably result in a black screen?). It wouldn't matter if we caught the error at the highest level, the renderer would remain inoperable.

Wrapping a localized try/catch around the nearby font collection lets fallback proceed as normal... which is really what we want, isn't it?

You can probably mimic this failure with a THROW_HR(E_UNEXPECTED) inside NearbyCollection... so we can validate 😄

EDIT: and setting an invalid font ofc

@DHowett DHowett requested a review from miniksa May 28, 2021 18:05
@DHowett
Copy link
Member

DHowett commented May 28, 2021

@miniksa may need to re-validate this w/ the new changes to Nearby

Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I get it. That's about what I would have done. Thanks.

@miniksa miniksa added the AutoMerge Marked for automatic merge by the bot when requirements are met label May 28, 2021
@ghost
Copy link

ghost commented May 28, 2021

Hello @miniksa!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 2 hours 17 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@miniksa
Copy link
Member

miniksa commented May 28, 2021

@msftbot wait 6 minutes before merging

@ghost
Copy link

ghost commented May 28, 2021

Hello @miniksa!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Fri, 28 May 2021 21:57:07 GMT, which is in 6 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

DHowett pushed a commit that referenced this pull request Jun 1, 2021
I cannot for the life of me repro the original bug. I've got fonts with bad permissions SxS, I've tried installing a font twice, I've tried stopping the font cache service. No idea how to manually repro the original bug.

BUT theoretically, this function should never throw. So lets just switch this to a `LOG_IF_FAILED`, and hope that this goes away?

* [x] Fixes #10211?
* [x] built & ran manually.

Unclear if this can get cherry-picked trivially to 1.8. Code's pretty trivial though so if we need another PR for that, it can be arranged.

(cherry picked from commit 89ca2ae)
DHowett pushed a commit that referenced this pull request Jun 1, 2021
I cannot for the life of me repro the original bug. I've got fonts with bad permissions SxS, I've tried installing a font twice, I've tried stopping the font cache service. No idea how to manually repro the original bug.

BUT theoretically, this function should never throw. So lets just switch this to a `LOG_IF_FAILED`, and hope that this goes away?

* [x] Fixes #10211?
* [x] built & ran manually.

Unclear if this can get cherry-picked trivially to 1.8. Code's pretty trivial though so if we need another PR for that, it can be arranged.

(cherry picked from commit 89ca2ae)
@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal v1.9.1942.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal Preview v1.10.1933.0 has been released which incorporates this pull request.:tada:

Handy links:

@greg-hammond
Copy link

follow link above to MS store download > Install > Launch > watch window crash within 10 seconds.
image

@zadjii-msft
Copy link
Member Author

@greg-hammond Can you file a new issue, with a /feedback link in it? I'm guessing whatever crash you're seeing isn't the same thing that was fixed by this PR 😉

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Startup Crash in _HandleCreateWindow on 1.8 Stable
4 participants