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

Manually initialize the warnings vector to prevent a crash on launch #8995

Merged
1 commit merged into from
Feb 2, 2021

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

Oops, winrt IVectors need to be manually initialized, when default-constructed std::vectors didn't. Simple oversight.

PR Checklist

Validation Steps Performed

Ran the terminal with

    "schemes" :
    [ {} ]

First the crash repro'd, now it doesn't.

@ghost ghost added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news. labels Feb 1, 2021
@zadjii-msft
Copy link
Member Author

@DHowett INTERESTING, the bot did not transfer the z*Service-Consider labels, headsup

@DHowett
Copy link
Member

DHowett commented Feb 1, 2021

Thanks for the h/u. What the heck did spellbot drink?

@@ -2410,7 +2410,7 @@ namespace winrt::TerminalApp::implementation
IVectorView<Profile> profiles,
IMapView<winrt::hstring, ColorScheme> schemes)
{
IVector<SettingsLoadWarnings> warnings;
IVector<SettingsLoadWarnings> warnings{ winrt::single_threaded_vector<SettingsLoadWarnings>() };
Copy link
Member

Choose a reason for hiding this comment

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

I hate that we're heap allocating a thing that in most instances will not be used at all, but it fixes a bug and I cannot die on the hill of purity.

@DHowett DHowett added AutoMerge Marked for automatic merge by the bot when requirements are met zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. zStable-Service-Queued-1.12 A floating label that tracks the current Stable version for servicing purposes. labels Feb 1, 2021
@ghost
Copy link

ghost commented Feb 1, 2021

Hello @DHowett!

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 7 hours 56 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.

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

Wow, this is the only place we did this. Good to know haha.

@ghost ghost merged commit 9d71fa8 into main Feb 2, 2021
@ghost ghost deleted the dev/migrie/b/8986-why-would-you-do-this-colorschemes branch February 2, 2021 06:50
@DHowett DHowett removed zStable-Service-Queued-1.12 A floating label that tracks the current Stable version for servicing purposes. zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. labels Feb 5, 2021
DHowett pushed a commit that referenced this pull request Feb 5, 2021
…8995)

## Summary of the Pull Request

Oops, winrt `IVector`s need to be manually initialized, when default-constructed `std::vector`s didn't. Simple oversight.

## PR Checklist
* [x] Closes #8986
* [x] I work here
* [x] A test would be great but ain't nobody got time for that.
* [n/a] Requires documentation to be updated

## Validation Steps Performed
Ran the terminal with
```json

    "schemes" :
    [ {} ]
```
First the crash repro'd, now it doesn't.

(cherry picked from commit 9d71fa8)
DHowett pushed a commit that referenced this pull request Feb 5, 2021
…8995)

## Summary of the Pull Request

Oops, winrt `IVector`s need to be manually initialized, when default-constructed `std::vector`s didn't. Simple oversight.

## PR Checklist
* [x] Closes #8986
* [x] I work here
* [x] A test would be great but ain't nobody got time for that.
* [n/a] Requires documentation to be updated

## Validation Steps Performed
Ran the terminal with
```json

    "schemes" :
    [ {} ]
```
First the crash repro'd, now it doesn't.

(cherry picked from commit 9d71fa8)
@ghost
Copy link

ghost commented Feb 11, 2021

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

Handy links:

@ghost
Copy link

ghost commented Feb 11, 2021

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

Handy links:

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-Settings Issues related to settings and customizability, for 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-1 A description (P1) 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.

Terminal v1.5.10271.0 crashes on startup due to settings.json load bug
3 participants