gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
8.96k stars 1.3k forks source link

VS Code hangs with GitLens on Ubuntu 24.04 #3319

Open anatoli26 opened 4 months ago

anatoli26 commented 4 months ago

Description

On a fresh Ubuntu 24.04 under a new user VS Code works well, but when installed GitLens (no other extension installed, nor any config changes made), after a restart it just hangs after some 3 seconds and a popup to Force Quite the app appears.

GitLens Version

15.0.4

VS Code Version

Version: 1.89.1 Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:16:23.416Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 6.8.0-31-generic snap

Git Version

git version 2.43.0

Logs, Screenshots, Screen Captures, etc

No response

eamodio commented 4 months ago

Can you please enable debug logging by running the GitLens: Enable Debug Logging command from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens & GitLens (Git) channels in the Output pane.

Once enabled, please reproduce the issue, and attach the logs from the GitLens and GitLens (Git) channels.

Thank you!

github-actions[bot] commented 3 months ago

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

anatoli26 commented 3 months ago

Can't reproduce it anymore with GitLens 15.1.0.

By the way, just in case the problem appears again, where the debug log gets written? I mean, the issue was that the entire vscode was freezing/hanging a few seconds after start, so I guess there would be no way to see anything inside the UI.

jkelroy commented 3 months ago

@anatoli26 you should be able to see the path of the log by opening the output in the editor

Screenshot 2024-06-26 at 6 31 04 PM

lampslave commented 2 months ago

изображение It regularly happens for "search and compare". Ubuntu 24.04, Gnome, Wayland.

Version: 1.91.1 Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:08:12.169Z (1 wk ago) Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.91.1 Chrome/122.0.6261.156 Electron/29.4.0 Safari/537.36

GitLens — Git supercharged v15.2.0

lampslave commented 2 months ago

gitlens.log "Keep waiting" was pressed two times before log was copied.

nithinpgit commented 1 month ago

image

after installing gitlense unable to use vs studio code. it crashing immediately so unable to remove extension

lowkin18 commented 3 weeks ago

have same issue as nithinpgit, fresh install of ubuntu 24.04 and vscode will be bricked after installing gitlens

eamodio commented 3 weeks ago

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug.

It would be great if someone who can reproduce this could open an issue on the VS Code repository.

Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not.

Does this happen with any other extensions?

phhkhuong18i1 commented 2 weeks ago

VScode is not responding after install gitlen extensions

abhijit-baldawa commented 2 weeks ago

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug.

It would be great if someone who can reproduce this could open an issue on the VS Code repository.

Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not.

Does this happen with any other extensions?

On macos, After disabling the gitlense extension VS code works perfectly fine but when gitlense is enabled VS code completely hangs and cannot to anything ex: "search", "intellisense", "code completion", "file save" etc. nothing works and is hanged.

AlexMCon commented 1 week ago

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug.

It would be great if someone who can reproduce this could open an issue on the VS Code repository.

Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not.

Does this happen with any other extensions?

None of the other extensions triggered this. The last one that worked (tried jumping from each major version to the next, then mediums) was 11.7.0.

Copilot apparently does the same.

L.E. After reinstalling using the downloaded package and relogging in the user, both extensions worked for me. (not crashing anymore, didn't test yet)

abhijit-baldawa commented 6 days ago

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug. It would be great if someone who can reproduce this could open an issue on the VS Code repository. Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not. Does this happen with any other extensions?

None of the other extensions triggered this. The last one that worked (tried jumping from each major version to the next, then mediums) was 11.7.0.

Copilot apparently does the same.

L.E. After reinstalling using the downloaded package and relogging in the user, both extensions worked for me. (not crashing anymore, didn't test yet)

Yes, no other extension does this. @eamodio I debugged VS code for this and I found how gitlense completely blocks VS code from functioning (no autocomplete, no formatting, not able to save the file nothing).

1] Go to Help -> Open process explorer 2] extensionHost[1] -> This utilizes 100% CPU and is displayed there. I also opened mac activity monitor and confirmed that it was indeed using the full 100% of the CPU core (I have M3 mac pro, so its 12 core cpu and one core was fully blocked here)

Now, once I disabled gitlense, the extensionHost[1] CPU usage immediately went down (almost 0%) and VS code started working right away. All of my team mates (6 people) faced the exact same issue on VS code (Mac/Windows everywhere). They all disabled gitlense and their VS code also immediately started work again.

Honestly, it is a bummer as we all were using gitlense but now we cannot use it in our VS code anymore till it is fixed. Is it possible for you to share if the Gitlense core team is planning to fix it?

eamodio commented 6 days ago

@abhijit-baldawa We are unable to reproduce this and really need more help trying to get to the bottom of it.

Can you provide logs or details as to the other OS's up until now we've only heard this on Ubuntu. Does this happen all the time, only when you open specific repos, or? Are you using other extensions, remote, etc? Can you try in isolation?

abhijit-baldawa commented 6 days ago

@abhijit-baldawa We are unable to reproduce this and really need more help trying to get to the bottom of it.

Can you provide logs or details as to the other OS's up until now we've only heard this on Ubuntu. Does this happen all the time, only when you open specific repos, or? Are you using other extensions, remote, etc? Can you try in isolation?

Thanks for responding. Below are the answers to your questions. 1] Dev's in my team are using Mac and window's (I am on macos).

2] It happens every single time the moment VS code is opened with any TS file (or just within 10 seconds of interacting in VS code like opening any TS file or performing search/git or any operation in IDE). This is not a corner case.

3] I tried VS code with only gitlense installed and every other plugin completely disabled (or even uninstalled). The moment gitlense is enabled VS code does not work and the moment gitlense is disabled everything else in VS code works. If i just disable gitlense and enable every other plugin, VS code works fine. The problem occurs only when gitlense is enabled. You can switch files but as I said, no autocomplete, no git marker of any changed lines, no search, no code jumping nothing works. The only thing works is you can switch between files.

Regarding your question on logs, I don't know which logs you want and how to collect them. I just shared that when gitlense is enabled the extensionHost[1] shows 100% cpu utilization and the moment it is disabled then the CPU utilization goes down completely. This highlights that gitlense is either completely blocking the plugins host of VS code or, in-between VS code and gitlense communication, VS code extensionHost is being blocked by VS code due to improper communication from gitlense side. I have no idea about the internals of vs code and how it interacts with the plugins. Maybe this helps and let me know which logs you may potentially need.

eamodio commented 4 days ago

So if you clone the GitLens repo to a normal folder on your disk, and then open that folder in VS Code, GitLens will cause VS Code to hang? There HAS to be something unique/special here -- is there anything else unique about your machine/setup?

What version of Git do you have installed? Do you have any anti-virus or other security software installed?

abhijit-baldawa commented 4 days ago

So if you clone the GitLens repo to a normal folder on your disk, and then open that folder in VS Code, GitLens will cause VS Code to hang? There HAS to be something unique/special here -- is there anything else unique about your machine/setup?

What version of Git do you have installed? Do you have any anti-virus or other security software installed?

1] No it doesn't happen on all repos. So, if I clone the gitlense repo to a normal folder and open in VS codr then gitlense will not cause hangup

2] Recently we merged a BIG PR from one of our feature branch to main branch and only after that gitlense grinds VS code to a halt (as I have explained in few of my previous comments). Only in that repo do we see this problem on EVERY dev VS code (installed on windows/mac etc.). The Irony is that the feature branch NEVER gave any issue with gitlense either but only after the merge with the main branch, gitlense seems to be struggling on the main branch for all dev's. As soon as we open our main repo in vs code in any dev's computer, gitlense grinds vs code to a halt. We now all have disabled gitlense and only after that VS code is perfectly working fine on all dev's computers.

3] I somehow captured the attached gitlense logs last time and today as well but it contains personal information about the computer details/folder and our organisation github repos. So, I cannot share it here.

4] Git version on my mac git version 2.39.3 (Apple Git-146)

5] No antivirus software or anything. As I said after the merge of a big PR to the main branch, gitlense started giving problems and disabling it was the only solution to make vscode work properly.

I hope I have provided you all the information you need. Let me know if you need anything.

eamodio commented 4 days ago

Unfortunately not, without out logs or having access to the repository we don't have anything to go on.

Not sure if it will work/help or not, but could also try profiling the extension host with all other extensions disabled: https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

abhijit-baldawa commented 3 days ago

Unfortunately not, without out logs or having access to the repository we don't have anything to go on.

Not sure if it will work/help or not, but could also try profiling the extension host with all other extensions disabled: https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

I hope you understand that attaching log file with my computer private details and our organization's repo's on a publicly accessible github page is not a good idea. I can share the logs on a private channel ex. via email or other channel that are more private if that is a possibility.

https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

Thanks for sharing this information but I have already used this link to go too deep into profiling, using extension bisect and even have CPU logs and create flame charts out of it. But clearly this issue is caused because of gitlense so those vscode logs are not of much use. VS Code teams suggest addressing these issues directly with the plugin creators since this is clearly not a problem with VS Code internals; therefore, those logs are not very helpful.

But, I do have full gitlense logs and I can share that via a more private channel. let me know.

eamodio commented 3 days ago

Reference this issue and send the logs here: https://help.gitkraken.com/gitlens/gl-contact-support/?product_s_=GitLens

As for the profiling, you didn't send us the profile. It captures the extension host process which is running GitLens, so it should allow us some incites into what is going on/stuck.