microsoft / microsoft/vscode-cpptools

language server crash repeatedly probably because of the database file

Aperta
#12,937 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug Language Service reliability
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

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: https://github.com/microsoft/vscode-cpptools/issues/2296#issuecomment-406453073

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il crash durante la navigazione nei file C/C++ e analizzando il messaggio ripetuto “Unable to add file to database” insieme allo stack delle chiamate fornito. Il lavoro è completato quando il server del linguaggio non va più in crash in questo scenario e l’errore del database è stato risolto; nel report non sono identificati né un file sorgente né un test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.