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

Crash in VSCode due to a regression in Electron 32.2.6 and window.setVibrancy #236772

Open
illixion opened this issue Dec 21, 2024 · 1 comment
Open
Assignees
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues

Comments

@illixion
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.97.0-insider (commit 89f8089)
  • OS Version: macOS 15.1.1 (24B91)

I'm a maintainer of a popular extension for VSCode that adds transparency effects to the main VSCode window. However, my extension started crashing VSCode on macOS when the user right-clicks in the VSCode window with it active. This issue began with VSCode v1.96.0 and currently occurs in the latest stable and Insider releases.

After researching, I discovered this is due to a regression introduced in Electron v32.2.6, which was patched in this PR and backported to v32.2.7, available as of 16 days ago. Below is the v32.2.7 patch notes excerpt highlighting this fix:

Fixed an possible crash when using draggable regions and BaseWindows to get the context-menu event. electron/electron#44954 (Also in 33, 34)

This issue affects users who rely on extensions or customizations that enable vibrancy effects on macOS, which is a popular feature for many developers. Without the fix in Electron v32.2.7, these users are forced to downgrade VSCode, which is not ideal.

Steps to Reproduce:

  1. Inject a custom JavaScript into the main Electron thread:
import electron from 'electron';

electron.app.on('browser-window-created', (_, window) => {
  window.webContents.on('dom-ready', () => {
    window.setVibrancy('fullscreen-ui');
  });
});
  1. When the VSCode window is created, right-clicking will not work and often cause the main process to crash with a segfault, along with a log like this: [1212/171542.178855:WARNING:in_range_cast.h(38)] value -634136515 out of range

This can also be reproduced by using the extension directly if preferred:

  1. Install my extension, version v1.1.41 (latest blocks installation due to this bug)
  2. Use Command Palette action "Enable Vibrancy"
  3. After restarting VSCode, right-clicking will stop working and often cause the main process to crash with a segfault

Request

Please consider updating the Electron version used in VSCode to v32.2.7, as it resolves this regression and improves stability for macOS users. This would allow extensions like mine, which rely on Electron's setVibrancy functionality, to work without causing crashes.

If further details or testing are needed, I’d be happy to assist.

@bpasero
Copy link
Member

bpasero commented Dec 21, 2024

Can you please follow the steps in https://github.com/Microsoft/vscode/wiki/Native-Crash-Issues to get at more details around the crash and attach the result here? Thanks!

@bpasero bpasero added the freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues
Projects
None yet
Development

No branches or pull requests

3 participants