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 every time at startup with 'Code 5' #184298

Open
martijnburger opened this issue Jun 5, 2023 · 8 comments
Open

Crash every time at startup with 'Code 5' #184298

martijnburger opened this issue Jun 5, 2023 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues

Comments

@martijnburger
Copy link

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

  • VS Code Version: 1.78.2
  • OS Version: macOS Ventura 13.4 (Apple M1 Pro)

Steps to Reproduce:

  1. Startup VSCode in any way.
  2. There are two windows opening, a second window is always opened with the text The editor could not be opened because the file was not found.
  3. A few seconds later the window crashes with: The window terminated unexpectedly (reason: 'crashed', code: '5')
  4. On the second window you can still continue working.

Something along the same lines was also reported in this and users reported that they saw the same issue after the OP reported not seeing the problem anymore.

Copy of closed:
#180916

Attached find the crash report
vscode-crash.zip

@martijnburger
Copy link
Author

Up!

@Marshall-L-D
Copy link

This is happening to me on Mac Ventura 13.4.1 with VS Code:
Version: 1.80.2
Commit: 2ccd690
Date: 2023-07-27T21:05:41.366Z
Electron: 22.3.14
ElectronBuildId: 22695494
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin x64 22.5.0

I attempted to open a large file several days ago. That caused a crash. I closed VS Code and now each time I open VS Code I get the crash with reason code 5. It keeps attempting to load the large file on open. I have the setting "Restore Windows" set to none and always have. The large file no longer exists on my system and still it seems to be attempting to load it on every restart.

@martijnburger
Copy link
Author

Great addition @Marshall-L-D . This is exactly how the issue started on my side too. Let's hope for a quick response from Microsoft.

@Marshall-L-D
Copy link

Got tired of waiting on a fix and since every day my VSCODE startup would attempt to load this old 1.46GB file and crash. I started looking around. Finally found where VSCODE stores its temporary data on Mac, ~/Library/Application Support/Code/.

There was a directory "Backups" containing a numbered directory with a 1.46GB file. I deleted that subdirectory and contents under ~/Library/Application Support/code/Backups/. Now my VSCODE comes up cleanly, no crash.

I hope this helps others who run into this issue.

@deepak1556
Copy link
Collaborator

deepak1556 commented Aug 16, 2023

the workbench process crash due to out of memory when performing TextDecoder.decode(), @rebornix I am not sure how textdecoding kicks in when opening a file, are we processing the entire file into memory for decoding which might explain the memory cap ?

@martijnburger can you provide a minimal repro to help us debug this issue further, thanks!

@deepak1556 deepak1556 added the info-needed Issue requires more information from poster label Aug 16, 2023
@martijnburger
Copy link
Author

  1. Open a file that is too large for VS Code with that memory allocation.
  2. Let VS Code open with more memory allocation.
  3. Let it crash because it is still to large.
  4. Do this on a Apple Silicon Mac.
  5. It will crash everytime at startup looking for this file.

@martijnburger
Copy link
Author

@deepak1556 What is going to happen now?

@deepak1556
Copy link
Collaborator

The issue should be fixed once #167719 gets addressed. We cannot increase the memory cap for the process due to a limitation from the runtime, so a workaround until then would be to use our remote tunnels feature https://code.visualstudio.com/docs/remote/tunnels for viewing the affected files.

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues file-io File I/O and removed info-needed Issue requires more information from poster labels Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues
Projects
None yet
Development

No branches or pull requests

6 participants