Visual Studio Code crashes with [...ERROR:process_memory_range.cc(75)] read out of range
Asked Answered
P

7

86

I am using an Ubuntu machine and when I open Visual Studio Code, it opens for a second or so and then crashes. When starting Visual Studio Code (executable code) through the terminal with the command code --verbose, I get the following error.

[19814:0606/134456.415221:ERROR:gpu_process_host.cc(993)] GPU process exited unexpectedly: exit_code=133
[19814:0606/134456.415235:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 6 time(s)
[19814:0606/134456.415243:FATAL:gpu_data_manager_impl_private.cc(448)] GPU process isn't usable. Goodbye.
[0606/134456.419486:ERROR:process_memory_range.cc(75)] read out of range
[0606/134456.419494:ERROR:process_memory_range.cc(75)] read out of range
...

Here is part of the error message.

I also tried to remove code and reinstall it. But I still get an error. How I can fix this?

To remove, I used sudo snap remove vscode & cd ~ && rm -rf .vscode && rm -rf .config/Code.

Phallicism answered 6/6 at 5:26 Comment(2)
What is the gist of it? Did Microsoft release a new version of Visual Studio Code that broke something (it wouldn't be the first time)? None of the answers explain why it happened.Hashimoto
@PeterMortensen Yes, Microsoft released a version that apparently only broke the snap version: github.com/microsoft/vscode/issues/212494Lauricelaurie
Z
83

There are solutions: Visual Studio Code crashes at startup with 1.86 version on Ubuntu 22.04 #204159

This one worked for me:

sudo snap revert code --revision 159
Zavala answered 6/6 at 9:37 Comment(6)
I had the same issue on 24.04 LTS after this morning's update; reverting helped me as well.Garnet
Exact same issue on Ubuntu 22.04 LTS after this morning update. Reverting solved it for me too.Tocsin
when i do that comand i receivethese output : ` error: cannot revert "code": cannot find revision 159 for snap "code" `Hest
It helped, I was getting this error in the morning "[9383:0607/104742.040850:ERROR:gpu_process_host.cc(993)] GPU process exited unexpectedly: exit_code=133 [9383:0607/104742.040892:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 6 time(s) [9383:0607/104742.040911:FATAL:gpu_data_manager_impl_private.cc(448)] GPU process isn't usable. Goodbye. "Occlude
Worked perfectly, was wondering why the error came up this morning despite using it yesterdayOrthicon
Same symptom, same solution: on my Xubuntu 23.10, code rev 160 does not start, rev 159 works.Latakia
L
81

There isn't any need to reinstall or downgrade. Using this workaround worked for me (tested on Ubuntu 22.04.4 LTS):

code --in-process-gpu

Why does this workaround work?

I'm not an expert in Electron/Chromium, so I'm quoting this comment:

  • Issue only affects snap on x11 backend in the application

  • --in-process-gpu works, 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 1.90 snap package crash on startup #212494 (comment)

  • Nothing changed around the crash callsite in Electron 29 update but theory is that we are initializing a gl backend only on snap that is exercising this problematic code path.

Lauricelaurie answered 6/6 at 14:20 Comment(9)
Why does it work? What is the idea? What is the theory of operation? Perhaps link to official documentation for "--in-process-gpu". Please respond by editing (changing) your answer, not here in comments (but *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** without *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** "Edit:", "Update:", or similar - the answer should appear as if it was written right now).Hashimoto
What system was it tested on?Hashimoto
There is a reference, but answers on Stack Overflow should be self-contained.Hashimoto
Works like a charm. I hope this gets forwarded to the VS-Code devs, so they can fix this ASAPLander
@AndreasP. A fix will be shipped next week: github.com/microsoft/vscode/issues/…Lauricelaurie
This works for me on arch linux and vscode 1.90Pappose
I can also confirm that this works with Ubuntu 22.04.4 LTS running on x11 and vscode 1.90.Photopia
genius! i just got this error after update some apps in ubuntu... still crashing after opening it once like this, any solution?Heritor
I assume this message is normal? Warning: 'in-process-gpu' is not in the list of known options, but still passed to Electron/Chromium.Beccafico
I
17

This solved the problem for me

sudo snap revert code

I found the solution here

Intendment answered 6/6 at 9:23 Comment(1)
The especially nice thing about this solution is that it will move back to the last state, and not update. But then once a newer version is available than the one that you reverted from, it will move to that newer one. (At least that's what the link says.) Seems like a perfect, elegant solution.Roswell
M
4

If someone, deleted VSCode using snap and unable to go back to a revision, It worked for me try using

sudo snap install --revision 159 --classic code 
Margaux answered 7/6 at 3:27 Comment(0)
W
3

After hours of trying to run 1.90 on Ubuntu 22.04 (Jammy Jellyfish), I just replaced it with the previous version (1.89):

  1. downloaded it here: https://code.visualstudio.com/updates/v1_89

  2. then in terminal

    sudo snap install --classic ./code-stable-x64-1715063598.snap
    

and now it works fine.

I couldn't use sudo snap revert code, because in one of the iterations I executed sudo snap remove --purge code ;-(

The actual snap link for v. 1.89 is https://update.code.visualstudio.com/1.89.1/linux-snap-x64/stable

Wilbert answered 6/6 at 14:1 Comment(0)
Z
1

I had installed vscode from app center (snap). So I uninstall vscode from app center. then

rm -r $HOME/.config/Code
rm -r ~/.vscode

https://code.visualstudio.com/docs/setup/uninstall#_clean-uninstall

installed vscode deb package downloaded from vscode official website https://code.visualstudio.com/download

sudo apt install [downloadedfile.deb]
Zebulun answered 7/6 at 6:11 Comment(0)
B
0

The following seems to work for me:

  • Uninstall snap package sudo snap remove --purge code
  • Install rpm package: sudo dnf localinstall [PATH_TO_DOWNLOADED_RPM]

The RPM can be downloaded from here

It could be a snap-related problem

Bosnia answered 6/6 at 6:0 Comment(1)
Suggesting that people use an RPM to manage a package seems like a last resort kind of solution. Snap and apt are the standard Ubuntu package management tools. I'd recommend trying to solve the problem with standard tools before resorting to exotic solutions. -- I posted this comment instead of down-voting since you're new.Quarrel

© 2022 - 2024 — McMap. All rights reserved.