[llvm-bugs] [Bug 50592] New: Assertion `(ID || !Mod) && "asked for module ID for non-local, non-imported module"' failed
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Jun 5 22:41:41 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50592
Bug ID: 50592
Summary: Assertion `(ID || !Mod) && "asked for module ID for
non-local, non-imported module"' failed
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++2a
Assignee: unassignedclangbugs at nondot.org
Reporter: davidfromonline 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
Compiling the following translation unit
```
#include <type_traits>
```
with `clang++ -std=c++20 -stdlib=libc++ -fmodules`
causes clang to crash with
```
clang++: /root/llvm-project/clang/lib/Serialization/ASTWriter.cpp:2502:
unsigned int clang::ASTWriter::getSubmoduleID(clang::Module*): Assertion `(ID
|| !Mod) && "asked for module ID for non-local, non-imported module"' failed.
clang++: /root/llvm-project/llvm/include/llvm/Bitstream/BitstreamWriter.h:124:
llvm::BitstreamWriter::~BitstreamWriter(): Assertion `BlockScope.empty() &&
CurAbbrevs.empty() && "Block imbalance"' 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:
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -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 -stdlib=libc++ -fmodules <source>
1. <source>:1:2: current parser token 'include'
#0 0x000055d922ec2a6f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x000055d922ec0890 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x378b890)
#2 0x000055d922e107a8 CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
#3 0x00007f2869ffe3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x00007f2869ace18b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4618b)
#5 0x00007f2869aad859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25859)
#6 0x00007f2869aad729 (/lib/x86_64-linux-gnu/libc.so.6+0x25729)
#7 0x00007f2869abef36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#8 0x000055d9239babe0 clang::PCHGenerator::~PCHGenerator()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4285be0)
#9 0x000055d9239bac09 clang::PCHGenerator::~PCHGenerator()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4285c09)
#10 0x000055d9237fc7f2 clang::MultiplexConsumer::~MultiplexConsumer()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40c77f2)
#11 0x000055d92376a9ea clang::CompilerInstance::~CompilerInstance()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40359ea)
#12 0x000055d92376fb02 compileModuleImpl(clang::CompilerInstance&,
clang::SourceLocation, llvm::StringRef, clang::FrontendInputFile,
llvm::StringRef, llvm::StringRef, llvm::function_ref<void
(clang::CompilerInstance&)>, llvm::function_ref<void
(clang::CompilerInstance&)>) CompilerInstance.cpp:0:0
#13 0x000055d923772fac
clang::CompilerInstance::findOrCompileModuleAndReadAST(llvm::StringRef,
clang::SourceLocation, clang::SourceLocation, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x403dfac)
#14 0x000055d923773c1e
clang::CompilerInstance::loadModule(clang::SourceLocation,
llvm::ArrayRef<std::pair<clang::IdentifierInfo*, clang::SourceLocation> >,
clang::Module::NameVisibilityKind, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x403ec1e)
#15 0x000055d925e680aa
clang::Preprocessor::HandleHeaderIncludeOrImport(clang::SourceLocation,
clang::Token&, clang::Token&, clang::SourceLocation, clang::DirectoryLookup
const*, clang::FileEntry const*)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67330aa)
#16 0x000055d925e69216
clang::Preprocessor::HandleIncludeDirective(clang::SourceLocation,
clang::Token&, clang::DirectoryLookup const*, clang::FileEntry const*)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6734216)
#17 0x000055d925e6c98b clang::Preprocessor::HandleDirective(clang::Token&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x673798b)
#18 0x000055d925e33801 clang::Lexer::LexTokenInternal(clang::Token&, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66fe801)
#19 0x000055d925e35856 clang::Lexer::Lex(clang::Token&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6700856)
#20 0x000055d925e9feb7 clang::Preprocessor::Lex(clang::Token&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x676aeb7)
#21 0x000055d924d2f7c2 clang::Parser::ConsumeToken()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x55fa7c2)
#22 0x000055d924d2e35f clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x55f935f)
#23 0x000055d923e6bc88 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4736c88)
#24 0x000055d9237cd101 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4098101)
#25 0x000055d9237699ca
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40349ca)
#26 0x000055d92389a5fa
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x41655fa)
#27 0x000055d920ab799c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x138299c)
#28 0x000055d920ab2d39 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#29 0x000055d92361cca5 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) Job.cpp:0:0
#30 0x000055d922e10d93
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x36dbd93)
#31 0x000055d92361ee54
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ee9e54)
#32 0x000055d9235f565a
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ec065a)
#33 0x000055d9235f62ff
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ec12ff)
#34 0x000055d9235ffbaa
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ecabaa)
#35 0x000055d9209e1888 main
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x12ac888)
#36 0x00007f2869aaf0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#37 0x000055d920ab28aa _start
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x137d8aa)
clang-13: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
Compiler returned: 134
```
This failure was introduced by
https://github.com/llvm/llvm-project/commit/f1417eb9b1f51b689c78dd8cb0114c1749dd2845
See it live: https://godbolt.org/z/sja1fqvxY
--
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/20210606/30918f79/attachment.html>
More information about the llvm-bugs
mailing list