vscode: 1.90 snap package crash on startup
Does this issue occur when all extensions are disabled?: Yes
-
VS Code Version: 1.90.0-insider 26c4a07b47a2bd34480a5e4cba2c2384c590b039 x64
-
OS Version: Ubuntu 24.04 LTS
Steps to Reproduce:
- launch the code-insiders from terminal with command
code-insiders. it opens and then closes down. - here is the crash report(file_attached): crash_report.txt
here is the snippet of crash logs that i feel is important:
[17512:0511/145729.715832:ERROR:angle_platform_impl.cc(44)] Display.cpp:1052 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
ERR: Display.cpp:1052 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
[17512:0511/145729.715854:ERROR:gl_display.cc(515)] EGL Driver message (Critical) eglInitialize: Could not create a backing OpenGL context.
[17512:0511/145729.715863:ERROR:gl_display.cc(786)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
[17512:0511/145729.715874:ERROR:gl_display.cc(820)] Initialization of all EGL display types failed.
[17512:0511/145729.715883:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[17512:0511/145729.717123:ERROR:viz_main_impl.cc(196)] Exiting GPU process due to errors during initialization
MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: iris
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load swrast driver
[17520:0511/145729.884318:WARNING:sandbox_linux.cc(418)] InitializeSandbox() called with multiple threads in process gpu-process.
[90m[main 2024-05-11T09:57:29.908Z][0m resolveShellEnv(): skipped (VSCODE_CLI is set)
[0511/145729.910779:ERROR:process_memory_range.cc(75)] read out of range
here “mypcname” is the placeholder for actual user login name.
tried but didn’t work: reference issue
Workaround: running with --use-gl=angle --use-angle=swiftshader
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 138
- Comments: 182
Commits related to this issue
- fix: force software gl backend for snap Refs https://github.com/microsoft/vscode/issues/212494 When using the default ANGLE gl/gles backend, v1.90 attempts to get display refresh rate for vsync from... — committed to microsoft/vscode by deepak1556 2 years ago
- fix: force software gl backend for snap Refs https://github.com/microsoft/vscode/issues/212494 When using the default ANGLE gl/gles backend, v1.90 attempts to get display refresh rate for vsync from... — committed to microsoft/vscode by deepak1556 2 years ago
- fix: force software gl backend for snap (#214548) Refs https://github.com/microsoft/vscode/issues/212494 When using the default ANGLE gl/gles backend, v1.90 attempts to get display refresh rate f... — committed to microsoft/vscode by deepak1556 2 years ago
- fix: force software gl backend for snap (#214549) * fix: force software gl backend for snap Refs https://github.com/microsoft/vscode/issues/212494 When using the default ANGLE gl/gles backend, ... — committed to microsoft/vscode by deepak1556 2 years ago
Thanks for the fix @deepak1556! But lets also recap:
Don’t want to be too critical because its free software after all. But still there is room for improvement here.
Same issue with Ubuntu 23.04. This work-around works:
code --in-process-gpuThanks everyone who have tested and verified the fix from https://github.com/microsoft/vscode/issues/212494#issuecomment-2168893148, we have merged the changes to
1.90release line and will be available with1.90.2release this week.Seems like the problem is only with Snap version. Installing latest version from .deb package works just fine.
Some workarounds I’ve found so far:
code --in-process-gpuon terminalcode --use-gl=angle --use-angle=swiftshadersudo snap revert code --revision 159They will probably fix it soon, but, for now, that’s the solution I found
Its working for me I tried command code --in-process-gpu .
Wew, glad to know it’s just a VSCode issue and not something with my GPU/GPU drivers as I initially assumed from
--verboseoutput. Meanwhile snap users can runsnap revert codeuntil the new version is out. According to this StackOverflow answer it will update again on new version available.code --in-process-gpuworked for me too!The candidate fix merged in https://github.com/microsoft/vscode/pull/214549 is a temporary workaround and it will be available in
1.90.1release this week. I will close this issue for verification as part of the release schedule https://github.com/microsoft/vscode/issues/214643. Once I have the stable build available, will attach in this issue thread for verification.For those interested in following, I am continuing the investigation in https://github.com/microsoft/vscode/issues/214830 and will land a proper fix as a follow-up.
Please avoid commenting off-topic/workarounds/+1 till the verification has completed, the issue will be reopened if the verification fails. Thanks for your understanding.
workaround, it works for me:
code --in-process-gpuOur insiders version should contain the fix described in https://github.com/microsoft/vscode/issues/212494#issuecomment-2153784514, please test it out with
snap install code-insiders --classic. Fix will also be pushed to stable1.90.1early next week. Thanks for your patience!On Ubuntu 23.10, I reproduce the same problem after the update. This solution works for me:
code --in-process-gpuHaving same issue here Ubuntu 24.04 (Snap package). Hope this will be fixed soon!
A lot of people commenting and not reading the history.
Read the history.
A member should lock this issue.
I have also the same issue with Ubuntu 22.04 (LTS) and the new version of snap package of vscode (1.90.0). For the moment, the work-around
code --in-process-gpuworks. Hoping this issue will be fixed soon !I’ve just downgraded to 1.89.1, to deal with this issue. Very very annoying behaviour
With code v1.90.1 fix the force close issue. But now, the code itself become super laggy when scrolled the document that open and high-rate CPU consume make my laptop fan goes bbrrr…
https://github.com/microsoft/vscode/assets/148973576/1964a263-3088-4494-86e4-e688c79816d5
For the same issue in my Ubuntu 24.04 LTS,
code --in-process-gpuworked out fine@rino1 1.90.1 version solved startup crush, but vscode started to eat CPU like crazy and just crush later 😕
I’ve reverted again back to 1.89
snap revert codeHi there, what is the status of the matter? It’s quite difficult to work sensibly at the moment. What is the reason for the fact that the error correction remains unanswered or continues for so long? If the bug is not fixed in the version of “code-insiders”, it will surely be included in the next version of “code”, right?
Following build contains the fix in the runtime that should address the crash, the software renderer workaround has also been removed in this build. Please self host on this for a couple of days and let me know if it behaves similar to
v1.89. Thanks!linux x64 snap
Install instructions:
snap install <path-to>.snap --classic --dangerousThank you all for engaging on this issue. At this point we have all the necessary data related to the crash and we know the fix that needs to be implemented in the runtime, as mentioned in https://github.com/microsoft/vscode/issues/212494#issuecomment-2166941209 We will update here with new builds once they are ready.
In the meantime, please use one of the following options:
1.90.0and started experiencing slowdown from the software rendering in1.90.1, use our insiders versionsudo snap install code-insiders --classicwhich has reverted the workaround https://github.com/microsoft/vscode/commit/3b80131054ea2b80002bfde213a41293b85e68de1.90.1, revert tov1.89viasudo snap revert code --revision 159or prefer the debian packageI am locking this issue to keep the discussions on topic and to make this comment easier to find, thank you for your understanding.
try code --in-process-gpu .
Same issue on Ubuntu 24.04. The work-around works:
code --use-gl=angle --use-angle=swiftshaderThe “codium” snap works (output of “snap list”)
Hi, using “code --in-process-gpu” also worked for me!
Everything works fine now, no crashing. But it feels really slow. Consuming much resources.
Here is the stable build
1.90.1for testing, install withsnap install <path-to>.snap --classic --dangerous. If the crash is still present with this build please let me know, also attach the version informationcode --version.linux x64 snap
Can confirm this worked for me, too. Thank you.
And to everyone suggesting that we simply uninstall the snap version and install a deb version in stead, this may work for some who don’t care about containerization, but others have reasons to insist on it. A deb install just isn’t that great of a workaround as it doesn’t explain or solve the issue, just sidesteps it.
as a temporary fix revert to the previous version
sudo snap revert codeSame.
Also, I don’t think merging the other issues into this one was appropriate. Didn’t have this problem until the today update ( certainly not a month ago ).
still occurring on the snap. please fix this - a crash loop on any other platform wouldn’t be left unacknowledged for 11 days ☹️
this worked from https://code.visualstudio.com/docs/setup/linux the repository and key can also be installed manually with the following script:
Then update the package cache and install the package using:
You should try
--in-process-gpuflag instead - it will keep Electron in the main GPU process, which is also not optimal, but should be better for performance since it still uses GPU acceleration.--use-gl=angle --use-angle=swiftshaderflags move the process to CPU, yes.@deepak1556 I’ve updated to 1.90.2 and it keeps crash. And the crash is related to the maximization of the window. see here
@deepak1556 I tried the build from https://github.com/microsoft/vscode/issues/212494#issuecomment-2168893148 now and it didn’t crash on startup and CPU usage is max > 10%. So it seems like this is the final fix then.
I thougth it just my OS, the CPU work harder than before after opening the vscode on 1.90.1
But will these problems be solved or not? Are they working on it?
@LucasMatuszewski based on investigating https://github.com/microsoft/vscode/issues/214830 there are two code paths that attempt to use the internal vsync code path that is currently triggering the crash
NativeViewGLSurfaceEGLX11(only when the gl library does not have vsync extension) which is used by skia gpu based compositor, this path can be avoided by using--use-angle=swiftshaderX11CanvasSurfacewhich is used by the software compositor which also runs inside the gpu process, this path cannot be avoided.The crash you are experiencing would be from the second path, I will reopen this issue as the candidate fix is not the right one. The correct fix at this point would be to provide access to resource bundle for the gpu process, this change needs to happen in the runtime. I have reached out to chromium folks to confirm if this is intended and will make the change accordingly.
The reason you are not experiencing the crash with Slack or other electron apps depends on whether gpu compositing is being used or not. It is also an issue that our snap does not use gpu compositing when available unlike deb, I have a PR out to address that.
Please revert to v1.89 or use debian package till this issue is fixed.
NOTE: The latest insider build fixes the issue. The current stable version on the snap store (160) is still broken.
Hi there. After the update of code-insiders last Friday, code-insiders finally starts normally again. Thank you for the support
I faced this issue today on my Ubuntu 24.04 and thought it might be a bug. After several uninstalling and installing, I realized it was bugging the Snap Store version. So I downloaded the .deb package from their Official Downloads. Then I used apt to install the package.
sudo apt install ./code_1.90.0-1717531825_amd64.debNow my Visual Studio Code is working fine.
--use-gl=angle --use-angle=swiftshader --ozone-platform=waylanddoes not work for me on Fedora 40, with the Snap.--in-process-gpudoes though.I’m having this issue as well, and just checked and I’m using Wayland.
This is working for me
code --in-process-gpu helps me too! Thanks
@fr43nk insiders doesn’t have the fix yet, it is pending a runtime update which will happen tomorrow. Try the
1.90.2release once available.Sorry for the related issues spam, just trying to point people experiencing high CPU usage/lag with the snap package here. For anyone looking for the current status that might have gotten buried somewhat, check https://github.com/microsoft/vscode/issues/212494#issuecomment-2168072242 above, the build to confirm working is in the comment just below that one in https://github.com/microsoft/vscode/issues/212494#issuecomment-2168893148
Quick recap:
0da59bd, I run into the crashes on launch--use-gl=angle --use-angle=swiftshader, VSCode starts up, but requires a lot of resources, at times is very laggy and graphics are stuttering, due to OpenGL backend software emulation. I did not run into any crashes. I don’t know if my driver beingradeonsihas anything to do with there not being crashes or if I just got lucky somehowlsb_release -a:Tuxedo OS 3|Release: 22.04|jammy(basically a kubuntu 22.04)The build
9aa9147/1718390634 from the quoted comment has been working fine for me, left my laptop running over night. For the last 25 hours, there was no crash and resource usage is comparable to v1.89.1 with no lag and no stutters. Closing normally and restarting a few times did not produce any crashes either.@deepak1556 at a first glance build 1718390634 is working perfectly fine 👍
Same issue. Whenever I execute
code .it opens up for like 3 seconds then crashes. I reverted version using snapsudo snap revert codeand it’s now working. OS: Ubuntu 24.04The latest snap build package solved the issue \o/
Version: 1.91.0-insider Commit: 6facfe23b300eb448c35d07291cad7ad98625302 Date: 2024-06-07T08:39:45.151Z Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Linux x64 6.8.0-35-generic snap
it worked for me
Or
echo $XDG_SESSION_TYPE.Thanks for the logs, it has been helpful. To recap,
--in-process-gpuworks, got nothing to do with chromium sandbox. By running the gpu stuff in main process we have access to the resource bundle which was previously not accessible that triggered SIGTRAP https://github.com/microsoft/vscode/issues/212494#issuecomment-2151508827I still don’t have luck reproing the issue on my setup (Ubuntu 22.04 on parallels vm). I would like to confirm how things are different for deb package on the same machine. If someone can provide the following logs, it would be helpful
code --verbosecode --enable-tracing="ozone" --trace-startup-file=/tmp/code-deb-trace.log --trace-startup-format=jsonFor the snap package, please check if the crash happens with
code --use-gl=angle --use-angle=swiftshader@deepak1556 yes, the snap still crashes for me with
code --disable-gpu-sandbox@deepak1556 Apologies, I think I gave you bad info in my last comment. I’ve
apt removed the .deb package and now it is crashing withcode --disable-gpu-compositing --disable-gpu --use-gl=swiftshader(code --in-process-gpudoes work)When I run
code --enable-tracing="ozone" --trace-startup-file=/tmp/code-snap-trace.log --trace-startup-format=jsonit crashes but no trace file is produced – maybe it’s crashing too soon before it even starts writing that file?same problem here, but as soon as i plug in an external monitor via HDMI, it works
Having the same issue.
@fr43nk missed that the last working version for you is 1.88.1, then your issue is different from this. I will follow-up in https://github.com/microsoft/vscode/issues/215924
@deepak1556 I tested the latest 1.90.2 but the issue still exists. #215924 The question to me is, what has changed from 1.88.1 to 1.90.2 that this error occurs?
Best regards
snap revert code
works for me, downgrades the version to 1.89.1
version 1.90 -> vscode got crashing version 1.90.1 -> fixed the crashing but ssh extension got super laggy, high cpu utilization on the local host Machine
I disabled auto update in snap. Ubuntu 22.04
Latest update fixed it for me
the latest insider build (0da59bdd, rev 1661) has the crashing issue again. however, the build provided above (9aa9147b8576bff4ac5c40f2c58a553a8171b185) works as intended and without any lag 🎉
(Ubuntu 24.04)
1.90.1 611f9bfce64f25108829dd295f54a6894e87339d x64
Ubuntu 24.04. No crashes, but the CPU usage in idle is humongous. Reverting to revision 159 helped to resolve the issue
@deepak1556 is there a way you could revert the snap package in the snap store/snapcraft to revision 159/v1.89.1 your end for now so snap will do an “automagic” refresh and revert on its own (Edit: I don’t know about reverts being automagic, but at least refresh by default is)? Or would this be a big problem for the pipelines and versioning stuff? People seem to experience the lag and slow down I did with 1.90.1 and probably don’t realize their lag problem could be related to the temporary fix and don’t find out about the recommended revert to 1.89.1. Also, since multi-monitor setups didn’t always have the issue, they might not have experienced the crash with 1.90.0, should they revert to 1.90.0 at their own risk instead?
me too, I updated the newest 1.90.1-1 and still keep crash. I found out that if I didn’t maximize all the windows, then it works fine.
Detailed info in here
Thanks a lot @deepak1556 for the fast reply!
If I understand correctly the 1.90.1 fix just added “–use-gl=angle” and “–use-angle=swiftshader” options while starting VSCode?
Does it move the whole process to CPU? I guess it may be worse for performance because will not utilize my GPU?
Debian package contains the same change in 1.90.1 so if it’s not crashing on 1.90.0 it doesn’t make sense to upgrade?
--in-process-gpuflag worked for me, thanksOS: Ubuntu 22.04
code --use-gl=angle --use-angle=swiftshaderworks for me as well, in the sense that there is no immediate crash. As I said, the same is true forcode --in-process-gpu, but for that one the UI freezes at some point later. Have not found any patterns in “when” it freezes, but I have experienced freezing several times during the day. Have not seen any freezing yet usingcode --use-gl=angle --use-angle=swiftshader, but really just tried it out 2 mins ago.Same issue; it worked by installing the .deb package, as mentioned in the above comments.
Like commented on #214580 , you can use the
--in-process-gpuflag to boot it up. At least for nowhttps://stackoverflow.com/a/78588729/13086128
That works for me – no crash.
ohhh - no, I’m not using that flag.
btw People can verify whether they’re using an X11 or Wayland session using:
loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'Verified
--in-process-gpuresolves the issue for me.@deepak1556 Here are more logs for you … (thanks for working this issue)
Removing the snap build Installing the deb build from the site is working fine. https://code.visualstudio.com/
Crashes under all exemples at 1.9.0.
Here’s the output of
snap run --strace="-o code_strace.log -DD -qq -e trace=file" code ~/example: code_strace.logI tried to repro on Ubuntu 22.04 with both wayland and x11 sessions but unable to trigger the crash unless I force the native wayland backend in the application which is a known different issue (–ozone-platform=wayland). But based on the reports there are users on 22.04 who are also able to repro the issue and the crash dumps so far indicate a crash in the gpu process. So very likely a new gpu driver dependency that we are not shipping with the snap package.
Can users try the following steps and provide the outcome, it will help narrow down the issue.
code --disable-gpucode --use-gl=swiftshadersnap run --strace="-o code_strace.log -DD -qq -e trace=file" codeand attach the output to this issuecode --user-data-dir /tmp/code-1-90After reviewing some of the comments above I did some testing with revision 1644 of the snap.
Using a laptop running Ubuntu 22.04 and an external monitor I found that I can only use Code-Insiders in ‘Join Displays’ mode. Any attempt to run Code-Insiders in a single display mode (using either the built-in or external monitor) results in two applications windows opening and immediately closing. The external monitor was connected via HDMI. Code is usable on this laptop.
On another laptop running Kubuntu 24.04 Code-Insiders opened and closed immediately. It wasn’t possible to connect an external monitor at the time. Code is usable on this laptop.
On a desktop computer running Kubuntu 24.04 I have no problems running Code-Insiders and have done so reliably since I installed Kubuntu on it around a month ago.
… and with unplugin the external monitor, code-insiders crashs
I have installed the latest build from https://code.visualstudio.com/insiders/ and now code-insiders run without crashes…
@Romstar @AndrewSpano till they fix it, i’ll recommend you use vs code release version. it is working.