-
Notifications
You must be signed in to change notification settings - Fork 13.4k
clangd - Crash updating the AST #109037
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
Comments
@llvm/issue-subscribers-clangd Author: Ben Gemmill (bgemmill)
Clang 19 from the repository at https://apt.llvm.org
```
$ clang --version
Ubuntu clang version 19.1.0 (++20240903024228+0c641568515a-1~exp1~20240903144250.30)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
```
Crash within clangd analyzing code:
Please let me know what else I should provide |
A symbolized stack trace is a good start, see https://clangd.llvm.org/troubleshooting#getting-stacktraces-from-crashes. If you're able to provide a code example that reproduces the crash, that would be even better. |
The symbolizer does not appear to be in the llvm apt repo, is there a good way to obtain it for the verison of llvm there?
|
The |
Wonder if llvm-symbolizer will help, binaries in llvm apt repo are stripped. Also note that |
Ok, the symbolizer is installed:
But per @vient crashes still seem to show the binary addresses only. I'm going to see if I can isolate the file involved. |
By copying all of the offending headers into a cpp, the crash no longer occurs, but clangd fails to ever complete parsing. This seems to affect programs as simple as The last item in the log that looks interesting is: But then clangd uses 100% cpu and never finishes. RES looks steady, it looks like it would run forever. I'm running clangd with edit: workspaceFolder above is set by vscode, which in turn runs clangd. |
This makes me wonder if the the hang is occurring while indexing standard library headers (clangd has a feature to index these in the background even if you don't include them, so that it can offer auto-complete suggestions even before you included a standard library header). Can you try with a Index:
StandardLibrary: No |
Having this in the workspace root does not seem to have an effect:
While trying to reproduce, I noticed that the clang version in the apt repository changed to Is the issue here that 19.1.0 just hasn't been released yet? |
Yes, Debian CI seems to be very slow. What distro are you on, Ubuntu 24.04? Ubuntu 20.04 still has no 19.1.0-final packages available. |
It's a docker image from ubuntu 24.04.1:
|
Maybe once binary packages are posted to https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.0, using that will allow getting a useful stack trace. Or if the crash occurs with clangd 18 as well, the Linux binary package posted to https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.8 can be used. |
18 from the llvm apt repository does not show this issue, at least this version:
I've moved back to that in the interim and I'll try 19 again when the release happens (or one of you nudges me to try again!) Is there any way to make the symbolizer useful for the version in the apt repository? That version is considerably easier for me to test. |
Binaries in apt repo are stripped of debug information, nothing you can do - if I did not miss anything and there is no |
cc @sylvestre, as point of contact on the apt.llvm.org page, for this question. |
Here's mine
built from source
|
@sandymartel based on the stack trace, your crash is in the A workaround is to disable the check for clangd by adding the following to Diagnostics:
ClangTidy:
Remove: boost-use-ranges If you can reproduce the crash with |
probably, could you please open a new issue for this? thanks |
Trying again today with clangd: I see a different error for the crashes:
Is this the same thing or a new issue? |
Does the crash occur with the |
There's a reduced testcase for the |
I'll dupe this over to #109367 which now has a fix posted. |
Duplicate of #109367 |
@llvm/issue-subscribers-clang-tidy Author: Ben Gemmill (bgemmill)
Clang 19 from the repository at https://apt.llvm.org
```
$ clang --version
Ubuntu clang version 19.1.0 (++20240903024228+0c641568515a-1~exp1~20240903144250.30)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
```
Crash within clangd analyzing code:
Please let me know what else I should provide |
It might be a bit late, but thanks a lot for addressing this. |
Clang 19 from the repository at https://apt.llvm.org
Crash within clangd analyzing code:
Please let me know what else I should provide
The text was updated successfully, but these errors were encountered: