vscode: Segmentation fault opening vscode on Arch Linux ARM64
Does this issue occur when all extensions are disabled?: Yes
Hello Friends,
I’m running vscode from Arch Linux ARM (Asahi) on my MacBook Air M1 and its giving me a segfault before it opens.
/opt/visual-studio-code/bin/code: line 62: 16644 Segmentation fault ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
I have never opened code before on this system and I think it may be related to the fact that the M1 uses a 16K address page (chromium had a similar issue and maybe a similar patch can be applied) instead of a 4K. More info in the Asahi wiki.
I know its a very niche case on a probably unsupported platform but since more ARM systems would start using pages bigger than the standard x86 4K for the big performance improvement it may be worth it the report.
- VS Code Version: Both 1.68.1 and Insiders build 1656566876
- OS Version: Arch Linux Asahi ARM64 (MacBook Air M1) - Linux 5.17.0-rc7-asahi-next-20220310-5-2-ARCH
Steps to Reproduce:
- Open visual studio code with command
/usr/bin/code --unity-launch %For simplycode.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (5 by maintainers)
Thanks for the clarification @Lemmingh , I only backported the allocator CL that was linked in the chromium bug https://bugs.chromium.org/p/chromium/issues/detail?id=1301788, didn’t know there was a compile time page size reduction that was checked in. We will be updating to Electron 19 this week which has the relevant compiler fixes https://github.com/microsoft/vscode/pull/154092
Hello Friends,
Today code 1.69.0 binary dropped on AUR and i was able to test and unfortunately both 1.69.0 and insiders build 1657150868-1 gave me the same segfault.
I was able to install electron trough npm and running code by forcing electron 19 trought
npx electron /opt/visual-studio-code/resources/app --ms-enable-electron-run-as-node --unity-launchThis is fixed in Electron 19.0.0, while vscode is still on 18.3.5. It should start working once Electron is updated (unless there are other issues).
@TylerLeonhardt I can confirm! It’s working as expected now. Thanks 😃
The issue has been addressed in vscode insiders and the fix will also be available in
1.69.0stable release next week , you can refer to https://github.com/microsoft/vscode/pull/145527#issuecomment-1141146714 for context.This bug has been fixed in the latest release of VS Code Insiders!
@h0m3, you can help us out by commenting
/verifiedif things are now working as expected.If things still don’t seem right, please ensure you’re on version 7ed02a69658fc07f08740b98fa0d8d96c1a61ed4 of Insiders (today’s or later - you can use
Help: Aboutin the command palette to check), and leave a comment letting us know what isn’t working as expected.Happy Coding!
@Lemmingh @deepak1556 You folks are awesome! Thanks for not giving up on the issue ❤️
Yes, the problem is rooted in Electron v
18, including the latest v18.3.6.An app built with Electron v
18for Linux ARM64 is still 4 KiB-aligned.In other words, the PR
doesn’t work as expected, because it only backported the Chromium Change 3545665.
However, prior to that Change, there were modifications to Chromium’s build system during M102, Change 3542265.
Yeah thanks i was just trying to launch standard vscode and not insiders version. With the insider version all is perfectly fine. Thanks !
Confirmed,
The issue is fixed. Sorry for the delayed response.