[llvm-bugs] [Bug 46274] New: Crash when building module "should not perform lookups into transparent contexts"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 10 21:51:08 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46274

            Bug ID: 46274
           Summary: Crash when building module "should not perform lookups
                    into transparent contexts"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mwasplund at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Created attachment 23599
  --> https://bugs.llvm.org/attachment.cgi?id=23599&action=edit
Archive of the repro files and script

I see there is a similar bug (27186) but it is old and says it is already
fixed, but latest build has repro.

Running the attached archive script ./build-linux causes latest clang++ to
crash.

Linux Build!
clang++: /mnt/d/Repos/llvm-project/clang/lib/AST/DeclBase.cpp:1630:
clang::DeclContext::lookup_result
clang::DeclContext::lookup(clang::DeclarationName) const: Assertion
`getDeclKind() != Decl::LinkageSpec && getDeclKind() != Decl::Export && "should
not perform lookups into transparent contexts"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /mnt/d/Repos/llvm-project/build-linux/bin/clang++
-DSOUP_BUILD -std=c++2a -fmodules-ts --precompile toml.cppm -o
out/obj/Clang/toml11.pcm
1.      ./toml/value.hpp:1666:31: current parser token 'array_type'
2.      ./toml/value.hpp:18:1: parsing namespace 'toml'
3.      ./toml/value.hpp:248:7: instantiating class definition
'toml::basic_value<toml::discard_comments, std::unordered_map, std::vector>'
 #0 0x00007f9b60470dd3 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/mnt/d/Repos/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:0
 #1 0x00007f9b60470e66 PrintStackTraceSignalHandler(void*)
/mnt/d/Repos/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:0
 #2 0x00007f9b6046ec01 llvm::sys::RunSignalHandlers()
/mnt/d/Repos/llvm-project/llvm/lib/Support/Signals.cpp:68:0
 #3 0x00007f9b60470612 llvm::sys::CleanupOnSignal(unsigned long)
/mnt/d/Repos/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:0
 #4 0x00007f9b6036de6e (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/mnt/d/Repos/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:77:0
 #5 0x00007f9b6036e346 CrashRecoverySignalHandler(int)
/mnt/d/Repos/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:383:0
 #6 0x00007f9b5a9f2890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #7 0x00007f9b59a6ee97 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3ee97)
 #8 0x00007f9b59a70801 abort (/lib/x86_64-linux-gnu/libc.so.6+0x40801)
 #9 0x00007f9b59a6039a (/lib/x86_64-linux-gnu/libc.so.6+0x3039a)
#10 0x00007f9b59a60412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#11 0x00007f9b643e431b clang::DeclContext::lookup(clang::DeclarationName) const
/mnt/d/Repos/llvm-project/clang/lib/AST/DeclBase.cpp:1628:0
#12 0x00007f9b638d4252 LookupDirect(clang::Sema&, clang::LookupResult&,
clang::DeclContext const*)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaLookup.cpp:1039:0
#13 0x00007f9b638d7997 clang::Sema::LookupQualifiedName(clang::LookupResult&,
clang::DeclContext*, bool)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaLookup.cpp:2251:0
#14 0x00007f9b63d333e7
clang::TemplateDeclInstantiator::VisitClassTemplateDecl(clang::ClassTemplateDecl*)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1396:0
#15 0x00007f9b63d228a9 clang::declvisitor::Base<std::add_pointer,
clang::TemplateDeclInstantiator, clang::Decl*>::Visit(clang::Decl*)
/mnt/d/Repos/llvm-project/build-linux/tools/clang/include/clang/AST/DeclNodes.inc:207:0
#16 0x00007f9b63d3229d
clang::TemplateDeclInstantiator::VisitFriendDecl(clang::FriendDecl*)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1156:0
#17 0x00007f9b63d226f9 clang::declvisitor::Base<std::add_pointer,
clang::TemplateDeclInstantiator, clang::Decl*>::Visit(clang::Decl*)
/mnt/d/Repos/llvm-project/build-linux/tools/clang/include/clang/AST/DeclNodes.inc:71:0
#18 0x00007f9b63cd9c27 clang::Sema::InstantiateClass(clang::SourceLocation,
clang::CXXRecordDecl*, clang::CXXRecordDecl*,
clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind, bool)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:2708:0
#19 0x00007f9b63cdb89f
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:3178:0
#20 0x00007f9b63dd307b
clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType,
clang::Sema::CompleteTypeKind,
clang::Sema::TypeDiagnoser*)::'lambda'()::operator()() const
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaType.cpp:8498:0
#21 0x00007f9b63dd8b51 void llvm::function_ref<void
()>::callback_fn<clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation,
clang::QualType, clang::Sema::CompleteTypeKind,
clang::Sema::TypeDiagnoser*)::'lambda'()>(long)
/mnt/d/Repos/llvm-project/llvm/include/llvm/ADT/STLExtras.h:186:0
#22 0x00007f9b60362a1c llvm::function_ref<void ()>::operator()() const
/mnt/d/Repos/llvm-project/llvm/include/llvm/ADT/STLExtras.h:203:0
#23 0x00007f9b6317d9fe
clang::runWithSufficientStackSpace(llvm::function_ref<void ()>,
llvm::function_ref<void ()>)
/mnt/d/Repos/llvm-project/clang/include/clang/Basic/Stack.h:52:0
#24 0x00007f9b6316e769
clang::Sema::runWithSufficientStackSpace(clang::SourceLocation,
llvm::function_ref<void ()>)
/mnt/d/Repos/llvm-project/clang/lib/Sema/Sema.cpp:432:0
#25 0x00007f9b63dd3848
clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType,
clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaType.cpp:8502:0
#26 0x00007f9b63dd275c clang::Sema::RequireCompleteType(clang::SourceLocation,
clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaType.cpp:8245:0
#27 0x00007f9b631bf384 clang::Sema::RequireCompleteType(clang::SourceLocation,
clang::QualType, clang::Sema::TypeDiagnoser&)
/mnt/d/Repos/llvm-project/clang/include/clang/Sema/Sema.h:1932:0
#28 0x00007f9b631bf91a bool
clang::Sema::RequireCompleteType<clang::SourceRange>(clang::SourceLocation,
clang::QualType, unsigned int, clang::SourceRange const&)
/mnt/d/Repos/llvm-project/clang/include/clang/Sema/Sema.h:1941:0
#29 0x00007f9b631bb04c
clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&,
clang::DeclContext*)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaCXXScopeSpec.cpp:224:0
#30 0x00007f9b63b23ab2
clang::Sema::CheckTypenameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const&, clang::SourceLocation, bool)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaTemplate.cpp:10370:0
#31 0x00007f9b63b23770
clang::Sema::CheckTypenameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const&, clang::SourceLocation, clang::TypeSourceInfo**, bool)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaTemplate.cpp:10321:0
#32 0x00007f9b63b22b3f clang::Sema::ActOnTypenameType(clang::Scope*,
clang::SourceLocation, clang::CXXScopeSpec const&, clang::IdentifierInfo
const&, clang::SourceLocation)
/mnt/d/Repos/llvm-project/clang/lib/Sema/SemaTemplate.cpp:10173:0
#33 0x00007f9b6303ddfe clang::Parser::TryAnnotateTypeOrScopeToken()
/mnt/d/Repos/llvm-project/clang/lib/Parse/Parser.cpp:1868:0
#34 0x00007f9b6306116c
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDecl.cpp:4010:0
#35 0x00007f9b6305b71e
clang::Parser::ParseSpecifierQualifierList(clang::DeclSpec&,
clang::AccessSpecifier, clang::Parser::DeclSpecContext)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDecl.cpp:2496:0
#36 0x00007f9b630501a2 clang::Parser::ParseTypeName(clang::SourceRange*,
clang::DeclaratorContext, clang::AccessSpecifier, clang::Decl**,
clang::ParsedAttributes*)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDecl.cpp:56:0
#37 0x00007f9b6307b64a
clang::Parser::ParseAliasDeclarationAfterDeclarator(clang::Parser::ParsedTemplateInfo
const&, clang::SourceLocation, clang::Parser::UsingDeclarator&,
clang::SourceLocation&, clang::AccessSpecifier, clang::ParsedAttributes&,
clang::Decl**) /mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:841:0
#38 0x00007f9b6307ab83
clang::Parser::ParseUsingDeclaration(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation,
clang::SourceLocation&, clang::AccessSpecifier)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:711:0
#39 0x00007f9b6307a177
clang::Parser::ParseUsingDirectiveOrDeclaration(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:505:0
#40 0x00007f9b63058a60
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDecl.cpp:1774:0
#41 0x00007f9b63039e6f
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/mnt/d/Repos/llvm-project/clang/lib/Parse/Parser.cpp:870:0
#42 0x00007f9b63079043
clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo,
4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&,
clang::BalancedDelimiterTracker&)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:244:0
#43 0x00007f9b63078e4c clang::Parser::ParseNamespace(clang::DeclaratorContext,
clang::SourceLocation&, clang::SourceLocation)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:227:0
#44 0x00007f9b63058a22
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseDecl.cpp:1771:0
#45 0x00007f9b63039e6f
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/mnt/d/Repos/llvm-project/clang/lib/Parse/Parser.cpp:870:0
#46 0x00007f9b630394ba
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/mnt/d/Repos/llvm-project/clang/lib/Parse/Parser.cpp:685:0
#47 0x00007f9b630351d8 clang::ParseAST(clang::Sema&, bool, bool)
/mnt/d/Repos/llvm-project/clang/lib/Parse/ParseAST.cpp:157:0
#48 0x00007f9b6102c085 clang::ASTFrontendAction::ExecuteAction()
/mnt/d/Repos/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1060:0
#49 0x00007f9b6102b9e6 clang::FrontendAction::Execute()
/mnt/d/Repos/llvm-project/clang/lib/Frontend/FrontendAction.cpp:957:0
#50 0x00007f9b60fc08c4
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/mnt/d/Repos/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:973:0
#51 0x00007f9b611a4c0d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/mnt/d/Repos/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:282:0
#52 0x00007f9b5d8ace22 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /mnt/d/Repos/llvm-project/clang/tools/driver/cc1_main.cpp:240:0
#53 0x00007f9b5d8a2426 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/mnt/d/Repos/llvm-project/clang/tools/driver/driver.cpp:330:0
#54 0x00007f9b60ebe53f
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()::operator()() const
/mnt/d/Repos/llvm-project/clang/lib/Driver/Job.cpp:417:0
#55 0x00007f9b60ebedb8 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long)
/mnt/d/Repos/llvm-project/llvm/include/llvm/ADT/STLExtras.h:186:0
#56 0x00007f9b60362a1c llvm::function_ref<void ()>::operator()() const
/mnt/d/Repos/llvm-project/llvm/include/llvm/ADT/STLExtras.h:203:0
#57 0x00007f9b6036e545
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
/mnt/d/Repos/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:419:0
#58 0x00007f9b60ebe763
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
/mnt/d/Repos/llvm-project/clang/lib/Driver/Job.cpp:417:0
#59 0x00007f9b60e75a28
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
/mnt/d/Repos/llvm-project/clang/lib/Driver/Compilation.cpp:195:0
#60 0x00007f9b60e75d80
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
/mnt/d/Repos/llvm-project/clang/lib/Driver/Compilation.cpp:246:0
#61 0x00007f9b60e8520a
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
/mnt/d/Repos/llvm-project/clang/lib/Driver/Driver.cpp:1483:0
#62 0x00007f9b5d8a3406 main
/mnt/d/Repos/llvm-project/clang/tools/driver/driver.cpp:502:0
#63 0x00007f9b59a51b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#64 0x00007f9b5d8a0aaa _start
(/mnt/d/Repos/llvm-project/build-linux/bin/clang+++0x28a0aaa)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
a27d3852095a461b739da534ddc9abfb625f2e06)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /mnt/d/Repos/llvm-project/build-linux/bin
clang-11: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-11: note: diagnostic msg: /tmp/toml-ea7751.cppm
clang-11: note: diagnostic msg: /tmp/toml-ea7751.sh
clang-11: note: diagnostic msg:

********************
clang-11: error: no such file or directory: 'out/obj/Clang/toml11.pcm'
clang-11: error: no input files

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200611/11d67cd7/attachment-0001.html>


More information about the llvm-bugs mailing list