-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Extension crashing #5591
Comments
The provider failed message is unrelated and can be ignored. I assume you're getting a crash message in the cpptools logging window. I haven't repro the crash yet -- I'm seeing VS Code auto-create the folders that don't exist. Is there some special way to get those separate entries to not exist? |
I am not. The only thing I seem to be able to reliably correlate is
VS Code doesn't auto-create those folders for me. It's a work machine, so perhaps some sort of permission issue. It's going to be hard to repro. I can gather more information on my end if necessary. |
If that's true, then our extension isn't crashing, and you might be hitting a random deadlock that we fixed that was being hit by our multiroot Linux test (the fix for that won't be released till 0.29.0-insiders or 0.28.3), or it's some new issue. If you see the cpptools process still running with the same process id, then that would also be an indication that we're not crashing, and if you do something that should normally cause CPU usage and the cpptools CPU usage is at 0%, that would indicate a deadlock (attaching a debugger and getting the call stacks could help identify if it's the same deadlock we fixed or not). The "undefined" issue is #5487 . |
I do see that error if I modify the workspace while the extension is running, but I don't see it when opening a C++ file. I see I think you're right, it's probably not actually a crash. I think it's still running because I can see that error popping up as I open new files. The extension just gets into a state where nothing works at all, anywhere. |
It sounds like you hit a cpptools crash that put the extension in a non-recoverable state. I still haven't been able to get a crash yet via modifying the workspace, but when I forcibly kill cpptools I'm seeing it give errors and not correctly recovering from the cpptools crash, which is something we should investigate/fix (crash recovery was working previously). |
I got the cpptools crash to repro too now. |
Nice. Do you need me to gather any more information on my end? |
No, I have enough info, thanks for reporting this. The fix won't make 0.28.2 (out in a few minutes), but it should be in the next release. |
I fixed the root crash that was happening after the workspace folders were changed, but there's still a random issue with the language client randomly not recovering correctly after a crash that I'm leaving as a TODO: #5606 . |
I'm a little confused. I don't think that's the core issue? Yes, the extension outright crashes when I modify my workspace file, but the original issue is about that extension not working at all for my specific workspace configuration. I'm not talking about modifying the workspace and then it breaking, I literally cold open vscode, open a C++ file and it doesn't work. You identified the crash when editing the workspace file as a separate, seemingly unrelated issue. |
Ah, okay -- I'm not able to observe a failure without workspace edits. So without any edits, you don't see the "Connection to server got closed"? Do you see cpptools-srv processes launched? Do you see cpptools using CPU at all? Do any C/C++ extension features work? It's possible a dangling cpptools process is locking the database. If you close all VS Code instances, can you make sure no cpptools processes are still running? Also, it sounds like it may be a permissions issue. Are you able to set the C_Cpp.default.browse.path setting to a location that is writable, i.e. if you set it to "${workspaceFolder}/.vscode/vc.db" do you see it populate? It's possible the location that is currently being used is not writable. The multiroot code tries to get settings and c_cpp_properties.json from the correct workspace folder that a source file belongs to, so there could be some bug with that in certain cases, but I may need a sample repro project in order to diagnose what exactly is going wrong. |
Ah, I think I got a repro now after requiring admin privileges to stop the "---" folders from getting created. The symptom I'm seeing is that doing Find All References gets stuck showing the "Find All References..." progress indicator. |
Oh, that issue was just caused by the C_Cpp.default.browse.path being set to a location that required admin privileges, so removing that setting fixed the issue. Is that what you're hitting or is it something else? |
It reliably shows
This made no difference. It still gets stuck when using the default database in AppData. |
I'm out of ideas for diagnosing what is going on (we haven't gotten other reports matching these symptoms yet). Is there any way you can provide a repro project without any source code? Another potential option would be to clone our TypeScript repo at https://github.com/microsoft/vscode-cpptools/tree/release and doing Launch Extension (development) after opening the Extension folder to see if you could find any more info on what failures are occurring (there might be more steps required, not sure, i.e. running yarn install in the Extension folder). Maybe put breakpoints at different lines in https://github.com/microsoft/vscode-cpptools/blob/release/Extension/src/LanguageServer/client.ts#L789 after opening a file to see how far along a document symbol request is able to get. |
I wish, but it's super sensitive to my workspace folders and they contain thousands of files.
After installing a package manager that installs a package manager so I can install package manager I'm able to step through the extension. But I have no idea how to navigate this. That function looks like it just ships off a request. I don't see anything interesting to step through. Do you have more specific places to look? |
If a call to this.client.languageClient.sendRequest gets hit by a breakpoint and stepping over it doesn't throw an exception, that means the TypeScript is successfully able to send the message to cpptools. But if the "then" call back doesn't get called then it means cpptools didn't send a response back. So under normal operations all the lines of provideDocumentSymbols should get hit. If that seems to be the case and you don't see any other additional errors, then the issue is probably not a TypeScript-side issue. |
I think I am in the same situation. I am on Linux. (Ubuntu-based distro.) I can get you stack trace samples from the developer console. sample1 sample2 Plus |
Hitting a similar issue on some callback:
|
@lapointexavier Are you seeing the "Connection to server got closed"? Are you able to get a call stack of the crash https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv ? |
No unfortunately. I tried attaching to cpptools but it looks like the extension host starts logging these messages:
and cpptools is not crashing. I imagine these error are unrelated then.. |
I'm also getting these messages in Output (logs of extension host).
While trying to debug the issue, there were also other messages about a timeout, but possibly unrelated (only got this once, whereas the provider FAILED message occurs way more frequent):
Here's the call stack if I break on exceptions:
In the debugging console I got quite a few In Dev Tools it logs This is the working copy: I also see some of them disappear, sometimes immediately, sometimes after some idle time. The amount doesn't seem to go down to 1 however. |
I can confirm this behavior in latest vscode, and latest cpptools. Its unrelevant to project opened. Opened several projects cloned from github in vscode. Adding any symbols in cpp code, even spaces or tabs - causes continuous errors: Result's in bugged (not full, no new code) intellisense hints, go to definition is not working, bugged code highlighting, continuous windows "Notification" sound (had to disable all windows sounds to continue using vscode), etc. I've read all comments and tried all suggestions were made to @akbyrd and none of them worked. My issue is 100% percent the same. Same dev console log, same behavior, language server running, no cpu/mem consuption, etc. |
@llilakoblock How do you know cpptools is crashing? The error messages in your screenshot don't indicate a crash and normally occurs under normal conditions (it was a VS Code bug). A crash would be indicated by "[Error - 10:51:19 AM] Connection to server got closed. Server will not be restarted." appearing in a log pane named "cpptools". The other symptoms you describe appear more severe than a crash of cpptools and we are not familiar with what could cause that behavior. |
@sean-mcmanus Well, i did not say a word about "crashing" in my comment. I'm just confirming the exact same behavior as described in first comment by @akbyrd except the language server crash, it seem to be running normaly in my case, but... You are saying that this picture is normal behavior? :D |
Yes, those error messages are "expected". Are you seeing any other negative symptoms? @Colengms Do you remember what VS Code issue was tracking that? I didn't see it when I looked for it previously. |
Is this really normal?
There's no activity in the Shouldn't it return 0 in case of a planned termination? Does the non-zero exit status cause the exthost error in the first place? (The timestamps suggest that the error occurs before the process termination however). |
The 'provider failed' message is likely not an error. This is tracked by: microsoft/vscode#93686 The issue is that it's valid to cancel certain types of requests, in order to trigger new requests (with updated information, or against the most recent state of the document). VS Code is currently logging an error in this scenario, despite it not being an error. The plan is for VS Code to add some specific exception types to use when cancelling these operations, which would suppress the error. |
Also, the "provider FAILED" message is unrelated to any potential failures you're seeing with cpptools-srv, i.e. the "provider FAILED" message always occurs, even if there's no cpptools-srv failure. Yeah, cpptools-srv should return 0. -1 should only be returned if cpptools-srv was launched with invalid arguments. At least according to the source code. I haven't checked what Process Monitor shows. |
This issue has been closed automatically because it needs more information and has not had recent activity. |
I am experiencing a very similar behaviour under WSL on a medium-sized C++ project. The "Remote Extension Host" log shows
after which intellisense is completely stuck and stop working.
after which nothing happens ever again. I attach with gdb to the
What's the best option? Open a new issue or re-open this one? Version: 1.53.2 (user setup) |
@valerioformato Yeah, if you're reproing the issue with the latest version (https://github.com/microsoft/vscode-cpptools/releases/tag/1.2.2) then open a new issue, although it sounds like we may need more repro info. |
Issue Type: Bug
I'm having hard time tracking this one down. For weeks I've had no intellisense, go to definition etc. When I view the developer console I see
which I've correlated with the extension issue. When I check exthost.log I see only
What I've been able to narrow down is that it's related to folders in the workspace. As I add more folders it eventually starts crashing. It seems inconsistent about which folders cause the problem, so maybe it's something to do with the overall size of the workspace?
I've tried to reduce the workspace file to the minimum repro, but this is as far as I can get it. Remove any project causes the issues to stop appearing.
Note that the asdf folders don't actually exist. They're used a separators in the Explorer.
Extension version: 0.28.1
VS Code version: Code - Insiders 1.46.0-insider (2c1871d538c64df71af4902deba47d7fa4b53f27, 2020-06-01T10:34:11.096Z)
OS version: Windows_NT x64 10.0.18363
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
EDIT: I think it has something to do with those dummy separator folders. In my non-insiders installation with all my extensions and what not I have to eliminate everything but a single folder and the separators before it stops crashing. But if I leave all folders enabled and remove only the separators it also stops crashing. It also stops if I create those folders.
The text was updated successfully, but these errors were encountered: