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

Language server crashed #11745

Open
borjamunozf opened this issue Nov 30, 2023 · 6 comments
Open

Language server crashed #11745

borjamunozf opened this issue Nov 30, 2023 · 6 comments

Comments

@borjamunozf
Copy link

borjamunozf commented Nov 30, 2023

Environment

  • OS and Version: Windows 10, Ubuntu 22.04, WSL 1.2.5 / 2.0.9
  • VS Code Version: 1.84.2
  • C/C++ Extension Version: Tested with 1.18.5 && 1.19.1
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:

Creating this issue from #10651 discussion.

Company project, private code, complex & huge C++ one.
We get Language Server Crashed. Restarting... in different machines and developers so frequently. This error is easily triggered if we try to execute Show Call Hierarchy, for example, or just hovering in a method name and wait 2-5 minutes. Sometimes we have found that even without doing anything besides opening a file could happen, but not really sure about this last one.

Removing or renaming the c_cpp_properties & reopening the project seems to avoid crashing so easily & frequently.

The file compile_commands.json are huge for all projects in my division: 48MB && ~83000 lines
This file size could trigger other issues, for example is crashing another projects when trying to configure with CMake Tools Extension Issue 3469

  1. Snapshot of things working decently (but some submodules or nested folders seems not working, will be back to this)

imagen

Steps to reproduce:

  1. Snapshot triggering the issue with just hovering in the same function with the c_cpp_properties.json below. In weird ocassions it does not fail, just takes about ~10 minutes and the log shows parsings the files:
Processing folder recursive
Tag parsing file...

imagen

Expected behavior:

  • Language Server works.
  • C/C++ development experience for production & real world projects is neat.

Configuration and Logs

{
            "name": "Linux",
            "includePath": [
                "${default}"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/g++",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "linux-gcc-x64",
            "compileCommands": "${workspaceFolder}/build/Debug/compile_commands.json",
            "configurationProvider": "ms-vscode.cmake-tools"
        }

Enabling output logging to Debug seems to not showing anything meaningful:

    "C_Cpp.loggingLevel": "Debug",
loggingLevel: Debug
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/4015002588
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/4015002588
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/775123808
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4188040991
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/775123808
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4213759766
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4188040991
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1524892023
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4213759766
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/3710730601
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/3710730601
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1524892023
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/3147052370
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1837593162
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/3147052370
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1837593162/1837593162
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'

Other Extensions

No response

Additional context

Cannot reproduce the crash when attaching. It does not stop anywhere, but the extension or process is killed.

@borjamunozf borjamunozf changed the title Language server crash Language server crashed Nov 30, 2023
@sean-mcmanus
Copy link
Contributor

@borjamunozf What does the debug console logging say when "extension or process is killed" -- i.e. what is the signal message that is causing the process to exit? Also, without hitting the crash, are you able to attach and break into the debugger for the cpptools process?

@borjamunozf
Copy link
Author

@borjamunozf What does the debug console logging say when "extension or process is killed" -- i.e. what is the signal message that is causing the process to exit? Also, without hitting the crash, are you able to attach and break into the debugger for the cpptools process?

[Detaching after fork from child process 3689692]
[Detaching after fork from child process 3689693]
[Detaching after fork from child process 3689694]
[Detaching after fork from child process 3689695]
[Detaching after fork from child process 3689696]
[Detaching after fork from child process 3689697]
[Detaching after fork from child process 3689698]
[LWP 3674105 exited]
[LWP 3674107 exited]
[LWP 3674106 exited]
[LWP 3674104 exited]
[LWP 3674103 exited]
[LWP 3674102 exited]
[LWP 3674100 exited]
[LWP 3674099 exited]
[LWP 3674098 exited]
[LWP 3674097 exited]
[LWP 3674096 exited]
[LWP 3674095 exited]
[LWP 3674094 exited]
[LWP 3674093 exited]
[LWP 3674092 exited]
New process 3674091]

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
Debugger has disconnected from the program '/home/borjamf/.vscode-server/extensions/ms-vscode.cpptools-1.19.1-linux-x64/bin/cpptools'.

And then it shows the message of Language server crashed.
Sometimes I'm able to attach and it says something like

New LWP 228881]
[New LWP 228882]
[New LWP 228883]
[New LWP 233149]
0x00007f09b7d500a9 in __stdio_read ()

@sean-mcmanus by the way, if you're up for a call next week (Monday or Tuesday?), I have arranged with my company to allow it.

@bobbrow
Copy link
Member

bobbrow commented Dec 1, 2023

@borjamunozf, can you please send an email to [email protected] and we can arrange a time?

@borjamunozf
Copy link
Author

@borjamunozf, can you please send an email to [email protected] and we can arrange a time?

email rejected: only accepts messages from people in its organization or on its allowed senders list, and your email address isn't on the list

@comio
Copy link

comio commented Dec 5, 2023

I tried to attach with gdb but I also receive the sigkill signal.

the last console output is the following

La configurazione di esplorazione personalizzata è stata ricevuta: {
  "browsePath": [
    ...
    about 1799 include directories
    ...
  ],
  "compilerPath": "/usr/bin/aarch64-linux-gnu-g++",
  "compilerArgs": [],
  "compilerFragments": [
    " -g -ggdb -Wall -Wconversion -Wno-unused-variable -Wno-unused-parameter -Wfatal-errors -Werror  -ffunction-sections -fdata-sections -O0 -Wno-implicit-fallthrough  -fPIC -DBOOST_SYSTEM_NO_DEPRECATED -DCMAKE -DARTEMIDE_REL_1_1 -D_TGT_ENV_ -DPCIE_ACCESS -DSMO_ECFM_WANTED -DCMAKE -MMD -Wno-shadow -Wno-misleading-indentation -Wno-implicit-fallthrough -g -Wall -Wextra -Wno-conversion -Wno-unused -Wno-unused-variable -Wno-unused-parameter -Wfatal-errors -Werror -Wpedantic  -Wzero-as-null-pointer-constant -Wsuggest-override -std=c++17 -Ofast -Wno-pedantic -Wno-conversion -Wno-zero-as-null-pointer-constant -g   -Wno-format -Wno-write-strings -Wno-uninitialized",
    "-std=gnu++17"
  ]
}

My environment is very complex with a lot of directories, libraries and executables.
I can provide the full log if required (but cannot be pasted here).

The cpptools 1.17.5 seems to be the last working release.

@bobbrow
Copy link
Member

bobbrow commented Dec 6, 2023

@borjamunozf - I'm sorry about that. The email address was configured to accept email from external senders, but at some point the membership was consolidated to send to another internal distribution group that had the setting disabled. I believe I have fixed it, but it may take some time to update on the server. To expedite things you can send mail directly to me. Use my GitHub handle and append "@microsoft.com."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants