-
Notifications
You must be signed in to change notification settings - Fork 59
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
clangd crashes on trivial constexpr
declaration (windows)
#1672
Comments
Does the crash happen as soon as you open the file containing the variable? Or do you have to perform any particular editor action to trigger the crash? |
Yeah sorry, that would be |
Can you also show the contents of any relevant config files that are present ( (With the default configuration, the include in |
I distilled it down to this same setup, though in a project I'm working on. I've tried to set it up the same (copying my Is there any way I can debug this locally and share some logs, dump etc. (without building all of llvm that is)? |
A few ideas:
For further diagnosis it would be helpful to get a symbolicated backtrace (so it shows where in the code the crash is). I'm not sure how to do that on Windows, maybe someone else who is more familiar with Windows can chime in. |
I'll look into building from source, though isn't it possible to build Anyways, thanks for the suggstions! |
Further digging: If I change line and things move along for a bit, but then in some other part of the codebase it'll do the same |
Just to address this point: no, clangd cannot currently be built standalone, though I've suggested this in #1375. However, even if that were possible, it would not have been very helpful in this case, since the crash is not directly in clangd code, but in clang code invoked by clangd code (in the stack trace you posted, everything above frame 34 is clang code). With a hypothetical standalone build, those frames would be in a prebuilt clang library and so presumably wouldn't be symbolized. That said, it shouldn't be necessary to do a local build to get a symbolized stack trace; having Anyways, it's great for debugging purposes that you have a local build! I'll have a look at your findings and see if I can suggest something to try. |
It looks like, when |
@helmesjo could you try applying the patch at https://reviews.llvm.org/D154471 locally, and see if it fixes the crash for you? |
Thanks for the detailed reply! |
Sure, will do! |
@HighCommander4 |
Could you post the stack please? It should allow us to determine whether it's the same issue cropping up somewhere else, or a different issue. |
|
Thanks. The stack trace suggests underlying issue is the same, i.e. my patch is incomplete. I'll take another crack at it. |
Ok, I believe I found the issue and updated the patch at https://reviews.llvm.org/D154471 to fix it. @helmesjo could you give it another try with the updated version of the patch? |
@HighCommander4 Edit |
Thanks for checking! I submitted the patch for review. |
This was fixed in clangd 17. |
clangd
crashes on thecamera_option_default_value
variable. Interestingly enough, it does not crash if the constant is renamed to (for example)default_value
. Just from playing around it appears to be somewhat related to the length of the line (or name?).Logs
System information
Output of
clangd --version
:Editor/LSP plugin:
Operating system:
Windows 11
The text was updated successfully, but these errors were encountered: