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

Endless loop when computing symbols for toolchain header file #446

Open
jld01 opened this issue Feb 27, 2025 · 3 comments
Open

Endless loop when computing symbols for toolchain header file #446

jld01 opened this issue Feb 27, 2025 · 3 comments

Comments

@jld01
Copy link
Contributor

jld01 commented Feb 27, 2025

Steps to reproduce under PDE using latest cdt-lsp sources from HEAD of main branch:

  1. Create a trivial CMake Core Build hello world project
  2. Build the project
  3. In the Project Explorer view, expand the resource tree under the generated application binary file to view the symbols in one of the toolchain header files (external to the workspace)
  4. Observe the "Computing symbols..." message in the tree:
    Image
  5. Observe high CPU load and an endless stream of messages logged:
!ENTRY org.eclipse.cdt.lsp 4 0 2025-02-27 17:20:03.654
!MESSAGE Cannot fetch elements of translation unit file:/C:/msys64/ucrt64/include/c++/14.2.0/bits/alloc_traits.h

Other information:

$ C:/msys64/ucrt64/bin/clangd  --version
clangd version 19.1.7
Features: windows
Platform: x86_64-w64-windows-gnu
@jonahgraham
Copy link
Member

Confirmed on my Linux machine too. I didn't look as to why it tries repeatedly after initially failing. The error message comes from

if (unit.getFile() != null) {
compileUnit = getCompileUnit(unit.getFile().getLocationURI(), unit.getFile());
} else {
Platform.getLog(getClass()).error("Cannot fetch elements of translation unit " + unit.getElementName()); //$NON-NLS-1$
}

@jonahgraham
Copy link
Member

PS Collapsing the node does stop the background processing AFAICT.

@jld01
Copy link
Contributor Author

jld01 commented Feb 27, 2025

The method org.eclipse.cdt.lsp.internal.ui.navigator.SymbolsManager.getCompileUnitElements(Object) needs enhancing to support ExternalTranslationUnit objects. These objects have a location URI but no IFile.

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

No branches or pull requests

2 participants