llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.03k stars 11.58k forks source link

Assertion failure in clangd #109354

Open ilovepi opened 2 hours ago

ilovepi commented 2 hours ago

We're seeing an assertion failure in clangd in Fuchsia code. This code compiles fine, both in release and assert builds, so its a bit surprising. We found this because it was crashing for our developers.

Error :

clangd: /usr/local/google/home/paulkirth/llvm-fork/clang/lib/Serialization/ASTWriterDecl.cpp:1884: void clang::ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *): Assertion `(bool)TC == D->hasTypeConstraint()' failed.\n"

lsp.log

Do we have a guide on how to obtain a reproducer for clangd? is using the preceding compile command to get a preprocessed cpp file sufficient? The Fuchsia build is quite large, and I'm not sure how to provide a nice reproducer that will work w/ clangd.

llvmbot commented 2 hours ago

@llvm/issue-subscribers-clangd

Author: Paul Kirth (ilovepi)

We're seeing an assertion failure in `clangd` in Fuchsia code. This code compiles fine, both in release and assert builds, so its a bit surprising. We found this because it was crashing for our developers. Error : ``` clangd: /usr/local/google/home/paulkirth/llvm-fork/clang/lib/Serialization/ASTWriterDecl.cpp:1884: void clang::ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *): Assertion `(bool)TC == D->hasTypeConstraint()' failed.\n" ``` [lsp.log](https://github.com/user-attachments/files/17067983/lsp.log) Do we have a guide on how to obtain a reproducer for clangd? is using the preceding compile command to get a preprocessed cpp file sufficient? The Fuchsia build is quite large, and I'm not sure how to provide a nice reproducer that will work w/ clangd.
HighCommander4 commented 1 hour ago

You can find some tips at https://clangd.llvm.org/troubleshooting#dealing-with-crashes.

See also https://github.com/llvm/llvm-project/issues/99036 for a previous report of the same assertion failure (but unfortunately no reproducer).

ilovepi commented 1 hour ago

Thanks. I’ll try to repro when I get to work tomorrow.