Issue |
126973
|
Summary |
[clang][modules] Assertion failed: (D && "missing definition for pattern of instantiated definition"), function hasAcceptableDefinition, file SemaType.cpp, line 9203.
|
Labels |
clang:frontend,
clang:modules
|
Assignees |
|
Reporter |
zixu-w
|
Crash with assertion failure when building `StringSaver.cpp` during bootstrap build, with modules enabled on macOS
```
❯ /Volumes/External2/repos/upstream-llvm-project/build-clang-bootstrap/./bin/clang++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Volumes/External2/repos/upstream-llvm-project/build-clang-bootstrap/tools/clang/stage2-bins/lib/Support -I/Volumes/External2/repos/upstream-llvm-project/llvm/lib/Support -I/Volumes/External2/repos/upstream-llvm-project/build-clang-bootstrap/tools/clang/stage2-bins/include -I/Volumes/External2/repos/upstream-llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -fdiagnostics-color -O2 -g -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o -c /Volumes/External2/repos/upstream-llvm-project/llvm/lib/Support/StringSaver.cpp -fmodules -fcxx-modules -Xclang -fmodules-local-submodule-visibility -gmodules
Assertion failed: (D && "missing definition for pattern of instantiated definition"), function hasAcceptableDefinition, file SemaType.cpp, line 9203.
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: /Volumes/External2/repos/upstream-llvm-project/build-clang-bootstrap/./bin/clang++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Volumes/External2/repos/upstream-llvm-project/build-clang-bootstrap/tools/clang/stage2-bins/lib/Support -I/Volumes/External2/repos/upstream-llvm-project/llvm/lib/Support -I/Volumes/External2/repos/upstream-llvm-project/build-clang-bootstrap/tools/clang/stage2-bins/include -I/Volumes/External2/repos/upstream-llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -fdiagnostics-color -O2 -g -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o -c /Volumes/External2/repos/upstream-llvm-project/llvm/lib/Support/StringSaver.cpp -fmodules -fcxx-modules -Xclang -fmodules-local-submodule-visibility -gmodules
1. /Volumes/External2/repos/upstream-llvm-project/llvm/lib/Support/StringSaver.cpp:25:37: current parser token ')'
2. /Volumes/External2/repos/upstream-llvm-project/llvm/lib/Support/StringSaver.cpp:23:45: parsing function body 'llvm::StringSaver::save'
3. /Volumes/External2/repos/upstream-llvm-project/llvm/lib/Support/StringSaver.cpp:23:45: in compound statement ('{}')
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 clang-21 0x0000000105099ac8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 clang-21 0x0000000105097fdc llvm::sys::RunSignalHandlers() + 112
2 clang-21 0x00000001050992c0 llvm::sys::CleanupOnSignal(unsigned long) + 272
3 clang-21 0x0000000104ffd738 CrashRecoverySignalHandler(int) + 156
4 libsystem_platform.dylib 0x0000000194e9f624 _sigtramp + 56
5 libsystem_pthread.dylib 0x0000000194e6588c pthread_kill + 296
6 libsystem_c.dylib 0x0000000194d6eb34 abort + 124
7 libsystem_c.dylib 0x0000000194d6de44 err + 0
8 clang-21 0x0000000107936e50 clang::Sema::RequireLiteralType(clang::SourceLocation, clang::QualType, clang::Sema::TypeDiagnoser&) (.cold.11) + 0
9 clang-21 0x0000000106cdf37c clang::Sema::hasAcceptableDefinition(clang::NamedDecl*, clang::NamedDecl**, clang::Sema::AcceptableKind, bool) + 468
10 clang-21 0x0000000106cdec50 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) + 692
11 clang-21 0x0000000106aa35f0 clang::Sema::CompareReferenceRelationship(clang::SourceLocation, clang::QualType, clang::QualType, clang::Sema::ReferenceConversionsScope::ReferenceConversions*) + 300
12 clang-21 0x0000000106ac6cb4 FindConversionForRefInit(clang::Sema&, clang::ImplicitConversionSequence&, clang::QualType, clang::SourceLocation, clang::Expr*, clang::QualType, bool, bool) + 976
13 clang-21 0x0000000106ac6138 TryReferenceInit(clang::Sema&, clang::Expr*, clang::QualType, clang::SourceLocation, bool, bool) + 644
14 clang-21 0x0000000106aa843c clang::Sema::AddMethodCandidate(clang::CXXMethodDecl*, clang::DeclAccessPair, clang::CXXRecordDecl*, clang::QualType, clang::Expr::Classification, llvm::ArrayRef<clang::Expr*>,
clang::OverloadCandidateSet&, bool, bool, llvm::MutableArrayRef<clang::ImplicitConversionSequence>, clang::OverloadCandidateParamOrder, bool) + 1396
15 clang-21 0x0000000106abea98 clang::Sema::BuildCallToMemberFunction(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool)
+ 2152
16 clang-21 0x0000000106816c4c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) + 84
17 clang-21 0x00000001065450cc clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) + 3808
18 clang-21 0x0000000106546968 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) + 1572
19 clang-21 0x0000000106542f5c clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 244
20 clang-21 0x0000000106542e50 clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 20
21 clang-21 0x000000010659ab58 clang::Parser::ParseReturnStatement() + 324
22 clang-21 0x00000001065958b4 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttribute
s&, clang::ParsedAttributes&) + 3772
23 clang-21 0x00000001065947d8 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) + 324
24 clang-21 0x000000010659c770 clang::Parser::ParseCompoundStatementBody(bool) + 1964
25 clang-21 0x000000010659d408 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 184
26 clang-21 0x00000001065b23e8 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) + 2068
27 clang-21 0x0000000106518bb8 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Par
ser::ForRangeInit*) + 3940
28 clang-21 0x00000001065b1940 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 936
29 clang-21 0x00000001065b1338 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 464
30 clang-21 0x00000001065b07ac clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) + 1580
31 clang-21 0x00000001065af134 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) + 1384
32 clang-21 0x0000000106505f50 clang::ParseAST(clang::Sema&, bool, bool) + 612
33 clang-21 0x0000000105ab8ddc clang::FrontendAction::Execute() + 48
34 clang-21 0x0000000105a57d94 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 900
35 clang-21 0x0000000105b2b8d4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 480
36 clang-21 0x0000000102c59678 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 4272
37 clang-21 0x0000000102c55068 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) + 948
38 clang-21 0x00000001058ea7b8 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char
_traits<char>, std::__1::allocator<char>>*, bool*) const::$_0>(long) + 32
39 clang-21 0x0000000104ffd458 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 164
40 clang-21 0x00000001058ea240 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bo
ol*) const + 228
41 clang-21 0x00000001058bd6c8 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 476
42 clang-21 0x00000001058bd890 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const + 120
43 clang-21 0x00000001058d2f8c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) + 328
44 clang-21 0x0000000102c545f0 clang_main(int, char**, llvm::ToolContext const&) + 4760
45 clang-21 0x0000000102c621c0 main + 88
46 dyld 0x0000000194ac6b4c start + 6000
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 21.0.0git (g...@github.com:llvm/llvm-project.git 1f51038036b4bc216eddcc620dcb9eca5df2bfef)
Target: arm64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /Volumes/External2/repos/upstream-llvm-project/build-clang-bootstrap/bin
Build config: +assertions
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /var/folders/t_/j6y672696bsd2yhrn8rd0wwm0000gn/T/StringSaver-92ef01.cpp
clang++: note: diagnostic msg: /var/folders/t_/j6y672696bsd2yhrn8rd0wwm0000gn/T/StringSaver-92ef01.cache
clang++: note: diagnostic msg: /var/folders/t_/j6y672696bsd2yhrn8rd0wwm0000gn/T/StringSaver-92ef01.sh
clang++: note: diagnostic msg: Crash backtrace is located in
clang++: note: diagnostic msg: /Users/zixu/Library/Logs/DiagnosticReports/clang-21_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang++: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang++: note: diagnostic msg:
********************
```
Bisection pinned to a9e249f64e800fbb20a3b26c0cfb68c1a1aee5e1
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs