| Issue |
114955
|
| Summary |
Clangd crashes while parsing C++ header file
|
| Labels |
|
| Assignees |
|
| Reporter |
SebastienBini
|
Clangd crashes while reading a header file containing templates and require clauses. Here are the provided logs:
```
I[09:38:06.922] Built preamble of size 16445280 for file /remote/users/sbini/si/common/include/si/common/Notifier.h version 1 in 1.61 seconds
I[09:38:06.923] --> workspace/semanticTokens/refresh(1)
I[09:38:06.924] Indexing c++23 standard library in the context of /remote/users/sbini/si/common/include/si/common/Notifier.h
I[09:38:06.924] <-- reply(1)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. /remote/users/sbini/si/common/include/si/common/Notifier.h:238:1: current parser token '{'
1. /remote/users/sbini/si/common/include/si/common/Notifier.h:22:1: parsing namespace 'si'
#0 0x00007fa24560469b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libLLVM.so.18.1+0x7df69b)
#1 0x00007fa245601c9b (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libLLVM.so.18.1+0x7dcc9b)
#2 0x00007fa24492be40 __restore_rt libc_sigaction.c:0:0
#3 0x00007fa24a447f6e clang::TemplateArgument::isPackExpansion() const (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x116bf6e)
#4 0x00007fa24afcfc3e (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1cf3c3e)
#5 0x00007fa24aff4017 (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1d18017)
#6 0x00007fa24affa24e (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1d1e24e)
#7 0x00007fa24affdd65 (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1d21d65)
#8 0x00007fa24affe78b (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1d2278b)
#9 0x00007fa24afef1ad clang::Sema::SubstConstraintExprWithoutSatisfaction(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1d131ad)
#10 0x00007fa24a84d4ac (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x15714ac)
#11 0x00007fa24a84fb9f clang::Sema::AreConstraintExpressionsEqual(clang::NamedDecl const*, clang::Expr const*, clang::Sema::TemplateCompareNewDeclInfo const&, clang::Expr const*) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1573b9f)
#12 0x00007fa24aec0f88 clang::Sema::TemplateParameterListsAreEqual(clang::Sema::TemplateCompareNewDeclInfo const&, clang::TemplateParameterList*, clang::NamedDecl const*, clang::TemplateParameterList*, bool, clang::Sema::TemplateParameterListEqualKind, clang::SourceLocation) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1be4f88)
#13 0x00007fa24adf351e (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1b1751e)
#14 0x00007fa24adf3fb9 clang::Sema::CheckOverload(clang::Scope*, clang::FunctionDecl*, clang::LookupResult const&, clang::NamedDecl*&, bool) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1b17fb9)
#15 0x00007fa24a90fa6b clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*, clang::LookupResult&, bool, bool) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1633a6b)
#16 0x00007fa24a91ed72 clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x1642d72)
#17 0x00007fa24a9209e9 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x16449e9)
#18 0x00007fa24a9212e5 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Sema::SkipBodyInfo*, clang::Sema::FnBodyKind) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x16452e5)
#19 0x00007fa249ecf18e clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbf318e)
#20 0x00007fa249eb5af7 clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbd9af7)
#21 0x00007fa249ebd2dc clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbe12dc)
#22 0x00007fa249ebd507 clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbe1507)
#23 0x00007fa249df8c66 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xb1cc66)
#24 0x00007fa249ed0dfc clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbf4dfc)
#25 0x00007fa249e0e634 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xb32634)
#26 0x00007fa249e0e528 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xb32528)
#27 0x00007fa249e122cf clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xb362cf)
#28 0x00007fa249df8e58 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xb1ce58)
#29 0x00007fa249ed0dfc clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbf4dfc)
#30 0x00007fa249ed2665 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbf6665)
#31 0x00007fa249ed2b2f clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xbf6b2f)
#32 0x00007fa249dc86db clang::ParseAST(clang::Sema&, bool, bool) (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0xaec6db)
#33 0x00007fa24bef51f1 clang::FrontendAction::Execute() (/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/../lib.llvm/libclang-cpp.so.18.1+0x2c191f1)
#34 0x000056366968e5c5 (/opt/1A/toolchain/x86_64-v23/bin/clangd+0x7ee5c5)
#35 0x000056366970af87 (/opt/1A/toolchain/x86_64-v23/bin/clangd+0x86af87)
#36 0x000056366970b945 (/opt/1A/toolchain/x86_64-v23/bin/clangd+0x86b945)
#37 0x0000563669703c1a (/opt/1A/toolchain/x86_64-v23/bin/clangd+0x863c1a)
#38 0x000056366970462b (/opt/1A/toolchain/x86_64-v23/bin/clangd+0x86462b)
#39 0x00005636698cca7e (/opt/1A/toolchain/x86_64-v23/bin/clangd+0xa2ca7e)
#40 0x00007fa24497565b start_thread pthread_create.c:0:0
#41 0x00007fa2449f2990 __clone (/opt/1A/toolchain/x86_64-v23.0.25/lib/libc.so.6+0xfe990)
Signalled during AST worker action: Build AST
Filename: /remote/users/sbini/si/common/include/si/common/Notifier.h
Directory: /remote/users/sbini/si/common
Command Line: /remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/bin/g++ --driver-mode=g++ -Wall -Wmissing-field-initializers -D_AMD_UNIX_ -D_AMD_UNIX_LINUX_ -D__STDC_LIMIT_MACROS -D_AMD_ENV_64_ -D_AMD_GNU_ -D_AMD_DEBUG_ -D_AMD_THREADS_ -D_AMD_THREADS_POSIX_ -D_THREAD_SAFE -D_REENTRANT -DENABLE_ASYNC_EXPORT -DENABLE_OTLP_COMPRESSION_PREVIEW -DHAVE_ABSEIL -DOPENTELEMETRY_ABI_VERSION_NO=1 -DOPENTELEMETRY_STL_VERSION=2023 -D_AMD_TRACE_ -DSI_VERSION=23.1.71.0 -DSEI_IN_SEI_BUILD -DAMD_IS_INTERNAL_MIDDLEWARE_COMPONENT_ALLOWED_TO_USE_ACF -I/remote/users/sbini/si/common/src -I/remote/users/sbini/si/common/include -I/remote/users/sbini/si/base/include -I/remote/users/sbini/si/convmanager/include -I/remote/users/sbini/si/convmanager/control/include -I/remote/users/sbini/si/convmanager/conversation/include -I/remote/users/sbini/si/convmanager/transport/include -I/data/mwrep/res/mdw/CFC/23-0-0-8/include -I/data/mwrep/res/mdw/CryptoManager/23-0-0-2/include -I/data/mwrep/res/mdw/DateTime/23-0-0-5/include -I/data/mwrep/res/mdw/EDICPP/23-0-0-2/include -I/data/mwrep/res/mdw/Fields/23-0-0-2/include -I/data/mwrep/res/mdw/HPTimer/23-0-0-1/include -I/data/mwrep/res/mdw/SIOTF/internal/ACF/ssl/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/Sekhmet/23-0-0-5/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/common/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/exporter_ostream_span/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/exporter_otlp_http/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/exporter_otlp_http_client/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/http_client_curl/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/logs/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/otlp_recordable/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/proto/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/resources/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/trace/23-0-0-11/include -I/data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/version/23-0-0-11/include -I/data/mwrep/res/mdw/TDSC/23-0-0-1/include -I/data/mwrep/res/mdw/Toolbox/23-0-0-14/include -I/data/mwrep/res/mdw/Tracer/23-0-0-7/include -I/data/mwrep/res/mdw/XDSC/23-0-0-7/include -I/data/mwrep/res/mdw/internal/ACF/23-0-0-7/include -I/data/mwrep/res/mdw/security_core/23-0-0-31/include -I/data/mwrep/res/mdw/security_core/23-0-0-31/include -I/data/mwrep/res/osp/Abseil/23-0-0-3/include -I/data/mwrep/res/osp/Boost/23-0-0-4/include -I/data/mwrep/res/osp/Coredumper/23-0-0-2/include -I/data/mwrep/res/osp/EXPAT/23-0-0-6/include -I/data/mwrep/res/osp/JsonCPP/23-0-0-3/include -I/data/mwrep/res/osp/Libcurl/23-0-0-10/include -I/data/mwrep/res/osp/OpenSSL/crypto/23-0-0-7/include -I/data/mwrep/res/osp/ProtoBuf/23-0-0-5/include -I/data/mwrep/res/osp/RapidJson/23-0-0-1/include -I/data/mwrep/res/osp/RapidXml/23-0-0-1/include -I/data/mwrep/res/osp/Re2/23-0-0-6/include -I/data/mwrep/res/osp/SQLite/23-0-0-6/include -I/data/mwrep/res/osp/SSH2/23-0-0-2/include -I/data/mwrep/res/osp/ZLib/23-0-0-3/include -g -m64 -pipe -fno-strict-aliasing -fvisibility=hidden -fdiagnostics-color=always -fno-pie -fno-pic -fno-PIC -fPIE -fno-lto -ffat-lto-objects -fno-plt -fno-semantic-interposition -fexceptions -ggdb3 -fvisibility=hidden -Wall -Wextra -Werror -ftrack-macro-expansion=1 -fno-omit-frame-pointer -MD -MF /remote/users/sbini/si/common/bmstmp/ncesidev01.nce.amadeus.net/build/obj/x86_64-v23/DebugStaticGccNoInstr/main/rootSymlink/src/ApplicativeKeyScopeDef.cpp.fullDependencies -MT $(call bmsInternalComputeFullDependenciesTargetName,src/ApplicativeKeyScopeDef.cpp) -c -x c++-header -std=gnu++23 -resource-dir=/remote/tools/Linux/2.6/1A/toolchain/x86_64-v23.0.25/lib.llvm/clang/18 -- /remote/users/sbini/si/common/include/si/common/Notifier.h
Version: 1
[Error - 9:38:08 AM] The Clang Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
```
And the version:
```
> clangd --version 9:45
clangd version 18.1.7
Features: linux
Platform: x86_64-unknown-linux-gnu; target=x86_64-1a-linux-gnu
```
And here is a snippet of the file near line 238 (template member function definition of a template class):
```
template <class... Args>
template <class BaseHandle_t, class T, class Functor>
SI_REQUIRES(std::invocable<Functor const, std::shared_ptr<T>, Args...>)
NotifierSubscriptionPtr Notifier<Args...>::Impl::Subscribe(
Ptr_t const& ioSelf, std::shared_ptr<T> const& iObj, Functor iFunc)
{ // line 238
```
with `#define SI_REQUIRES(...) requires __VA_ARGS__`
Thank you!
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs