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

fix: crash on macOS non-programmatic close #41264

Merged
merged 1 commit into from Feb 9, 2024
Merged

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Feb 7, 2024

Description of Change

Closes #40798
Refs microsoft/vscode#204563

Fixes a crash that started occurring sporadically with some types of macOS window close after PartitionAlloc was enabled upstream. It seems to be the case now that performClose: can cause window_ to be null, thus causing the call to IsVisible to crash trying to access a deallocated instance. There's probably more effective long-term fix here but we can fix this by moving the conditional determining whether we should call NotifyWindowCloseButtonClicked() for a closed sheet above performClosure to avoid this problem altogether.

Using the Cmd+Tab -> Cmd+Q repro provided in #40798 I tracked this back to v28.0.0-alpha.3...v28.0.0-alpha.4 - specifically reverting #33981 fixes the issue as well so we should investigate that further as a follow up.

h/t @MarshallOfSound for speculating this fix in response to what might be the same issue in Discord.

cc @deepak1556 @bpasero

Checklist

Release Notes

Notes: Fixed a crash that started occurring sporadically with some types of macOS window close

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/28-x-y PR should also be added to the "28-x-y" branch. target/29-x-y PR should also be added to the "29-x-y" branch. labels Feb 7, 2024
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 7, 2024
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 8, 2024
@codebytere
Copy link
Member Author

Unrelated WOA failures due to occlusion tests.

@codebytere codebytere merged commit c894645 into main Feb 9, 2024
24 of 26 checks passed
@codebytere codebytere deleted the fix-crash-on-close branch February 9, 2024 21:44
Copy link

release-clerk bot commented Feb 9, 2024

Release Notes Persisted

Fixed a crash that started occurring sporadically with some types of macOS window close

@trop
Copy link
Contributor

trop bot commented Feb 9, 2024

I have automatically backported this PR to "28-x-y", please check out #41298

@trop trop bot added in-flight/28-x-y and removed target/28-x-y PR should also be added to the "28-x-y" branch. labels Feb 9, 2024
@trop
Copy link
Contributor

trop bot commented Feb 9, 2024

I have automatically backported this PR to "29-x-y", please check out #41299

@trop trop bot added in-flight/29-x-y merged/28-x-y PR was merged to the "28-x-y" branch. merged/29-x-y PR was merged to the "29-x-y" branch. and removed target/29-x-y PR should also be added to the "29-x-y" branch. in-flight/28-x-y in-flight/29-x-y labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/28-x-y PR was merged to the "28-x-y" branch. merged/29-x-y PR was merged to the "29-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Segfault when closing the app on macOS (v28)
5 participants