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

The IDE keeps crashing #199960

Open
php4fan opened this issue Dec 4, 2023 · 30 comments
Open

The IDE keeps crashing #199960

php4fan opened this issue Dec 4, 2023 · 30 comments
Assignees
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues linux Issues with VS Code on Linux under-discussion Issue is under discussion for relevance, priority, approach

Comments

@php4fan
Copy link

php4fan commented Dec 4, 2023

I was editing a file and the IDE just crashed.
A popup window showed up saying "Sorry for the inconvenience bla bla bla" and that I could "restart from where I left" or something like that, I don't remember the exact wording.
There was a button that I don't remember whether it was "reopen" or "restore", and I clicked it, but it did NOT relaunch the IDE. I had to relaunch it manually.

Fortunately, most of the unsaved changes I had made to the current file (which got reopened when I manually launched the IDE again) were there, but not exactly everything. The last dozen or so keystrokes were lost.

I wasn't offered any option to upload a crash log or something like that.

What I would expect:

  1. The IDE should never, ever crash in the first place. Stability is the number one priority.
  2. If it does, everything to the very last keystroke must have been saved, and be restored upon restarting
  3. If it says it's going to reopen and offers me a button called "reopen" or "restore", I expect it to restore. Otherwise just tell me that I have to do it myself (but then again, why shouldn't be able to do it?)
  4. When there's a crash, you must indicate me at the very least where I can find a log, hopefully with relevant information about the crash or about what happened just before it, that I can upload here or wherever. Usually, decent software shows a button that automatically sends the relevant logs to the developers. I would be happy with just not having to look for the logs, or the menu option.

If there is some log that I can fetch, let me know so I upload it if it's not too late.

version 1.84.2 on Manjaro Linux

@bpasero
Copy link
Member

bpasero commented Dec 4, 2023

Does this reproduce with some steps? Then there is ways to get a crash dump. Unfortunately there is no way to get a crash dump after the crash without running VS Code in a special way.

@bpasero bpasero added the info-needed Issue requires more information from poster label Dec 4, 2023
@php4fan
Copy link
Author

php4fan commented Dec 4, 2023

Unfortunately there is no way to get a crash dump after the crash without running VS Code in a special way.

Wow. I think you should consider fixing that.

Does this reproduce with some steps?

Unfortunately not. Or should I say fortunately not.

@bpasero
Copy link
Member

bpasero commented Dec 4, 2023

It can be enabled from the command line by passing --crash-reporter-directory=(path to a folder). We automatically upload all crash reports to analyse trends over all users, but that would not help in this case where we want a particular single instance.

If there is no repro, then I believe I cannot be of help for the crash at least.

@RedCMD
Copy link
Contributor

RedCMD commented Dec 5, 2023

I can confirm that the reopen button doesn't work after VSCode crashes

it's pretty easy to get VSCode to hang and crash with bad regex's
in ctrl+F and textmate grammars etc

tho @php4fan didn't say VScode hung for any exteneded period of time before crashing

what language were you coding?
and what extensions do you have installed

@bpasero
Copy link
Member

bpasero commented Dec 5, 2023

@RedCMD on what platform did you see that "Reopen" does not work?

@RedCMD
Copy link
Contributor

RedCMD commented Dec 5, 2023

Windows 11 x64 .zip installation

@bpasero
Copy link
Member

bpasero commented Dec 5, 2023

Please see if you can find any logged output that could help us find the source of the issue:

  • run code --verbose from the command line
  • reproduce the issue
  • attach the log files you find from running the command "Open Logs Folder"

Thanks!

@RedCMD
Copy link
Contributor

RedCMD commented Dec 5, 2023

I just used the same type of regex from #30874
image
VSCode crash 20231205T213153.zip

@bpasero bpasero changed the title VSCode just crashed, the "reopen" button didn't reopen sh**, some changes were lost, and no information about crash log to report Windows: "Reopen" after crash does not work with 1 window opened Dec 5, 2023
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug workbench-window Window management and removed info-needed Issue requires more information from poster labels Dec 5, 2023
@bpasero
Copy link
Member

bpasero commented Dec 5, 2023

I can reproduce, but only when 1 window is opened:

I suspect that when you click "Reopen" with only 1 window open, we first close that window and then probably assume that we need to quit the application.

@bpasero bpasero added the windows VS Code on Windows issues label Dec 5, 2023
@php4fan
Copy link
Author

php4fan commented Dec 5, 2023

In my case it didn't hang before crashing (or if it did it was for a very short time, no more than a couple of seconds). When the popup showed up, I'm almost sure the crashed windows had already vanished. Also, (again I'm almost sure) I had two windows opened when it crashed. I wasn't using Find.

@bpasero
Copy link
Member

bpasero commented Dec 5, 2023

Thanks, I will try in both cases of having 1 or 2 windows open.

As for the part that you lost data: was the file saved or dirty? We keep track of saved states from the "Timeline" view in the explorer, but that requires the file to be saved.

@bpasero bpasero closed this as completed in 56fda32 Dec 5, 2023
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 5, 2023
@php4fan
Copy link
Author

php4fan commented Dec 20, 2023

Now it would be great if you fixed the issue that actually makes VCS crash several times a day.

@bpasero
Copy link
Member

bpasero commented Dec 20, 2023

Would love to, but it requires help from you:

Can you please follow the steps in https://github.com/Microsoft/vscode/wiki/Native-Crash-Issues to get at more details around the crash and attach the result here? Thanks!

@php4fan
Copy link
Author

php4fan commented Dec 20, 2023

Can you please follow the steps in

The thing that I absolutely hate about that is that I need to run VSCode with a command line option. Either I need to run it from a terminal, which is annoying and I'll forget to half of the times, or I need to google how to add the command line option to whatever .desktop file I have somewhere, and find out where it is etc., i.e. a waste of time.

That option should be enabled by default. The very first time that the program crashes without me having foreseen anything, I should be able to find information about the crash (which is what I wanted to do the first time I encountered one of these crashes).

I hope that at the very least, crash reports are being generated and uploaded anyway by default, is that so?

Either way I'll try to do the above because I do want to know what progress is being made.

@bpasero
Copy link
Member

bpasero commented Dec 20, 2023

Yeah I share the concern, and we have a way to solve this by allowing to configure runtime arguments into a file called argv.json in the user home dir. It currently does not allow to set this option but I will see to add it so that you configure this once and then VS Code will store the crash reports to the location you picked.

image

Thanks for trying to reproduce the crash even though its hard currently having to use the CLI option 🙏

@php4fan
Copy link
Author

php4fan commented Jan 4, 2024

Finally two things coincided: that it crashed (that happens a lot) and that I had remembered to launch it from a terminal with the --crash-reporter-directory flag.

Here's the contents of the pending subfolder (the only one that is not empty) within the crash reporter directory.

Hope this contains enough information. The frequency of the crashes is absolutely pathetic.

pending.zip

@php4fan php4fan changed the title Windows: "Reopen" after crash does not work with 1 window opened The IDE keeps crashing Jan 4, 2024
@php4fan
Copy link
Author

php4fan commented Jan 4, 2024

I've edited the title. I suggest to reopen this issue and use it to track the actual crashes, given that the "reopen" button not working is already tracked in another issue.

@VSCodeTriageBot VSCodeTriageBot removed the insiders-released Patch has been released in VS Code Insiders label Jan 4, 2024
@bpasero bpasero assigned deepak1556 and rzhao271 and unassigned bpasero Jan 4, 2024
@bpasero bpasero added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues and removed bug Issue identified by VS Code Team member as probable bug workbench-window Window management labels Jan 4, 2024
@php4fan
Copy link
Author

php4fan commented Jan 4, 2024

Note that I'm observing the crashes on Manjaro Linux, not Windows.

@bpasero bpasero added linux Issues with VS Code on Linux and removed windows VS Code on Windows issues labels Jan 4, 2024
@deepak1556
Copy link
Contributor

Side note: crash dumps are also persisted to the application user data directory, so you can always find them even when running without the --crash-reporter-directory. Run Developer: Open User Data Folder and under Crashpad/completed you should find the relevant files that can be attached to this issue.

@deepak1556
Copy link
Contributor

The attached crash report indicates a crash due to OOM in the workbench, @php4fan please follow the steps below to get additional trace data,

  • Open the application and from command palette run Profiles: Create a Temporary Profile
  • Once new profile is loaded, from command palette run Developer: Toggle Developer Tools
  • In the developer tools choose Memory tab, choose Allocation Sampling under it and click Start
  • Now perform the operations that will lead up to the crash, click on Collect Garbage icon in the developer tools Memory tab a couple of times in between the editor operations
  • Save the trace and attach it to this issue thread

@deepak1556 deepak1556 added the info-needed Issue requires more information from poster label Jan 5, 2024
@php4fan
Copy link
Author

php4fan commented Jan 5, 2024

Now perform the operations that will lead up to the crash,

I don't know of any particular operations that will lead to the crash. It happens randomly as far as I know.
Can I leave the allocation sampling running for hours while I use Code normally?

Side note: crash dumps are also persisted to the application user data directory, so you can always find them even when running without the --crash-reporter-directory.

But are they generated if the crash happens when running without the flag?

@deepak1556
Copy link
Contributor

Can I leave the allocation sampling running for hours while I use Code normally?

It would be better if you can get a reliable repro or pattern to when the crash happens, you can leave the sampler running but it needs to be stopped before the crash since the debugger will auto disconnect when that happens.

But are they generated if the crash happens when running without the flag?

Yes they are generated only when running without the flag, the flag will change the directory for storage so the two are exclusive.

@php4fan
Copy link
Author

php4fan commented Jan 6, 2024

Yes they are generated only when running without the flag, the flag will change the directory for storage so the two are exclusive.

Oh I see, so what did @bpasero mean by:

Unfortunately there is no way to get a crash dump after the crash without running VS Code in a special way.

?
Apparently I misunderstood it as "there is no way to get a crash dump after the crash without running VS Code in a special way" and we wasted a month when I could have got the crash dumps since day one. In fact they seem to be still there, I attach them:
completed.zip

It would be better if you can get a reliable repro or pattern to when the crash happens

Yeah, unfortunately there doesn't seem to be any easily discernible pattern; I don't think I'll be able to find a reliable repro anytime soon.

The instructions for collecting the memory profile are confusing.

  • Now perform the operations that will lead up to the crash, click on Collect Garbage icon in the developer tools Memory tab a couple of times in between the editor operations
  • Save the trace and attach it to this issue thread

How am I supposed to save the trace after Code has crashed?

but it needs to be stopped before the crash

Oh, before it crashes?
So, (assuming I know how to make it crash on purpose), I need to stop "just before", meaning "one step" before I trigger the crash (according to some subdivision of steps), and with the hope that even omitting the very last step that triggers the crash, the profile will still contain useful information?

Anyway, without being able to trigger the crash at will or predict when it will occur, that is not viable.

@php4fan
Copy link
Author

php4fan commented Jan 15, 2024

The crashes continue to happen.

If the crash dumps are not enough to investigate the issue, please let me know what else I can provide that is actually doable, as opposed to what requested in #199960 (comment) which I will not realistically be able to provide during my lifetime.

Please remember that there are no known reproduction steps that I know of and I cannot reproduce the crashes at will, other than using the IDE while doing my job and waiting for a crash to happen.

@deepak1556
Copy link
Contributor

Please check if the crashes happen with our insiders version https://code.visualstudio.com/insiders, use a new profile via Profiles: Create a Temporary Profile to confirm.

@javierdebug
Copy link

Please check if the crashes happen with our insiders version https://code.visualstudio.com/insiders, use a new profile via Profiles: Create a Temporary Profile to confirm.

Hey, I've been experiencing these crashes since last week. I tested with the insider' version, and it also happens. 😢

Version: 1.86.0-insider
Commit: 271fb7fbd599b49a1482ea7284a50b3229317f96
Date: 2024-01-19T05:36:44.367Z
Electron: 27.2.1
ElectronBuildId: 26149897
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 5.15.0-91-generic

@deepak1556
Copy link
Contributor

@javierdebug can you share the crash dumps following the steps in #199960 (comment)

@javierdebug
Copy link

javierdebug commented Jan 23, 2024

@javierdebug can you share the crash dumps following the steps in #199960 (comment)

@deepak1556 I hope this helps to resolve the issue. I don't know how to visualize these files, but I obtained them from that folder. I attached the files from different times the app crashed:

completed.zip

completed-recent.zip

@deepak1556
Copy link
Contributor

@javierdebug thanks for the crash logs, they are different from the current issue. Your scenario is same as #202255, as a next step can you try #202255 (comment)

@VSCodeTriageBot
Copy link
Collaborator

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2024
@deepak1556 deepak1556 reopened this Jan 31, 2024
@deepak1556 deepak1556 added under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues linux Issues with VS Code on Linux under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

7 participants