llvm / llvm-project

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

Clang 17 crashes on null pointer deref while generating debuginfo #95720

Open mcy opened 3 weeks ago

mcy commented 3 weeks ago

I have made minimal attempts to debug this; I have only done enough to determine this is due to a null deref in clang::CodeGen::CGDebugInfo::getOrCreateType().

clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/mcyoung/projects/best/external/toolchains_llvm~~llvm~llvm_llvm/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64

result_test-eacb02.cpp result_test-eacb02.sh

EugeneZelenko commented 3 weeks ago

Could you please try 18 or main branch?

llvmbot commented 3 weeks ago

@llvm/issue-subscribers-clang-codegen

Author: Miguel Young (mcy)

I have made minimal attempts to debug this; I have only done enough to determine this is due to a null deref in `clang::CodeGen::CGDebugInfo::getOrCreateType()`. ``` clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/mcyoung/projects/best/external/toolchains_llvm~~llvm~llvm_llvm/bin Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Candidate multilib: .;@m64 Selected multilib: .;@m64 ``` [result_test-eacb02.cpp](https://github.com/user-attachments/files/15859786/result_test-eacb02.cpp.txt) [result_test-eacb02.sh](https://github.com/user-attachments/files/15859787/result_test-eacb02.sh.txt)
shafik commented 3 weeks ago

If this still reproduces on main then we definitely need a reduction.

Endilll commented 3 weeks ago

I can reproduce it with trunk (20d3cab85258198d262eea05fae6292a2666d6ae), but not with a nightly build at ca1a96364a56 Debian clang version 19.0.0 (++20240617100922+ca1a96364a56-1~exp1~20240617221046.2156) Trunk crash:

In file included from best/container/result_test.cc:2:
In file included from ./best/container/result.h:6:
In file included from ./best/container/choice.h:7:
In file included from ./best/container/internal/choice.h:12:
In file included from ./best/container/object.h:13:
In file included from ./best/meta/ebo.h:9:
In file included from ./best/meta/init.h:10:
./best/meta/internal/init.h:46:50: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
   46 |                                  : args.template apply([]<typename... Args> {
      |                                                  ^
In file included from best/container/result_test.cc:2:
In file included from ./best/container/result.h:6:
In file included from ./best/container/choice.h:7:
In file included from ./best/container/internal/choice.h:12:
In file included from ./best/container/object.h:13:
In file included from ./best/meta/ebo.h:9:
./best/meta/init.h:36:49: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
   36 |                         types<Args...>.template trim_prefix(types<trivially>)>;
      |                                                 ^
./best/meta/init.h:48:52: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
   48 |          typename decltype(types<Args...>.template trim_prefix(
      |                                                    ^
./best/meta/init.h:79:51: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
   79 |                           types<Args...>.template trim_prefix(
      |                                                   ^
clang: /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp:426: bool clang::Sema::DiagnoseUnexpandedParameterPack(Expr *, UnexpandedParameterPackContext): Assertion `!Unexpanded.empty() && "Unable to find unexpanded parameter packs"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /home/user/endill/ramdisk/llvm-build/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name result_test.cc -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=standalone -dwarf-version=5 -debugger-tuning=gdb -fcoverage-compilation-dir=/home/mcyoung/projects/best -sys-header-deps -U _FORTIFY_SOURCE -U _FORTIFY_SOURCE -D __DATE__=\"redacted\" -D __TIMESTAMP__=\"redacted\" -D __TIME__=\"redacted\" -Wall -Wthread-safety -Wself-assign -Wno-builtin-macro-redefined -std=c++20 -fdeprecated-macro -fdebug-compilation-dir=/home/mcyoung/projects/best -fdebug-prefix-map=external/toolchains_llvm~~llvm~llvm_llvm/=__bazel_toolchain_llvm_repo__/ -ferror-limit 19 -ftemplate-backtrace-limit=0 -stack-protector 1 -fgnuc-version=4.2.1 -fno-implicit-modules -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ result_test-eacb02.cpp
1.      ./best/container/result.h:251:99: current parser token '{'
2.      ./best/container/result.h:17:1: parsing namespace 'best'
3.      ./best/container/result.h:74:1: parsing struct/union/class body 'best::result'
4.      ./best/container/result.h:28:8: instantiating class definition 'best::ok<>'
5.      ./best/container/row.h:67:7: instantiating class definition 'best::row<>'
 #0 0x00007f4300115388 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/user/endill/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13
 #1 0x00007f4300113200 llvm::sys::RunSignalHandlers() /home/user/endill/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #2 0x00007f4300115a4a SignalHandler(int) /home/user/endill/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #3 0x00007f42ffb20580 (/lib/x86_64-linux-gnu/libc.so.6+0x3d580)
 #4 0x00007f42ffb6eb0c (/lib/x86_64-linux-gnu/libc.so.6+0x8bb0c)
 #5 0x00007f42ffb204e2 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x3d4e2)
 #6 0x00007f42ffb094ed abort (/lib/x86_64-linux-gnu/libc.so.6+0x264ed)
 #7 0x00007f42ffb09415 (/lib/x86_64-linux-gnu/libc.so.6+0x26415)
 #8 0x00007f42ffb19002 (/lib/x86_64-linux-gnu/libc.so.6+0x36002)
 #9 0x00007f42fd3af8a5 (/home/user/endill/ramdisk/llvm-build/bin/../lib/../lib/libclangSema.so.19.0git+0xeca8a5)
#10 0x00007f42fcc41749 clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaDecl.cpp:13599:9
#11 0x00007f42fd376643 clang::Sema::InstantiateVariableInitializer(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:0:9
#12 0x00007f42fd369d7b clang::Decl::isInvalidDecl() const /home/user/endill/llvm-project/clang/include/clang/AST/DeclBase.h:594:46
#13 0x00007f42fd369d7b clang::Sema::BuildVariableInstantiation(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&, llvm::SmallVector<clang::Sema::LateInstantiatedAttribute, 16u>*, clang::DeclContext*, clang::LocalInstantiationScope*, bool, clang::VarTemplateSpecializationDecl*) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:5435:16
#14 0x00007f42fd3694b2 clang::TemplateDeclInstantiator::VisitVarDecl(clang::VarDecl*, bool, llvm::ArrayRef<clang::BindingDecl*>*) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1234:11
#15 0x00007f42fd3ae5d4 clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)::$_0::operator()() const /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:4098:5
#16 0x00007f42fd3ae5d4 void llvm::function_ref<void ()>::callback_fn<clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)::$_0>(long) /home/user/endill/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#17 0x00007f42fca4d23f clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) /home/user/endill/llvm-project/clang/lib/Sema/Sema.cpp:559:1
#18 0x00007f42fd377d98 clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:4100:10
#19 0x00007f42fd356249 (anonymous namespace)::TemplateInstantiator::TransformDefinition(clang::SourceLocation, clang::Decl*) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:1874:8
#20 0x00007f42fd356249 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformDeclStmt(clang::DeclStmt*) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:8208:38
#21 0x00007f42fd33e06d clang::ActionResult<clang::Stmt*, true>::isInvalid() const /home/user/endill/llvm-project/clang/include/clang/Sema/Ownership.h:199:41
#22 0x00007f42fd33e06d clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:7773:16
#23 0x00007f42fd34492d clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformLambdaBody(clang::LambdaExpr*, clang::Stmt*) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:14625:10
#24 0x00007f42fd34492d (anonymous namespace)::TemplateInstantiator::TransformLambdaBody(clang::LambdaExpr*, clang::Stmt*) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:1728:36
#25 0x00007f42fd34492d clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformLambdaExpr(clang::LambdaExpr*) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:14556:44
#26 0x00007f42fd3348a6 (anonymous namespace)::TemplateInstantiator::TransformLambdaExpr(clang::LambdaExpr*) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:0:38
#27 0x00007f42fd3370e3 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:0:36
#28 0x00007f42fd3498db clang::ActionResult<clang::Expr*, true>::isInvalid() const /home/user/endill/llvm-project/clang/include/clang/Sema/Ownership.h:199:41
#29 0x00007f42fd3498db clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformDecltypeType(clang::TypeLocBuilder&, clang::DecltypeTypeLoc) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:6557:9
#30 0x00007f42fd32283a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) /home/user/endill/ramdisk/llvm-build/tools/clang/include/clang/AST/TypeNodes.inc:0:45
#31 0x00007f42fd321ec6 llvm::PointerUnion<clang::Type const*, clang::ExtQuals const*>::isNull() const /home/user/endill/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:142:33
#32 0x00007f42fd321ec6 clang::QualType::isNull() const /home/user/endill/llvm-project/clang/include/clang/AST/Type.h:1008:31
#33 0x00007f42fd321ec6 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:4976:14
#34 0x00007f42fd322a62 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::QualType) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:4956:8
#35 0x00007f42fd322a62 clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:2918:23
#36 0x00007f42fd1c1039 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplate.cpp:4651:9
#37 0x00007f42fd346f74 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::RebuildTemplateSpecializationType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:16176:18
#38 0x00007f42fd346f74 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:7120:18
#39 0x00007f42fd34e730 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:6868:23
#40 0x00007f42fd32233c clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) /home/user/endill/ramdisk/llvm-build/tools/clang/include/clang/AST/TypeNodes.inc:0:59
#41 0x00007f42fd34b2d5 llvm::PointerUnion<clang::Type const*, clang::ExtQuals const*>::isNull() const /home/user/endill/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:142:33
#42 0x00007f42fd34b2d5 clang::QualType::isNull() const /home/user/endill/llvm-project/clang/include/clang/AST/Type.h:1008:31
#43 0x00007f42fd34b2d5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:7228:14
#44 0x00007f42fd3224b6 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) /home/user/endill/ramdisk/llvm-build/tools/clang/include/clang/AST/TypeNodes.inc:0:47
#45 0x00007f42fd321ec6 llvm::PointerUnion<clang::Type const*, clang::ExtQuals const*>::isNull() const /home/user/endill/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:142:33
#46 0x00007f42fd321ec6 clang::QualType::isNull() const /home/user/endill/llvm-project/clang/include/clang/AST/Type.h:1008:31
#47 0x00007f42fd321ec6 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:4976:14
#48 0x00007f42fd328f03 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:4707:10
#49 0x00007f42fd328f03 (anonymous namespace)::TemplateInstantiator::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:1637:25
#50 0x00007f42fd346dc8 bool clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArguments<clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc>>(clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc>, clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc>, clang::TemplateArgumentListInfo&, bool) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:0:26
#51 0x00007f42fd346dc8 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:7112:20
#52 0x00007f42fd34e730 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:6868:23
#53 0x00007f42fd32233c clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) /home/user/endill/ramdisk/llvm-build/tools/clang/include/clang/AST/TypeNodes.inc:0:59
#54 0x00007f42fd34b2d5 llvm::PointerUnion<clang::Type const*, clang::ExtQuals const*>::isNull() const /home/user/endill/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:142:33
#55 0x00007f42fd34b2d5 clang::QualType::isNull() const /home/user/endill/llvm-project/clang/include/clang/AST/Type.h:1008:31
#56 0x00007f42fd34b2d5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:7228:14
#57 0x00007f42fd3224b6 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) /home/user/endill/ramdisk/llvm-build/tools/clang/include/clang/AST/TypeNodes.inc:0:47
#58 0x00007f42fd322d7f llvm::PointerUnion<clang::Type const*, clang::ExtQuals const*>::isNull() const /home/user/endill/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:142:33
#59 0x00007f42fd322d7f clang::QualType::isNull() const /home/user/endill/llvm-project/clang/include/clang/AST/Type.h:1008:31
#60 0x00007f42fd322d7f clang::QualType clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers, bool)::$_0>(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl*, clang::Qualifiers, clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers, bool)::$_0) /home/user/endill/llvm-project/clang/lib/Sema/TreeTransform.h:6239:20
#61 0x00007f42fd322d7f clang::QualType (anonymous namespace)::TemplateInstantiator::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers, bool)::$_0>(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl*, clang::Qualifiers, clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers, bool)::$_0) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:2440:21
#62 0x00007f42fd322d7f clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:2978:27
#63 0x00007f42fd371009 clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*, llvm::SmallVectorImpl<clang::ParmVarDecl*>&) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:4465:38
#64 0x00007f42fd36e0d1 clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*, clang::TemplateParameterList*, clang::TemplateDeclInstantiator::RewriteKind) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:2549:19
#65 0x00007f42fd36d998 llvm::ValueIsPresent<clang::Decl*, void>::isPresent(clang::Decl* const&) /home/user/endill/llvm-project/llvm/include/llvm/Support/Casting.h:622:55
#66 0x00007f42fd36d998 bool llvm::detail::isPresent<clang::Decl*>(clang::Decl* const&) /home/user/endill/llvm-project/llvm/include/llvm/Support/Casting.h:630:10
#67 0x00007f42fd36d998 auto llvm::cast_if_present<clang::FunctionDecl, clang::Decl>(clang::Decl*) /home/user/endill/llvm-project/llvm/include/llvm/Support/Casting.h:704:8
#68 0x00007f42fd36d998 auto llvm::cast_or_null<clang::FunctionDecl, clang::Decl>(clang::Decl*) /home/user/endill/llvm-project/llvm/include/llvm/Support/Casting.h:729:10
#69 0x00007f42fd36d998 clang::TemplateDeclInstantiator::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl*) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:0:0
#70 0x00007f42fd3257bd clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:3623:9
#71 0x00007f42fd3276f1 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4099:10
#72 0x00007f42fd3f788e clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_0::operator()() const /home/user/endill/llvm-project/clang/lib/Sema/SemaType.cpp:9114:11
#73 0x00007f42fd3f788e void llvm::function_ref<void ()>::callback_fn<clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_0>(long) /home/user/endill/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#74 0x00007f42fca4d23f clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) /home/user/endill/llvm-project/clang/lib/Sema/Sema.cpp:559:1
#75 0x00007f42fd3e1f32 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) /home/user/endill/llvm-project/clang/lib/Sema/SemaType.cpp:9142:11
#76 0x00007f42fd3e18a0 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) /home/user/endill/llvm-project/clang/lib/Sema/SemaType.cpp:8838:7
#77 0x00007f42fcc537ea clang::Sema::CheckFieldDecl(clang::DeclarationName, clang::QualType, clang::TypeSourceInfo*, clang::RecordDecl*, clang::SourceLocation, bool, clang::Expr*, clang::InClassInitStyle, clang::SourceLocation, clang::AccessSpecifier, clang::NamedDecl*, clang::Declarator*) /home/user/endill/llvm-project/clang/lib/Sema/SemaDecl.cpp:18621:9
#78 0x00007f42fd36a342 clang::TemplateDeclInstantiator::VisitFieldDecl(clang::FieldDecl*) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1323:30
#79 0x00007f42fd3257bd clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:3623:9
#80 0x00007f42fd3276f1 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4099:10
#81 0x00007f42fd3f788e clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_0::operator()() const /home/user/endill/llvm-project/clang/lib/Sema/SemaType.cpp:9114:11
#82 0x00007f42fd3f788e void llvm::function_ref<void ()>::callback_fn<clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_0>(long) /home/user/endill/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#83 0x00007f42fca4d23f clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) /home/user/endill/llvm-project/clang/lib/Sema/Sema.cpp:559:1
#84 0x00007f42fd3e1f32 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) /home/user/endill/llvm-project/clang/lib/Sema/SemaType.cpp:9142:11
#85 0x00007f42fd3e18a0 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) /home/user/endill/llvm-project/clang/lib/Sema/SemaType.cpp:8838:7
#86 0x00007f42fd3e26e8 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, unsigned int) /home/user/endill/llvm-project/clang/lib/Sema/SemaType.cpp:9184:1
#87 0x00007f42fcb23d8f clang::Sema::CheckParmsForFunctionDef(llvm::ArrayRef<clang::ParmVarDecl*>, bool) /home/user/endill/llvm-project/clang/lib/Sema/SemaChecking.cpp:13615:72
#88 0x00007f42fcc49ba1 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*, clang::Decl*, clang::SkipBodyInfo*, clang::Sema::FnBodyKind) /home/user/endill/llvm-project/clang/lib/Sema/SemaDecl.cpp:0:5
#89 0x00007f42fd4ca6ef clang::Token::is(clang::tok::TokenKind) const /home/user/endill/llvm-project/clang/include/clang/Lex/Token.h:99:44
#90 0x00007f42fd4ca6ef clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) /home/user/endill/llvm-project/clang/lib/Parse/ParseCXXInlineMethods.cpp:610:11
#91 0x00007f42fd4c942a clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) /home/user/endill/llvm-project/clang/lib/Parse/ParseCXXInlineMethods.cpp:574:33
#92 0x00007f42fd50a6e1 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) /home/user/endill/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:3827:21
#93 0x00007f42fd50815f clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) /home/user/endill/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:0:7
#94 0x00007f42fd4e1c35 llvm::SmallVectorBase<unsigned int>::empty() const /home/user/endill/llvm-project/llvm/include/llvm/ADT/SmallVector.h:94:46
#95 0x00007f42fd4e1c35 clang::ParsedAttributesView::empty() const /home/user/endill/llvm-project/clang/include/clang/Sema/ParsedAttr.h:843:40
#96 0x00007f42fd4e1c35 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) /home/user/endill/llvm-project/clang/lib/Parse/ParseDecl.cpp:4632:23
#97 0x00007f42fd59e7a9 clang::Token::is(clang::tok::TokenKind) const /home/user/endill/llvm-project/clang/include/clang/Lex/Token.h:99:49
#98 0x00007f42fd59e7a9 clang::Parser::ParseDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /home/user/endill/llvm-project/clang/lib/Parse/ParseTemplate.cpp:238:11
#99 0x00007f42fd59d683 clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /home/user/endill/llvm-project/clang/lib/Parse/ParseTemplate.cpp:0:0
#100 0x00007f42fd59cf6b clang::Parser::ObjCDeclContextSwitch::ObjCDeclContextSwitch(clang::Parser&) /home/user/endill/llvm-project/clang/include/clang/Parse/Parser.h:1093:11
#101 0x00007f42fd59cf6b clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&) /home/user/endill/llvm-project/clang/lib/Parse/ParseTemplate.cpp:43:25
#102 0x00007f42fd4daeb4 clang::Parser::ObjCDeclContextSwitch::ObjCDeclContextSwitch(clang::Parser&) /home/user/endill/llvm-project/clang/include/clang/Parse/Parser.h:1093:11
#103 0x00007f42fd4daeb4 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) /home/user/endill/llvm-project/clang/lib/Parse/ParseDecl.cpp:1981:25
#104 0x00007f42fd5af64b clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /home/user/endill/llvm-project/clang/lib/Parse/Parser.cpp:0:0
#105 0x00007f42fd4feb07 clang::AttributePool::~AttributePool() /home/user/endill/llvm-project/clang/include/clang/Sema/ParsedAttr.h:726:22
#106 0x00007f42fd4feb07 clang::ParsedAttributes::~ParsedAttributes() /home/user/endill/llvm-project/clang/include/clang/Sema/ParsedAttr.h:958:7
#107 0x00007f42fd4feb07 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) /home/user/endill/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:273:5
#108 0x00007f42fd4fe200 clang::Parser::ParseScope::Exit() /home/user/endill/llvm-project/clang/include/clang/Parse/Parser.h:1197:15
#109 0x00007f42fd4fe200 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) /home/user/endill/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:252:18
#110 0x00007f42fd4db06e clang::Parser::ObjCDeclContextSwitch::ObjCDeclContextSwitch(clang::Parser&) /home/user/endill/llvm-project/clang/include/clang/Parse/Parser.h:1093:11
#111 0x00007f42fd4db06e clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) /home/user/endill/llvm-project/clang/lib/Parse/ParseDecl.cpp:1981:25
#112 0x00007f42fd5af64b clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /home/user/endill/llvm-project/clang/lib/Parse/Parser.cpp:0:0
#113 0x00007f42fd5adb37 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /home/user/endill/llvm-project/clang/lib/Parse/Parser.cpp:763:10
#114 0x00007f42fd4c5b2e clang::ParseAST(clang::Sema&, bool, bool) /home/user/endill/llvm-project/clang/lib/Parse/ParseAST.cpp:162:5
#115 0x00007f4302685310 clang::FrontendAction::Execute() /home/user/endill/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1082:10
#116 0x00007f43025f6ced llvm::Error::getPtr() const /home/user/endill/llvm-project/llvm/include/llvm/Support/Error.h:279:42
#117 0x00007f43025f6ced llvm::Error::operator bool() /home/user/endill/llvm-project/llvm/include/llvm/Support/Error.h:242:16
#118 0x00007f43025f6ced clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/user/endill/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1061:23
#119 0x00007f430412912b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/user/endill/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:280:25
#120 0x0000564bb690baae cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/user/endill/llvm-project/clang/tools/driver/cc1_main.cpp:232:15
#121 0x0000564bb69087e8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /home/user/endill/llvm-project/clang/tools/driver/driver.cpp:215:12
#122 0x0000564bb6907884 clang_main(int, char**, llvm::ToolContext const&) /home/user/endill/llvm-project/clang/tools/driver/driver.cpp:256:12
#123 0x0000564bb69160e7 main /home/user/endill/ramdisk/llvm-build/tools/clang/tools/driver/clang-driver.cpp:17:10
#124 0x00007f42ffb0ac8a (/lib/x86_64-linux-gnu/libc.so.6+0x27c8a)
#125 0x00007f42ffb0ad45 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27d45)
#126 0x0000564bb6906431 _start (/home/user/endill/ramdisk/llvm-build/bin/clang+0xd431)
Endilll commented 3 weeks ago

Reduced by me and C-Reduce (https://godbolt.org/z/v36Mz6x57), but the stack trace is a bit different:

template <typename...>
using common_comparison_category_t = int;

template <typename T, typename>
using order_type = decltype([] { T{}; });

template <typename... Elems>
struct row {
  template <typename... Us>
  common_comparison_category_t<order_type<Elems, Us>...> operator=(int);
};

row<> r;

Stack trace:

clang++: /root/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp:426: bool clang::Sema::DiagnoseUnexpandedParameterPack(clang::Expr*, clang::Sema::UnexpandedParameterPackContext): Assertion `!Unexpanded.empty() && "Unable to find unexpanded parameter packs"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1.  <source>:13:8: current parser token ';'
2.  <source>:8:8: instantiating class definition 'row<>'
 #0 0x0000000003a1a338 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a1a338)
 #1 0x0000000003a1801c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a1801c)
 #2 0x00000000039600f8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007ff217e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007ff217e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007ff217e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007ff217e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007ff217e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007ff217e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000007095652 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7095652)
#10 0x0000000006a79dfe clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a79dfe)
#11 0x0000000006d9c51e clang::Sema::ActOnExprStmt(clang::ActionResult<clang::Expr*, true>, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6d9c51e)
#12 0x0000000007017ee4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
#13 0x0000000006fd9a30 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
#14 0x0000000006fda7b7 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#15 0x0000000006fea141 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#16 0x0000000006ff097a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#17 0x0000000006ff0a9c clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::QualType) SemaTemplateInstantiate.cpp:0:0
#18 0x0000000006ff2f7b clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ff2f7b)
#19 0x0000000006e4ed8e clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e4ed8e)
#20 0x0000000006ff901d clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) SemaTemplateInstantiate.cpp:0:0
#21 0x0000000006feb014 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#22 0x00000000070022cd clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#23 0x0000000006fea328 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#24 0x0000000006ff097a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#25 0x0000000006ff5dc3 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) SemaTemplateInstantiate.cpp:0:0
#26 0x0000000006ff636f (anonymous namespace)::TemplateInstantiator::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) SemaTemplateInstantiate.cpp:0:0
#27 0x0000000006ff8f42 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) SemaTemplateInstantiate.cpp:0:0
#28 0x0000000006feb014 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#29 0x00000000070022cd clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#30 0x0000000006fea328 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#31 0x0000000007009e99 clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7009e99)
#32 0x0000000007029ace clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*, llvm::SmallVectorImpl<clang::ParmVarDecl*>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7029ace)
#33 0x000000000708112a clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*, clang::TemplateParameterList*, clang::TemplateDeclInstantiator::RewriteKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x708112a)
#34 0x00000000070852c0 clang::TemplateDeclInstantiator::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x70852c0)
#35 0x0000000006ffbf4b clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ffbf4b)
#36 0x000000000701fd72 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x701fd72)
#37 0x00000000070b25df void llvm::function_ref<void ()>::callback_fn<clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::'lambda'()>(long) SemaType.cpp:0:0
#38 0x00000000064e8831 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64e8831)
#39 0x00000000070bb7e7 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x70bb7e7)
#40 0x00000000070bbb35 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x70bbb35)
#41 0x00000000070bbcb5 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x70bbcb5)
#42 0x0000000006716221 clang::Sema::ActOnUninitializedDecl(clang::Decl*) (.part.0) SemaDecl.cpp:0:0
#43 0x00000000063af626 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x63af626)
#44 0x00000000063be5ca clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x63be5ca)
#45 0x000000000637ce0e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x637ce0e)
#46 0x000000000637d66e clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x637d66e)
#47 0x0000000006383d77 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6383d77)
#48 0x0000000006384c7f clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6384c7f)
#49 0x000000000637847a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x637847a)
#50 0x00000000042fca68 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42fca68)
#51 0x00000000045812e9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45812e9)
#52 0x000000000450822e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x450822e)
#53 0x000000000466896e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x466896e)
#54 0x0000000000c6d15c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc6d15c)
#55 0x0000000000c664ba ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#56 0x000000000433fd49 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#57 0x00000000039605a4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x39605a4)
#58 0x000000000434033f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#59 0x00000000043061e5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43061e5)
#60 0x0000000004306c4d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4306c4d)
#61 0x000000000430e945 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x430e945)
#62 0x0000000000c6a665 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc6a665)
#63 0x0000000000b44244 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xb44244)
#64 0x00007ff217e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#65 0x00007ff217e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#66 0x0000000000c65f6e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc65f6e)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
llvmbot commented 3 weeks ago

@llvm/issue-subscribers-clang-frontend

Author: Miguel Young (mcy)

I have made minimal attempts to debug this; I have only done enough to determine this is due to a null deref in `clang::CodeGen::CGDebugInfo::getOrCreateType()`. ``` clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/mcyoung/projects/best/external/toolchains_llvm~~llvm~llvm_llvm/bin Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Candidate multilib: .;@m64 Selected multilib: .;@m64 ``` [result_test-eacb02.cpp](https://github.com/user-attachments/files/15859786/result_test-eacb02.cpp.txt) [result_test-eacb02.sh](https://github.com/user-attachments/files/15859787/result_test-eacb02.sh.txt)
llvmbot commented 3 weeks ago

@llvm/issue-subscribers-c-11

Author: Miguel Young (mcy)

I have made minimal attempts to debug this; I have only done enough to determine this is due to a null deref in `clang::CodeGen::CGDebugInfo::getOrCreateType()`. ``` clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/mcyoung/projects/best/external/toolchains_llvm~~llvm~llvm_llvm/bin Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Candidate multilib: .;@m64 Selected multilib: .;@m64 ``` [result_test-eacb02.cpp](https://github.com/user-attachments/files/15859786/result_test-eacb02.cpp.txt) [result_test-eacb02.sh](https://github.com/user-attachments/files/15859787/result_test-eacb02.sh.txt)
llvmbot commented 3 weeks ago

@llvm/issue-subscribers-c-20

Author: Miguel Young (mcy)

I have made minimal attempts to debug this; I have only done enough to determine this is due to a null deref in `clang::CodeGen::CGDebugInfo::getOrCreateType()`. ``` clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/mcyoung/projects/best/external/toolchains_llvm~~llvm~llvm_llvm/bin Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12 Candidate multilib: .;@m64 Selected multilib: .;@m64 ``` [result_test-eacb02.cpp](https://github.com/user-attachments/files/15859786/result_test-eacb02.cpp.txt) [result_test-eacb02.sh](https://github.com/user-attachments/files/15859787/result_test-eacb02.sh.txt)
fordfrog commented 4 days ago

not sure if it helps but i'm hitting (probably) similar issue for quite some time when attempting to compile ungoogled-chromium (there's no stacktrace though) with clang-19.0.0_pre20240630 (on gentoo linux):

[2068/4359] x86_64-pc-linux-gnu-clang++ -MD -MF obj/third_party/perfetto/src/tracing/client_api_without_backends/track_event_internal.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -D_GLIBCXX_ASSERTIONS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DPERFETTO_IMPLEMENTATION -I../.. -Igen -Igen/shim_headers/zlib_shim -I../../third_party/perfetto -I../../third_party/perfetto/src/profiling/memory/include -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../third_party/protobuf/src -Igen/protoc_out -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-cast-function-type -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wno-invalid-offsetof -Wno-vla-extension -Wno-thread-safety-reference-return -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -flto=thin -fno-split-lto-unit -fwhole-program-vtables -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-math-errno -fno-omit-frame-pointer -g0 -fprofile-use=../../chrome/build/pgo_profiles/chrome-linux-6422-1715686914-39d3c200676449e33ad84989ea45ad3474fab6e2-013ab7d1275249b95c27d77aaaa0d257ac6d2359.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -DPROTOBUF_ALLOW_DEPRECATED=1 -Wenum-compare-conditional -Wno-c++11-narrowing-const-reference -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden  -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -march=alderlake -pipe -frecord-gcc-switches -U_GLIBCXX_ASSERTIONS -Wno-unknown-warning-option -Wno-builtin-macro-redefined -c ../../third_party/perfetto/src/tracing/internal/track_event_internal.cc -o obj/third_party/perfetto/src/tracing/client_api_without_backends/track_event_internal.o
FAILED: obj/third_party/perfetto/src/tracing/client_api_without_backends/track_event_internal.o 
x86_64-pc-linux-gnu-clang++ -MD -MF obj/third_party/perfetto/src/tracing/client_api_without_backends/track_event_internal.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -D_GLIBCXX_ASSERTIONS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DPERFETTO_IMPLEMENTATION -I../.. -Igen -Igen/shim_headers/zlib_shim -I../../third_party/perfetto -I../../third_party/perfetto/src/profiling/memory/include -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../third_party/protobuf/src -Igen/protoc_out -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-cast-function-type -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wno-invalid-offsetof -Wno-vla-extension -Wno-thread-safety-reference-return -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -flto=thin -fno-split-lto-unit -fwhole-program-vtables -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-math-errno -fno-omit-frame-pointer -g0 -fprofile-use=../../chrome/build/pgo_profiles/chrome-linux-6422-1715686914-39d3c200676449e33ad84989ea45ad3474fab6e2-013ab7d1275249b95c27d77aaaa0d257ac6d2359.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -DPROTOBUF_ALLOW_DEPRECATED=1 -Wenum-compare-conditional -Wno-c++11-narrowing-const-reference -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden  -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -march=alderlake -pipe -frecord-gcc-switches -U_GLIBCXX_ASSERTIONS -Wno-unknown-warning-option -Wno-builtin-macro-redefined -c ../../third_party/perfetto/src/tracing/internal/track_event_internal.cc -o obj/third_party/perfetto/src/tracing/client_api_without_backends/track_event_internal.o
In file included from <built-in>:520:
<command line>:16:9: warning: '_LIBCPP_HARDENING_MODE' macro redefined [-Wmacro-redefined]
   16 | #define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_NONE
      |         ^
<command line>:3:9: note: previous definition is here
    3 | #define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_EXTENSIVE
      |         ^
In file included from ../../third_party/perfetto/src/tracing/internal/track_event_internal.cc:23:
In file included from ../../third_party/perfetto/include/perfetto/tracing/track_event.h:20:
../../third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:331:20: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
  331 |     Base::template Trace([](typename Base::TraceContext ctx) { ctx.Flush(); });
      |                    ^
../../third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:337:20: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
  337 |     Base::template CallIfEnabled(
      |                    ^
../../third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:352:20: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
  352 |     Base::template Trace([&](typename Base::TraceContext ctx) {
      |                    ^
../../third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:499:20: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
  499 |     Base::template Trace([&](typename Base::TraceContext ctx) {
      |                    ^
../../third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:1050:22: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
 1050 |       Base::template TraceWithInstances(instances, std::move(lambda));
      |                      ^
../../third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:1064:20: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
 1064 |     Base::template Trace([&](typename Base::TraceContext ctx) {
      |                    ^
1 warning and 6 errors generated.