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

Extension crashing #5591

Closed
akbyrd opened this issue Jun 1, 2020 · 41 comments
Closed

Extension crashing #5591

akbyrd opened this issue Jun 1, 2020 · 41 comments
Assignees
Labels
bug Feature: Multi-root Language Service more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one).

Comments

@akbyrd
Copy link

akbyrd commented Jun 1, 2020

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

log.ts:197   ERR An unknown error occurred. Please consult the log for more details.

which I've correlated with the extension issue. When I check exthost.log I see only

[2020-06-01 13:08:21.183] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-06-01 13:08:21.183] [exthost] [error] undefined

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.

{
	"folders": [
		{ "path": "." },

		{ "path": "asdf-1", "name": "------" },
		{ "path": "../project" },
		{ "path": "../project/build/vs2017/premake_generated" },
		{ "path": "../project/build/vs2017/tool_generated" },

		{ "path": "asdf-2", "name": "------" },
	],
}

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
Item Value
CPUs Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz (12 x 3598)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 31.92GB (16.47GB free)
Process Argv
Screen Reader no
VM 0%

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.

@sean-mcmanus
Copy link
Contributor

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?

@akbyrd
Copy link
Author

akbyrd commented Jun 1, 2020

I assume you're getting a crash message in the cpptools logging window.

I am not. The only thing I seem to be able to reliably correlate is An unknown error occurred. The extension just stops working.

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?

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.

@sean-mcmanus
Copy link
Contributor

So you don't see...?
image

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 .

@akbyrd
Copy link
Author

akbyrd commented Jun 1, 2020

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 An unknown error occurred when opening a file and the extension stops working.

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.

@sean-mcmanus
Copy link
Contributor

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).

@sean-mcmanus sean-mcmanus self-assigned this Jun 1, 2020
@sean-mcmanus
Copy link
Contributor

I got the cpptools crash to repro too now.

@akbyrd
Copy link
Author

akbyrd commented Jun 2, 2020

Nice. Do you need me to gather any more information on my end?

@sean-mcmanus
Copy link
Contributor

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.

@sean-mcmanus sean-mcmanus added fixed Check the Milestone for the release in which the fix is or will be available. quick fix labels Jun 3, 2020
@sean-mcmanus
Copy link
Contributor

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 .

@akbyrd
Copy link
Author

akbyrd commented Jun 3, 2020

I fixed the root crash that was happening after the workspace folders were changed

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.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jun 3, 2020

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.

@sean-mcmanus sean-mcmanus removed fixed Check the Milestone for the release in which the fix is or will be available. quick fix reliability labels Jun 3, 2020
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jun 3, 2020

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.

@sean-mcmanus
Copy link
Contributor

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?

@akbyrd
Copy link
Author

akbyrd commented Jun 3, 2020

Help->Toggle Developer Tools->Console would usually show errors.

It reliably shows ERR An unknown error occurred. Please consult the log for more details. when the issue occurs.

try getting rid of the C_Cpp.default.browse.databaseFilename setting

This made no difference. It still gets stuck when using the default database in AppData.

@sean-mcmanus
Copy link
Contributor

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.

@akbyrd
Copy link
Author

akbyrd commented Jun 4, 2020

Is there any way you can provide a repro project without any source code?

I wish, but it's super sensitive to my workspace folders and they contain thousands of files.

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.

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?

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jun 4, 2020

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.

@sean-mcmanus sean-mcmanus removed this from the 0.29.0 milestone Jun 6, 2020
@sean-mcmanus sean-mcmanus added more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one). labels Jun 6, 2020
@sean-mcmanus sean-mcmanus removed their assignment Jun 6, 2020
@midnight-wonderer
Copy link

I think I am in the same situation.
Same message in both exthost.log and developer console.

I am on Linux. (Ubuntu-based distro.)

I can get you stack trace samples from the developer console.

sample1
error (log.ts:197)
error (log.ts:330)
error (log.ts:390)
error (log.ts:390)
handleUnexpectedError (workbench.ts:120)
(anonymous) (workbench.ts:78)
onUnexpectedError (errors.ts:61)
t.onUnexpectedError (errors.ts:80)
(anonymous) (modelServiceImpl.ts:821)
processTicksAndRejections (internal/process/task_queues.js:85)
Promise.then (async)
_fetchDocumentSemanticTokensNow (modelServiceImpl.ts:815)
(anonymous) (modelServiceImpl.ts:745)
doRun (async.ts:651)
onTimeout (async.ts:645)
setTimeout (async)
schedule (async.ts:632)
(anonymous) (modelServiceImpl.ts:752)
(anonymous) (textModel.ts:261)
fire (event.ts:587)
endDeferredEmit (textModel.ts:3311)
pushEditOperations (textModel.ts:1238)
_innerExecuteCommands (cursor.ts:771)
executeCommands (cursor.ts:729)
_executeEditOperation (cursor.ts:446)
(anonymous) (cursor.ts:651)
_executeEdit (cursor.ts:606)
type (cursor.ts:639)
(anonymous) (viewModelImpl.ts:937)
_withViewEventsCollector (viewModelImpl.ts:1004)
_executeCursorEdit (viewModelImpl.ts:923)
type (viewModelImpl.ts:937)
_type (codeEditorWidget.ts:1048)
trigger (codeEditorWidget.ts:992)
runCommand (coreCommands.ts:1894)
handler (editorExtensions.ts:120)
e.handler (commands.ts:89)
invokeFunction (instantiationService.ts:61)
_tryExecuteCommand (commandService.ts:84)
(anonymous) (commandService.ts:73)
Promise.then (async)
executeCommand (commandService.ts:73)
type (codeEditorWidget.ts:1585)
type (viewController.ts:70)
(anonymous) (textAreaHandler.ts:249)
fire (event.ts:587)
(anonymous) (textAreaInput.ts:330)

sample2
error (log.ts:197)
error (log.ts:330)
error (log.ts:390)
error (log.ts:390)
handleUnexpectedError (workbench.ts:120)
(anonymous) (workbench.ts:78)
onUnexpectedError (errors.ts:61)
t.onUnexpectedError (errors.ts:80)
(anonymous) (modelServiceImpl.ts:821)
processTicksAndRejections (internal/process/task_queues.js:85)
Promise.then (async)
_fetchDocumentSemanticTokensNow (modelServiceImpl.ts:815)
(anonymous) (modelServiceImpl.ts:745)
doRun (async.ts:651)
onTimeout (async.ts:645)
setTimeout (async)
schedule (async.ts:632)
(anonymous) (modelServiceImpl.ts:752)
(anonymous) (textModel.ts:261)
fire (event.ts:587)
endDeferredEmit (textModel.ts:3311)
pushEditOperations (textModel.ts:1238)
_innerExecuteCommands (cursor.ts:771)
executeCommands (cursor.ts:729)
_executeEditOperation (cursor.ts:446)
(anonymous) (cursor.ts:693)
_executeEdit (cursor.ts:606)
executeCommands (cursor.ts:692)
(anonymous) (viewModelImpl.ts:952)
_withViewEventsCollector (viewModelImpl.ts:1004)
_executeCursorEdit (viewModelImpl.ts:923)
executeCommands (viewModelImpl.ts:952)
executeCommands (codeEditorWidget.ts:1149)
runCoreEditingCommand (coreCommands.ts:1812)
runEditorCommand (coreCommands.ts:1720)
(anonymous) (editorExtensions.ts:254)
invokeFunction (instantiationService.ts:61)
invokeWithinContext (codeEditorWidget.ts:363)
runCommand (editorExtensions.ts:247)
handler (editorExtensions.ts:104)
invokeFunction (instantiationService.ts:61)
_tryExecuteCommand (commandService.ts:84)
(anonymous) (commandService.ts:73)
Promise.then (async)
executeCommand (commandService.ts:73)
_doDispatch (abstractKeybindingService.ts:200)
_dispatch (abstractKeybindingService.ts:159)
(anonymous) (keybindingService.ts:251)

Plus
My project is relatively small and not super confidential.
My guts tell me that this is related to auto-formatting. (+autoformatting on save) (+auto save)

@lapointexavier
Copy link

lapointexavier commented Sep 17, 2020

Version 1.0.1-insiders: September 16, 2020

Hitting a similar issue on some callback:

[2020-09-17 21:34:00.748] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2020-09-17 21:34:00.750] [exthost] [error] Error: timeout
	at Timeout._onTimeout (/root/.vscode-server/bin/e790b931385d72cf5669fcefc51cdf65990efa5d/out/vs/server/remoteExtensionHostProcess.js:645:266)
	at listOnTimeout (internal/timers.js:531:17)
	at processTimers (internal/timers.js:475:7)
[2020-09-17 21:34:01.305] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2020-09-17 21:34:01.305] [exthost] [error] Error: timeout
	at Timeout._onTimeout (/root/.vscode-server/bin/e790b931385d72cf5669fcefc51cdf65990efa5d/out/vs/server/remoteExtensionHostProcess.js:645:266)
	at listOnTimeout (internal/timers.js:531:17)
	at processTimers (internal/timers.js:475:7)
[2020-09-17 21:34:02.014] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:34:02.014] [exthost] [error] undefined
[2020-09-17 21:34:02.276] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2020-09-17 21:34:02.276] [exthost] [error] Error: timeout
	at Timeout._onTimeout (/root/.vscode-server/bin/e790b931385d72cf5669fcefc51cdf65990efa5d/out/vs/server/remoteExtensionHostProcess.js:645:266)
	at listOnTimeout (internal/timers.js:531:17)
	at processTimers (internal/timers.js:475:7)
[2020-09-17 21:35:00.789] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:35:00.789] [exthost] [error] undefined
[2020-09-17 21:35:00.790] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:35:00.790] [exthost] [error] undefined
[2020-09-17 21:35:00.791] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:35:00.791] [exthost] [error] undefined
[2020-09-17 21:35:08.134] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:35:08.134] [exthost] [error] undefined
[2020-09-17 21:35:08.484] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:35:08.484] [exthost] [error] undefined
[2020-09-17 21:35:08.560] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:35:08.560] [exthost] [error] undefined
[2020-09-17 21:35:20.219] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:35:20.219] [exthost] [error] undefined

....

[2020-09-17 21:40:48.359] [exthost] [error] Error: DisposableStore is missing...
	at U._convertCompletionItem (/root/.vscode-server/bin/e790b931385d72cf5669fcefc51cdf65990efa5d/out/vs/server/remoteExtensionHostProcess.js:749:365)
	at U.resolveCompletionItem (/root/.vscode-server/bin/e790b931385d72cf5669fcefc51cdf65990efa5d/out/vs/server/remoteExtensionHostProcess.js:749:132)
[2020-09-17 21:41:05.249] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:41:05.249] [exthost] [error] undefined
[2020-09-17 21:41:16.311] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:41:16.311] [exthost] [error] undefined

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 17, 2020

@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 ?

@lapointexavier
Copy link

lapointexavier commented Sep 21, 2020

Are you seeing the "Connection to server got closed"?

No unfortunately. I tried attaching to cpptools but it looks like the extension host starts logging these messages:

[2020-09-17 21:41:16.311] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-09-17 21:41:16.311] [exthost] [error] undefined

and cpptools is not crashing. I imagine these error are unrelated then..

@Simran-B
Copy link

Simran-B commented Nov 6, 2020

I'm also getting these messages in Output (logs of extension host).

  • Version: 1.50.1 (user setup)
  • Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
  • Datum: 2020-10-13T15:06:15.712Z
  • Electron: 9.2.1
  • Chrome: 83.0.4103.122
  • Node.js: 12.14.1
  • V8: 8.3.110.13-electron.0
  • Betriebssystem: Windows_NT x64 10.0.19041

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):

[2020-11-05 11:55:35.218] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-11-05 11:55:35.218] [exthost] [error] undefined
[2020-11-05 11:55:35.260] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features {"startup":false,"extensionId":{"value":"vscode.typescript-language-features","_lower":"vscode.typescript-language-features"},"activationEvent":"onLanguage:javascript"}
[2020-11-05 11:55:35.261] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Simran/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/typescript-language-features/dist/extension
[2020-11-05 11:55:35.278] [exthost] [info] ExtensionService#_doActivateExtension vscode.extension-editing {"startup":false,"extensionId":{"value":"vscode.extension-editing","_lower":"vscode.extension-editing"},"activationEvent":"onLanguage:markdown"}
[2020-11-05 11:55:35.279] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Simran/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/extension-editing/dist/extensionEditingMain
[2020-11-05 11:55:35.286] [exthost] [info] ExtensionService#_doActivateExtension vscode.markdown-language-features {"startup":false,"extensionId":{"value":"vscode.markdown-language-features","_lower":"vscode.markdown-language-features"},"activationEvent":"onLanguage:markdown"}
[2020-11-05 11:55:35.287] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Simran/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/markdown-language-features/dist/extension
[2020-11-05 11:55:36.760] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2020-11-05 11:55:36.760] [exthost] [error] Error: timeout
	at Timeout._onTimeout (c:\Users\Simran\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:638:581)
	at listOnTimeout (internal/timers.js:531:17)
	at processTimers (internal/timers.js:475:7)
[2020-11-05 11:55:36.760] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2020-11-05 11:55:36.760] [exthost] [error] Error: timeout
	at Timeout._onTimeout (c:\Users\Simran\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:638:581)
	at listOnTimeout (internal/timers.js:531:17)
	at processTimers (internal/timers.js:475:7)
[2020-11-05 11:55:36.760] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2020-11-05 11:55:36.760] [exthost] [error] Error: timeout
	at Timeout._onTimeout (c:\Users\Simran\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:638:581)
	at listOnTimeout (internal/timers.js:531:17)
	at processTimers (internal/timers.js:475:7)
[2020-11-05 11:55:36.760] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2020-11-05 11:55:36.761] [exthost] [error] Error: timeout
	at Timeout._onTimeout (c:\Users\Simran\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:638:581)
	at listOnTimeout (internal/timers.js:531:17)
	at processTimers (internal/timers.js:475:7)

Here's the call stack if I break on exceptions:

  • Main thread

    ntdll.dll!_NtWaitForSingleObject@12�() (Unbekannte Quelle:0)
    KernelBase.dll!WaitForSingleObjectEx() (Unbekannte Quelle:0)
    KernelBase.dll!GetOverlappedResult() (Unbekannte Quelle:0)
    cpptools-srv.exe!read_pipe_sync(void *,unsigned long,void *) (Unbekannte Quelle:0)
    cpptools-srv.exe!comm_pipe_win32::read(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) (Unbekannte Quelle:0)
    cpptools-srv.exe!comm_server::wait_for_requests(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!_main�() (Unbekannte Quelle:0)
    cpptools-srv.exe!__scrt_common_main_seh() (Unbekannte Quelle:0)
    kernel32.dll!@BaseThreadInitThunk@12�() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart@8�() (Unbekannte Quelle:0)
    
  • 3x ntdll.dll!TppWorkerThread

    ntdll.dll!_NtWaitForWorkViaWorkerFactory@20�() (Unbekannte Quelle:0)
    ntdll.dll!TppWorkerThread() (Unbekannte Quelle:0)
    kernel32.dll!@BaseThreadInitThunk@12�() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart@8�() (Unbekannte Quelle:0)
    
  • 8x cpptools-srv.exe!thread_start<unsigned int(__stdcall*)(void *),1>

    ntdll.dll!_NtWaitForMultipleObjects@20�() (Unbekannte Quelle:0)
    KernelBase.dll!WaitForMultipleObjectsEx() (Unbekannte Quelle:0)
    cpptools-srv.exe!msvc::alertable_event::wait_for_multiple(class msvc::alertable_event * *,unsigned int,bool,unsigned int) (Unbekannte Quelle:0)
    cpptools-srv.exe!msvc::thread_pool::do_work(unsigned int) (Unbekannte Quelle:0)
    cpptools-srv.exe!std::thread::_Invoke<class std::tuple<class <lambda_a0cbe141f7d7ac57b80358412e72d184> >,0>(void *) (Unbekannte Quelle:0)
    cpptools-srv.exe!thread_start<unsigned int (__stdcall*)(void *),1>() (Unbekannte Quelle:0)
    kernel32.dll!@BaseThreadInitThunk@12�() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart@8�() (Unbekannte Quelle:0)
    
  • cpptools-srv.exe!thread_start<unsigned int(__stdcall*)(void *),1>

    ntdll.dll!_NtWaitForSingleObject@12�() (Unbekannte Quelle:0)
    KernelBase.dll!WaitForSingleObjectEx() (Unbekannte Quelle:0)
    cpptools-srv.exe!__Thrd_join�() (Unbekannte Quelle:0)
    cpptools-srv.exe!std::thread::join(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!a_compiler_thread::~a_compiler_thread(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge::an_edge_translation_unit_impl::reinitialize_without_fallback(bool,struct snapshot::snapshot_session_t,struct edge::file_position const &,class edge::query_action_data &) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge::an_edge_translation_unit_impl::reinitialize(bool,struct snapshot::snapshot_session_t,struct edge::file_position const &,class edge::query_action_data &) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge::scoped_query_manager::check_and_compile(struct edge::file_position const &,struct edge::file_position const &,struct edge::file_position const &,bool,bool) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge::scoped_query_manager::update_fragment(struct edge::file_position const &,struct edge::file_position const &,struct edge::file_position const &,bool,bool,bool) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge::an_edge_translation_unit_impl::update_range(struct edge::allocator *,struct snapshot::snapshot_session_t,struct edge::file_position,struct edge::file_position,struct edge::update_range_options const &,struct edge::file_position,struct msvc::strong_typedef_t<struct msvc::offset_traits> *,struct msvc::strong_typedef_t<struct msvc::offset_traits> *,class an_array_list<struct edge::update_range_action *,class std::allocator<struct edge::update_range_action *> > const &,class edge::query_action_data &) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge::translation_unit::update_range(struct edge::allocator *,struct snapshot::snapshot_session_t,struct edge::file_position,struct edge::file_position,struct edge::update_range_options const &,struct edge::file_position,struct msvc::strong_typedef_t<struct msvc::offset_traits> *,struct msvc::strong_typedef_t<struct msvc::offset_traits> *,class an_array_list<struct edge::update_range_action *,class std::allocator<struct edge::update_range_action *> > const &,class edge::query_action_data &) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge_intellisense_server_impl::update_range(char const *,bool,bool,bool,struct snapshot::snapshot_session_t) (Unbekannte Quelle:0)
    cpptools-srv.exe!edge_intellisense_server_impl::handle_update_intellisense(struct microsoft::cpp::intellisense::UpdateIntelliSenseRequest const &) (Unbekannte Quelle:0)
    cpptools-srv.exe!std::_Func_impl_no_alloc<class <lambda_9989b9b68229e91bc44ae358201c3e96>,void>::_Do_call(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!work_queue::worker_proc(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!std::_Func_impl_no_alloc<<lambda_3dc5ec28e79ec858b90655540f6191da>,void>::_Do_call() (Unbekannte Quelle:0)
    cpptools-srv.exe!msvc::thread_pool::do_work(unsigned int) (Unbekannte Quelle:0)
    cpptools-srv.exe!std::thread::_Invoke<class std::tuple<class <lambda_a0cbe141f7d7ac57b80358412e72d184> >,0>(void *) (Unbekannte Quelle:0)
    cpptools-srv.exe!thread_start<unsigned int (__stdcall*)(void *),1>() (Unbekannte Quelle:0)
    kernel32.dll!@BaseThreadInitThunk@12�() (Unbekannte Quelle:0)
    
  • cpptools-srv.exe!thread_start<unsigned int(__stdcall*)(void *),1>

    KernelBase.dll!_RaiseException@16�() (Unbekannte Quelle:0)
    cpptools-srv.exe!__CxxThrowException@8�() (Unbekannte Quelle:0)
    cpptools-srv.exe!cfe_throw(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!exit_compilation(enum an_error_severity) (Unbekannte Quelle:0)
    cpptools-srv.exe!a_compiler_thread::fetch_fragment(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!before_tu_wrapup(void) (Unbekannte Quelle:0)
    cpptools-srv.exe!process_translation_unit(char const *,int,struct an_exported_template_file *) (Unbekannte Quelle:0)
    cpptools-srv.exe!cfe_main(int,char * * const) (Unbekannte Quelle:0)
    cpptools-srv.exe!cfe_main_exception_handler(int,char * * const) (Unbekannte Quelle:0)
    cpptools-srv.exe!edg_main(int,char * * const) (Unbekannte Quelle:0)
    cpptools-srv.exe!invoke_edge_compiler() (Unbekannte Quelle:0)
    cpptools-srv.exe!edge_compiler_main(int,char const * * const) (Unbekannte Quelle:0)
    cpptools-srv.exe!preparse(int,char const * *,class a_scout_store *,class edge::translation_unit *) (Unbekannte Quelle:0)
    cpptools-srv.exe!a_compiler_thread::compiler_thread_routine(class a_compiler_thread *) (Unbekannte Quelle:0)
    cpptools-srv.exe!std::thread::_Invoke<class std::tuple<void (*)(class a_compiler_thread *),class a_compiler_thread *>,0,1>(void *) (Unbekannte Quelle:0)
    cpptools-srv.exe!thread_start<unsigned int (__stdcall*)(void *),1>() (Unbekannte Quelle:0)
    kernel32.dll!@BaseThreadInitThunk@12�() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart() (Unbekannte Quelle:0)
    ntdll.dll!__RtlUserThreadStart@8�() (Unbekannte Quelle:0)
    

In the debugging console I got quite a few WER/CrashAPI:2659: ERROR Invalid args, too big block messages.

In Dev Tools it logs ERR Ein unbekannter Fehler ist aufgetreten. Weitere Details dazu finden Sie im Protokoll. (unknown error occurred)

This is the working copy: git clone https://github.com/arangodb/arangodb
The error occurs when I randomly click on .cpp or .h files in the file explorer, e.g. under arangod > IResearch.
It appears to increase the amount of cpptools-srv.exe:

image

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.

@llilakoblock
Copy link

llilakoblock commented Nov 30, 2020

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.

@sean-mcmanus
Copy link
Contributor

@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.

@llilakoblock
Copy link

@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
Pay attention to find counter and timings. This error appears every 3-5 seconds.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 5, 2020

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.

@Simran-B
Copy link

Simran-B commented Dec 7, 2020

Is this really normal?

[2020-12-07 10:24:04.148] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-12-07 10:24:04.148] [exthost] [error] undefined

image

There's no activity in the cpptools-srv.exe process with PID 19484 for a few seconds, then the two messages in VS Code are logged (after I clicked on a file in the VS Code Explorer) and a few milliseconds later the cpptools-srv.exe process exits with a non-zero status code.

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).

@Colengms
Copy link
Contributor

Colengms commented Dec 7, 2020

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.

@sean-mcmanus
Copy link
Contributor

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.

@github-actions
Copy link

github-actions bot commented Feb 6, 2021

This issue has been closed automatically because it needs more information and has not had recent activity.

@github-actions github-actions bot closed this as completed Feb 6, 2021
@valerioformato
Copy link

valerioformato commented Feb 26, 2021

I am experiencing a very similar behaviour under WSL on a medium-sized C++ project. The "Remote Extension Host" log shows

[2021-02-26 11:33:42.178] [exthost] [error] Error: timeout
	at Timeout._onTimeout (/home/vformato/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4/out/vs/server/remoteExtensionHostProcess.js:86:23647)
	at listOnTimeout (internal/timers.js:549:17)
	at processTimers (internal/timers.js:492:7)

after which intellisense is completely stuck and stop working.
I can't find cpptool in the Output tab, but If I look at the C/C++ extension output after enabling Debug output I don't see anything suspicious. The last line in there is

Queueing IntelliSense update for files in translation unit of: /mnt/f/HERD/software/source/HerdSoftware/src/analysis/algorithms/clustering/SiliconDetectorClusteringAlgo.cpp

after which nothing happens ever again.

I attach with gdb to the cpptools process and the backtrace shows

(gdb) bt
#0  __GI___libc_read (nbytes=512, buf=0x34f1ee0, fd=0) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=0, buf=0x34f1ee0, nbytes=512) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007fc43fd63d1f in _IO_new_file_underflow (fp=0x7fc43febb980 <_IO_2_1_stdin_>) at libioP.h:948
#3  0x00007fc43fd65106 in __GI__IO_default_uflow (fp=0x7fc43febb980 <_IO_2_1_stdin_>) at libioP.h:948
#4  0x00007fc43fd5e678 in _IO_getc (fp=0x7fc43febb980 <_IO_2_1_stdin_>) at getc.c:38
#5  0x0000000000ea3dcd in __gnu_cxx::stdio_sync_filebuf<char, std::char_traits<char> >::underflow() ()
#6  0x0000000000e676ba in std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char) ()
#7  0x000000000071a56c in vscode::message_handler::main_loop() ()
#8  0x0000000000715d28 in main ()

What's the best option? Open a new issue or re-open this one?

Version: 1.53.2 (user setup)
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:48:04.245Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19041

@sean-mcmanus
Copy link
Contributor

@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.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Multi-root Language Service more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one).
Projects
None yet
Development

No branches or pull requests

8 participants