Summary
Gortex auto-registers clangd for C/C++ repos and currently launches it with --background-index --header-insertion=never. On a large C/C++ repo, semantic enrichment drives a very large LSP workload through clangd. If the repo has a broad .clang-tidy (bugprone-*, readability-*, clang-analyzer-*, performance-*, etc.), clangd 22.1.6 can repeatedly crash while running clang-tidy matchers. Gortex then reconnects and repeats the work, keeping clangd at high CPU.
Evidence
A daemon log showed:
semantic enrichment starting for lsp-clangd
- clangd argv:
--background-index --header-insertion=never
- repeated crash stack dumps in clang-tidy checks:
bugprone-pointer-arithmetic-on-polymorphic-object
bugprone-not-null-terminated-result
performance-unnecessary-copy-initialization
- one completed clangd enrichment run took ~113 minutes and included tens of thousands of LSP requests.
Proposed fix
For gortex semantic enrichment, default clangd should avoid lint diagnostics and background indexing, e.g. --clang-tidy=false --background-index=false --header-insertion=never -j=1. Gortex needs semantic graph signal, not clang-tidy diagnostics, and should avoid reconnect loops amplifying repeated clangd crashes.
Summary
Gortex auto-registers
clangdfor C/C++ repos and currently launches it with--background-index --header-insertion=never. On a large C/C++ repo, semantic enrichment drives a very large LSP workload through clangd. If the repo has a broad.clang-tidy(bugprone-*,readability-*,clang-analyzer-*,performance-*, etc.), clangd 22.1.6 can repeatedly crash while running clang-tidy matchers. Gortex then reconnects and repeats the work, keeping clangd at high CPU.Evidence
A daemon log showed:
semantic enrichment startingforlsp-clangd--background-index --header-insertion=neverbugprone-pointer-arithmetic-on-polymorphic-objectbugprone-not-null-terminated-resultperformance-unnecessary-copy-initializationProposed fix
For gortex semantic enrichment, default clangd should avoid lint diagnostics and background indexing, e.g.
--clang-tidy=false --background-index=false --header-insertion=never -j=1. Gortex needs semantic graph signal, not clang-tidy diagnostics, and should avoid reconnect loops amplifying repeated clangd crashes.