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 crash repeatedly probably because of the database file #12937

Open
Mipsters opened this issue Nov 6, 2024 · 5 comments
Open

Comments

@Mipsters
Copy link

Mipsters commented Nov 6, 2024

Environment

  • OS and Version: macOS Sequoia 15.1
  • VS Code Version: 1.95.1 (Universal) Commit: 65edc4939843c90c34d61f4ce11704f09d3e5cb6
  • C/C++ Extension Version: v1.22.11
  • If using SSH remote, specify OS of remote machine: Ubuntu 22.04.4 LTS

Bug Summary and Steps to Reproduce

Bug Summary:
language server crashes

Steps to reproduce:

  1. it reproduces randomly while going through c/cpp files in the project

Expected behavior:
language server doesn't crash

the issue is averted if following these instructions and changing the value of databaseFilename: #2296 (comment)

Configuration and Logs

Debug logs:
this lines repeats a lot, can't share more because of company policy

Unable to add file to database, error = 0x8064000b: ...

crash call stack:

browse_engine::query_translation_unit_source(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*) (Unknown Source:0)
intellisense_client_manager::find_existing_intellisense_client(msvc::locked_object<intellisense_client_manager::maps, std::recursive_mutex, std::unique_lock> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool, bool&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, bool&, bool&) (Unknown Source:0)
intellisense_client_manager::acquire_intellisense_client(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, acquire_intellisense_client_options const&, std::function<void (intellisense_client_reference&&)>&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::function<bool ()> const&)::{lambda()#2}::operator()() (Unknown Source:0)
msvc::thread_manager_t::do_work(unsigned int) (Unknown Source:0)
msvc::thread_helper_t::thread_entry(void*) (Unknown Source:0)
libc.so!start (Unknown Source:0)
libc.so!__clone (Unknown Source:0)
[Unknown/Just-In-Time compiled code] (Unknown Source:0)

partial content of ~/.vscode-server/data/Machine/settings.json
some values redacted

{
    // ...
    "C_Cpp.default.compilerPath": "/usr/bin/gcc",
    "C_Cpp.default.cStandard": "gnu17",
    "C_Cpp.default.cppStandard": "gnu++17",
    "C_Cpp.default.defines": ["<PROJECT_SPECIFIC_DEFINE>"],
    "C_Cpp.default.includePath": [
        "${env:HOME}/<SOME_SDK_PATH>",
        "${env:HOME}/<SOME_SDK_PATH>/include",
        "${workspaceFolder}/**",
        "${workspaceFolder}/include",
        "${workspaceFolder}/src",
        // 40 lines of different folders under ${workspaceFolder}
    ],
    "C_Cpp.default.forcedInclude": [
        // 4 .h files from some includes under ${workspaceFolder}
    ],

Other Extensions

No response

Additional context

No response

@sean-mcmanus
Copy link
Collaborator

@Mipsters Are you opening the same workspace (with the same database) in multiple VS Code instances or is there a dangling cpptools process running (when VS Code has not loaded a workspace).

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Nov 6, 2024

@Mipsters Also, does it stop crashing after you run the C/C++: Reset IntelliSense Database command from the command palette? You should get a success notification if the reset was successful.

@Mipsters
Copy link
Author

Mipsters commented Nov 7, 2024

@sean-mcmanus

Are you opening the same workspace (with the same database) in multiple VS Code instances

Seldom, but it occurs also when there is only one instance

is there a dangling cpptools process running (when VS Code has not loaded a workspace

I don't think so, if you are talking about the cpptools process it doesn't seem like it

does it stop crashing after you run the C/C++: Reset IntelliSense Database command

Not sure, I'll try to reproduce it and check, but it may be a while

@sean-mcmanus
Copy link
Collaborator

@Mipsters Also, 1.23.0 has some crash fixes and 1.23.1 (pending release today) has more crash fixes, but we don't know yet if it fixes this particular crash.

@sean-mcmanus
Copy link
Collaborator

@Mipsters Also, I've seen Unable to add file to database, error = 0x8064000b: ... but I'm not certain if it causes a bug or if it's related to the crash. The crashing call stack acquire_intellisense_client is when you open a new file or something triggers an IntelliSense process to be started and query_translation_unit_source is querying the database to find which source file to use for a header, so it seems like your repro may require opening some header, maybe when the database is doing some other work (maybe scanning the workspace for files not in the database).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants