Vscode-cpptools: Error: Connection to server got closed. Server will not be restarted.

Created on 9 Mar 2019  路  25Comments  路  Source: microsoft/vscode-cpptools

Issue Type: Bug

  1. Clone the WebKit repo.
  2. Generate a compile_commands.json file by starting a compilation with the -DCMAKE_EXPORT_COMPILE_COMMANDS=ON.
  3. Set compileCommands to the path of the compile_commands.json file in .vscode/c_cpp_properties.json.
  4. VS Code should start discovering and parsing files (as seen on the bottom-right of the status bar).
  5. After some time (usually somewhere after 50% done), the error message will be displayed in the Output panel: "Connection to server got closed. Server will not be restarted." After that the C/C++ extension is restarted, and it has to reparse all the files. I don't think it has ever reached 100%.

Extension version: 0.21.0
VS Code version: Code 1.31.1 (1b8e8302e405050205e69b59abb3559592bb9e60, 2019-02-12T02:19:29.629Z)
OS version: Linux x64 4.18.0-16-generic


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 2400)|
|GPU Status|2d_canvas: disabled_software
checker_imaging: disabled_off
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: disabled_off
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
surface_synchronization: disabled_off
video_decode: disabled_software
webgl: disabled_off
webgl2: disabled_off|
|Load (avg)|3, 3, 2|
|Memory (System)|15.43GB (0.92GB free)|
|Process Argv|checkout/WebKit/|
|Screen Reader|no|
|VM|0%|


Language Service bug investigate more info needed reliability

All 25 comments

If there's some more information I can provide, or some debugging steps you'd like me to follow (e.g. to provide a crash dump), please let me know. I couldn't find any additional instructions in the CONTRIBUTING.md file for this repo.

@mlalkaka, your report looks good, and we've tagged it for investigation. Sorry we haven't gotten to it yet as we're putting the finishing touches on the next update.

I have the same problem!

@azertyalex Is your repro with WebKit? Or some other repro steps?

Webkit

This is really breaking for me sometimes. Can I help in any way with the process of fixing this bug?

Any updates on this issue? This is also happening constantly on extension version 0.23.1 with vscode version 1.35.1 - loading a fairly large C++ project causes the "connection got closed" to appear every 5 or so minutes, and before that the CPU usage of Microsoft.VSCode.CPP.Extension.darwin (and some other similar/related processes) is insanely high (~90% CPU usage, and the fan is spinning like crazy on my MacBook Pro 6 core i9 32G). This is definitely making VSCode for C++ dev annoying to use - I was even considering alternatives (e.g. resorting to Xcode).

Please, can anyone raise the priority of this issue? It's a deal breaker!

Getting the same problem, but on Gecko instead of WebKit. No .vscode/c_cpp_properties.json though.

@saschanaz It sounds like our extension process is crashing. Do you have any more repro details?

Experiencing the same issue. (strangely I have the same issue with the clangd 9 plugin)
Any log to check? The C/C++ one does not have any interesting, where can I find the log of the LSP process? (MacOS, running: 0.26 insider build, will downgrade to released version)

@teki if you are using 0.26.0-insiders, you could be hitting #4375. We took down that release and are investigating the crashing issue (we have a repro).

Does not crash anymore, thanks! (Have a different problem now.)

@sean-mcmanus After update to 0.26.0-insiders-2 I got with problem
"Connection to server got closed. Server will not be restarted."
Its happens after several minutes after start and work

And what I should do to vscode-cpptools detect compiler?
I was mentioned what I have Visual Studio Build Tools 2017 installed but vscode-cpptools can not detect it.

My c_pp_properties.json:
{
"configurations": [
{
"name": "Win32",
"configurationProvider": "vector-of-bool.cmake-tools",
"compileCommands": "${workspaceFolder}/waiter/bn/cmake/defaultDebug/default/compile_commands.json"
},
{
"name": "CompileCommands",
"compileCommands": "${workspaceFolder}/waiter/bn/cmake/defaultDebug/default/compile_commands.json",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe",
"cppStandard": "c++17",
"cStandard": "c11",
"defines": [
"BOOST_ALL_NO_LIB",
"BOOST_ENABLE_ASSERT_HANDLER",
"BOOST_FILESYSTEM_DEPRECATED",
"BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS",
"BOOST_MPL_LIMIT_LIST_SIZE=30",
"BOOST_THREAD_USE_DLL",
"BOOST_USE_WINDOWS_H",
"BUILDING_PRESTO_DLL",
"BUILDING_SBIS_PRESTO_MOBILE",
"CURRENT_MODULE_NAME=sbis-presto-mobile",
"NDEBUG",
"NOMINMAX",
"NTDDI_VERSION=0x06000000",
"SBIS_CLANG",
"SBIS_DEBUG",
"SBIS_I686",
"SBIS_RELEASE",
"SBIS_UNIT_TESTS",
"SBIS_USE_WIDE_STRINGS",
"SBIS_WINDOWS",
"UNICODE",
"WIN32",
"WIN32_CLANG",
"WINAPP",
"WINVER=0x0600",
"_ASYNCRT_EXPORT",
"_CRT_NONSTDC_NO_WARNINGS",
"_CRT_SECURE_NO_WARNINGS",
"_ENABLE_ATOMIC_ALIGNMENT_FIX",
"_HAS_AUTO_PTR_ETC=1",
"_ITERATOR_DEBUG_LEVEL=0",
"_NDEBUG",
"_PPLX_EXPORT",
"_SCL_SECURE_NO_WARNINGS",
"_UNICODE",
"_WIN32_WINNT=0x0600",
"_WINDOWS",
"_WINSOCK_DEPRECATED_NO_WARNINGS",
"sbis_presto_mobile_EXPORTS",
"WIN32",
"_WINDOWS",
"EBUG",
"__clang__"
],
"includePath": [
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/sbis-presto-mobile/implementation",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/sbis-presto-mobile",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/test-sbis-presto-mobile/implementation",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/test-sbis-presto-mobile",
"D:/Dev/waiter-controller-2/controller/service-sbis-common/libs/linqcpp/include",
"C:/Program_Files_x86/SBISPlatformSDK_19610/include",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/libs/pplx-lib/include",
"d:/Dev/waiter-controller-2/controller/waiter/bn/cmake/defaultDebug/default/djinni",
"d:/Dev/waiter-controller-2/controller/waiter/bn/cmake/defaultDebug/default/djinni/cpp",
"D:/Dev/waiter-controller-2/controller/rights/sbis-auth-service",
"D:/Dev/waiter-controller-2/controller/service-sbis-common/sbis-mobile-common",
"D:/Dev/waiter-controller-2/controller/service-sbis-pricing/sbis-pricing-mobile",
"C:/Users/mv.kapitonov/.conan/data/boost/1.61.0d/sbis/stable/package/538b615a9784339be9558ce09684b63630891779/include"
]
},
{
"name": "Custom",
"intelliSenseMode": "${default}",
"defines": [
"BOOST_ALL_NO_LIB",
"BOOST_ENABLE_ASSERT_HANDLER",
"BOOST_FILESYSTEM_DEPRECATED",
"BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS",
"BOOST_MPL_LIMIT_LIST_SIZE=30",
"BOOST_THREAD_USE_DLL",
"BOOST_USE_WINDOWS_H",
"BUILDING_PRESTO_DLL",
"BUILDING_SBIS_PRESTO_MOBILE",
"CURRENT_MODULE_NAME=sbis-presto-mobile",
"NDEBUG",
"NOMINMAX",
"NTDDI_VERSION=0x06000000",
"SBIS_CLANG",
"SBIS_DEBUG",
"SBIS_I686",
"SBIS_RELEASE",
"SBIS_UNIT_TESTS",
"SBIS_USE_WIDE_STRINGS",
"SBIS_WINDOWS",
"UNICODE",
"WIN32",
"WIN32_CLANG",
"WINAPP",
"WINVER=0x0600",
"_ASYNCRT_EXPORT",
"_CRT_NONSTDC_NO_WARNINGS",
"_CRT_SECURE_NO_WARNINGS",
"_ENABLE_ATOMIC_ALIGNMENT_FIX",
"_HAS_AUTO_PTR_ETC=1",
"_ITERATOR_DEBUG_LEVEL=0",
"_NDEBUG",
"_PPLX_EXPORT",
"_SCL_SECURE_NO_WARNINGS",
"_UNICODE",
"_WIN32_WINNT=0x0600",
"_WINDOWS",
"_WINSOCK_DEPRECATED_NO_WARNINGS",
"sbis_presto_mobile_EXPORTS",
"WIN32",
"_WINDOWS",
"EBUG",
"__clang__"
],
"includePath": [
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/sbis-presto-mobile/implementation",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/sbis-presto-mobile",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/test-sbis-presto-mobile/implementation",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/test-sbis-presto-mobile",
"D:/Dev/waiter-controller-2/controller/service-sbis-common/libs/linqcpp/include",
"C:/Program_Files_x86/SBISPlatformSDK_19510/include",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/libs/pplx-lib/include",
"d:/Dev/waiter-controller-2/controller/waiter/bn/cmake/defaultDebug/default/djinni",
"d:/Dev/waiter-controller-2/controller/waiter/bn/cmake/defaultDebug/default/djinni/cpp",
"D:/Dev/waiter-controller-2/controller/rights/sbis-auth-service",
"D:/Dev/waiter-controller-2/controller/service-sbis-common/sbis-mobile-common",
"D:/Dev/waiter-controller-2/controller/service-sbis-pricing/sbis-pricing-mobile",
"C:/Users/mv.kapitonov/.conan/data/boost/1.61.0d/sbis/stable/package/538b615a9784339be9558ce09684b63630891779/include"
],
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe",
"cppStandard": "c++17",
"cStandard": "c11"
},
{
"name": "Custom-tests",
"intelliSenseMode": "${default}",
"defines": [
"BOOST_ALL_NO_LIB",
"BOOST_ENABLE_ASSERT_HANDLER",
"BOOST_FILESYSTEM_DEPRECATED",
"BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS",
"BOOST_MPL_LIMIT_LIST_SIZE=30",
"BOOST_THREAD_USE_DLL",
"BOOST_USE_WINDOWS_H",
"BUILDING_PRESTO_DLL",
"BUILDING_SBIS_PRESTO_MOBILE",
"CURRENT_MODULE_NAME=sbis-presto-mobile",
"NDEBUG",
"NOMINMAX",
"NTDDI_VERSION=0x06000000",
"SBIS_CLANG",
"SBIS_DEBUG",
"SBIS_I686",
"SBIS_RELEASE",
"SBIS_UNIT_TESTS",
"SBIS_USE_WIDE_STRINGS",
"SBIS_WINDOWS",
"UNICODE",
"WIN32",
"WIN32_CLANG",
"WINAPP",
"WINVER=0x0600",
"_ASYNCRT_EXPORT",
"_CRT_NONSTDC_NO_WARNINGS",
"_CRT_SECURE_NO_WARNINGS",
"_ENABLE_ATOMIC_ALIGNMENT_FIX",
"_HAS_AUTO_PTR_ETC=1",
"_ITERATOR_DEBUG_LEVEL=0",
"_NDEBUG",
"_PPLX_EXPORT",
"_SCL_SECURE_NO_WARNINGS",
"_UNICODE",
"_WIN32_WINNT=0x0600",
"_WINDOWS",
"_WINSOCK_DEPRECATED_NO_WARNINGS",
"sbis_presto_mobile_EXPORTS",
"WIN32",
"_WINDOWS",
"EBUG",
"__clang__"
],
"includePath": [
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/test-sbis-presto-mobile/implementation",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/test-sbis-presto-mobile",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/sbis-presto-mobile/implementation",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/sbis-presto-mobile",
"D:/Dev/waiter-controller-2/controller/service-sbis-common/libs/linqcpp/include",
"C:/Program_Files_x86/SBISPlatformSDK_19510/include",
"D:/Dev/waiter-controller-2/controller/service-sbis-presto/libs/pplx-lib/include",
"d:/Dev/waiter-controller-2/controller/waiter/bn/cmake/defaultDebug/default/djinni",
"d:/Dev/waiter-controller-2/controller/waiter/bn/cmake/defaultDebug/default/djinni/cpp",
"D:/Dev/waiter-controller-2/controller/rights/sbis-auth-service",
"D:/Dev/waiter-controller-2/controller/service-sbis-common/sbis-mobile-common",
"D:/Dev/waiter-controller-2/controller/service-sbis-pricing/sbis-pricing-mobile",
"C:/Users/mv.kapitonov/.conan/data/boost/1.61.0d/sbis/stable/package/538b615a9784339be9558ce09684b63630891779/include"
],
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe",
"cppStandard": "c++17",
"cStandard": "c11"
}
],
"version": 4
}

@Gargony Other users have reported some sort of memory leak that is leading to a crash, but we're still looking for a way to repro that.

As for configuring with the build tools, did you follow the steps at https://code.visualstudio.com/docs/cpp/config-msvc ?

What do you mean by vscode-cpptools "cannot detect" your compiler? What error are you seeing? What does "C/C++: Log Diagnostics" show?

@Gargony Other users have reported some sort of memory leak that is leading to a crash, but we're still looking for a way to repro that.

As for configuring with the build tools, did you follow the steps at https://code.visualstudio.com/docs/cpp/config-msvc ?

Yes I have the same

What do you mean by vscode-cpptools "cannot detect" your compiler? What error are you seeing? What does "C/C++: Log Diagnostics" show?

I mean this:
vscode-cpptools UI:
image

CMake Tools:
image

@Gargony I created a new issue to track the compiler dropdown missing entries: https://github.com/microsoft/vscode-cpptools/issues/4396 .

Hi @mlalkaka . Are you still experiencing this issue?

I cloned WebKit on Linux x64, successfully built, and configured cpptools to use the generated compile_commands.json. All files were successfully parsed without crashing the extension.

  Parsing: 60831 files(s) processed
Done parsing remaining files.

After relaunching, I'm not seeing it reparse files.

It's possible the root cause has been addressed since you reported the issue. If you are still seeing the problem, please let me know, and we can reopen this. There may be some details we are missing that are needed to repro the issue.

0.26.2 again have a problems with memory leaks

@Gargony Could you file a new issue with more info? What exactly do you mean by "memory leaks"? What process? Is this a regression compared to a previous release?

EDIT: moved to #4714

@sean-mcmanus Yes, it's happens during code write, I get (cpptools:.... )"Connection to server got closed. Server will not be restarted", but I still get this message. And in task explorer I see how "Microsoft.VSCode.CPP.IntelliSense.Msvc.exe" allocate memory and then it up to 4G is closed.
Reproducing steps is not clear. But rollback to 0.26.1 helps until restart the VCCode (I can mistake, need more investigation).
When I got clear steps, I will inform you. I'll try to get the "Microsoft.VSCode.CPP.IntelliSense.Msvc.exe" dump during crush.

My configuration is still the same:
{
"compileCommands": ".../compile_commands.json",
"compilerPath": ".../14.16.27023/bin/Hostx64/x64/cl.exe",
"intelliSenseMode": "msvc-x64",
"cppStandard": "c++17",
"cStandard": "c11",
"defines": [.....],
"includePath": [....].
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}

@sean-mcmanus may be this help

WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
(1460.88ec): C++ EH exception - code e06d7363 (first chance)
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
(1460.7e10): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=062cc044 ebx=0340fb88 ecx=0340fb08 edx=00000000 esi=7fffffff edi=0340fae0
eip=0046d46d esp=0340f90c ebp=0340f978 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
Microsoft_VSCode_CPP_IntelliSense_Msvc!edge::scoped_query_manager::check_and_compile+0x31f:
0046d46d 0fb64008        movzx   eax,byte ptr [eax+8]       ds:002b:062cc04c=??

@Gargony We fixed a high hitting crash with 0.26.0.1 involving "check_and_compile"...if you have 0.26.1 or later, then you could be hitting a less commonly hitting crash with that method. We might need an isolated/sample repro to fix that.

Is the memory usage related to the crash or are they separate issues? What causes the memory to get to 4 GB? Just opening a file? Or does it accumulate as the cursor is moved around the file? Or only after edits?

Was this page helpful?
0 / 5 - 0 ratings