Crash when rebuilding application menu on wayland
Problem
Extracted from https://github.com/microsoft/vscode/issues/181533#issuecomment-1565576439 [code block] @Mithras can you provide the following details to help us repro the issue, 1) Are you using custom or native titlebar ? 2) Are you starting the application with `--ozone-platform=wayland --enable-features=WaylandWindowDecorations` ? 3) Where did you install insiders from ? Snap, deb or rpm ? 4) A video recording showing the exact repro steps will be helpful.
Unverified for your environment
Select your OS to check compatibility.
2 Fixes
Fix Wayland Menu Rebuild Crash in VSCode
The crash occurs when the application attempts to rebuild the application menu on Wayland with specific configurations, particularly when using custom titlebars and certain flags. This can lead to incompatibilities in rendering and event handling, causing the application to freeze or crash.
Awaiting Verification
Be the first to verify this fix
- 1
Check Titlebar Configuration
Determine if you are using a custom or native titlebar. If using a custom titlebar, switch to the native titlebar to see if it resolves the issue.
bashexport ELECTRON_ENABLE_LOGGING=true - 2
Modify Launch Flags
Start the application without the `--ozone-platform=wayland` and `--enable-features=WaylandWindowDecorations` flags to check if the issue persists. This will help identify if the flags are causing the crash.
bash./code --no-sandbox - 3
Reinstall VSCode Insiders
Reinstall the VSCode Insiders build from a different source (e.g., from deb instead of snap) to rule out installation issues. Ensure to back up your settings before reinstalling.
bashsudo apt remove code-insiders && sudo apt install code-insiders - 4
Record and Report
Create a video recording of the steps leading to the crash, including the terminal commands used and the application behavior. This will help in diagnosing the issue further.
bashffmpeg -f x11grab -s $(xdpyinfo | grep dimensions | awk '{print $2}') -i :0.0 -r 30 -vcodec libx264 output.mp4
Validation
To confirm the fix, attempt to rebuild the application menu after following the steps. If the application no longer crashes and behaves as expected, the issue is resolved. Additionally, review the logs for any errors related to the menu rebuild process.
Sign in to verify this fix
1 low-confidence fix
Fix Crash on Application Menu Rebuild in Wayland
The crash occurs due to a conflict between the application menu rebuild process and the Wayland window decorations feature when using a custom title bar. This is exacerbated by the way the application handles window events and rendering in a Wayland environment, leading to instability.
Awaiting Verification
Be the first to verify this fix
- 1
Verify Wayland Configuration
Ensure that the application is started with the correct Wayland configuration flags to avoid conflicts. This includes using the ozone platform and enabling Wayland window decorations.
bashcode --ozone-platform=wayland --enable-features=WaylandWindowDecorations - 2
Check Title Bar Settings
Determine whether you are using a custom title bar or the native one. If a custom title bar is being used, switch to the native title bar to see if the crash persists.
typescriptSettings > Window: Title Bar Style > Native - 3
Reinstall Application
If the issue persists, consider reinstalling the application from a different source (Snap, deb, or rpm) to rule out installation-specific issues.
bashsudo apt remove code-insiders && sudo snap install code-insiders --classic - 4
Update Graphics Drivers
Ensure that your graphics drivers are up to date, as outdated drivers can cause rendering issues in Wayland environments. Check for updates through your package manager or the graphics vendor's website.
bashsudo apt update && sudo apt upgrade - 5
Capture and Analyze Logs
Run the application from the terminal to capture logs when the crash occurs. This can provide insights into the specific error messages and help in debugging.
bashcode --ozone-platform=wayland --enable-features=WaylandWindowDecorations > log.txt 2>&1
Validation
To confirm the fix, attempt to rebuild the application menu after following the steps. If the application runs without crashing and the menu rebuilds successfully, the issue is resolved. Additionally, check the log file for any remaining errors.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep