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

[Bug]: macOS: Closing child window during parent window's resize event causes segfault if toggling full-screen mode with keyboard #40930

Closed
3 tasks done
SpoilerJones opened this issue Jan 9, 2024 · 1 comment
Assignees
Labels
28-x-y 29-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/macOS status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@SpoilerJones
Copy link

SpoilerJones commented Jan 9, 2024

Preflight Checklist

Electron Version

28.1.0

What operating system are you using?

macOS

Operating System Version

macOS 14.2.1 (Sonoma)

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

27.2.1

Expected Behavior

Our app sometimes creates windows that are children of the main window for showing information temporarily; they're supposed to close when the main window moves or resizes, among other conditions, so we have:

parentWin.once("resize", () => {
	if (!window.isDestroyed()) {
		window.close();
	}
});
parentWin.once("move", () => {
	if (!window.isDestroyed()) {
		window.close();
	}
});

The resize and move events fire when the main window enters or leaves full-screen mode (macOS), and we expect that we should be able to close the child window in those situations as well.

Actual Behavior

When the main window enters or leaves full-screen mode in response to the keyboard shortcut (Fn+F), if one of these child windows is present to be closed, the entire app disappears with an error message (from the OS, I believe) indicating EXC_BAD_ACCESS (SIGSEGV). (I can provide the full crash report on request, but I've found the gist can produce one readily.)

The crash has not happened to me if I use other means to resize or move the window, such as clicking the full-screen button (the green traffic-light button) or dragging the edge of the window.

Testcase Gist URL

https://gist.github.com/SpoilerJones/e3f4c0de67559449ffb1e1c21157609f

Additional Information

Using Electron Fiddle, I tried out various different versions of Electron. The crash happens in v29.0.0-alpha.7, and in v28.0.0, v28.1.0, and v28.1.1. It does not happen in v27.2.1 or any of the older versions I spot-checked.

@SpoilerJones SpoilerJones changed the title [Bug]: macOS: Closing child window during parent window's resize event causes segfault if [Bug]: macOS: Closing child window during parent window's resize event causes segfault if toggling full-screen mode with keyboard Jan 9, 2024
@codebytere codebytere added platform/macOS status/confirmed A maintainer reproduced the bug or agreed with the feature has-repro-gist Issue can be reproduced with code at https://gist.github.com/ 28-x-y 29-x-y labels Jan 10, 2024
@codebytere
Copy link
Member

Fixed in #41264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
28-x-y 29-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/macOS status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
Status: 👍 Does Not Block Stable
Status: 👍 Does Not Block Stable
Development

No branches or pull requests

2 participants