[llvm-bugs] [Bug 48277] New: AF: `(isUnknownLocation() || isRegisterLocation()) && "location description already locked down"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 23 18:53:33 PST 2020


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

            Bug ID: 48277
           Summary: AF: `(isUnknownLocation() || isRegisterLocation()) &&
                    "location description already locked down"' failed
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24199
  --> https://bugs.llvm.org/attachment.cgi?id=24199&action=edit
repro.cpp

We saw a new compiler crash in several of our internal test suites today which
I bisected down to commit 6ef7835afca246e623e9990dcd8c71204f5691e5.

Compiling the attached source code on x86_64 linux with a compiler built from
the above commit with optimizations and debug info (-O2 -g) results in an
assertion failure in the compiler being hit:

clang:
/home/dyung/src/upstream/llvm_clean_git/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:45:
void llvm::DwarfExpression::addReg(int, const char *): Assertion
`(isUnknownLocation() || isRegisterLocation()) && "location description already
locked down"' 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:
/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang
-c -g -O2 repro.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'repro.cpp'.
4.      Running pass 'X86 Assembly Printer' on function '@_Z3fn1v'
 #0 0x0000000005471573 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5471573)
 #1 0x000000000546f37e llvm::sys::RunSignalHandlers()
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x546f37e)
 #2 0x000000000547091d llvm::sys::CleanupOnSignal(unsigned long)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x547091d)
 #3 0x00000000053ecc83 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x53ecc83)
 #4 0x00000000053ecdee CrashRecoverySignalHandler(int)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x53ecdee)
 #5 0x00007f459b2613c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #6 0x00007f459ad1218b raise
/build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #7 0x00007f459acf1859 abort /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81:7
 #8 0x00007f459acf1729 get_sysdep_segment_value
/build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:509:8
 #9 0x00007f459acf1729 _nl_load_domain
/build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:970:34
#10 0x00007f459ad02f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#11 0x0000000006152c20
llvm::DwarfExpression::addMachineRegExpression(llvm::TargetRegisterInfo const&,
llvm::DIExpressionCursor&, llvm::Register, unsigned int)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x6152c20)
#12 0x0000000006124c05 llvm::DwarfDebug::emitDebugLocValue(llvm::AsmPrinter
const&, llvm::DIBasicType const*, llvm::DbgValueLoc const&,
llvm::DwarfExpression&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x6124c05)
#13 0x0000000006122141 llvm::DebugLocEntry::finalize(llvm::AsmPrinter const&,
llvm::DebugLocStream::ListBuilder&, llvm::DIBasicType const*,
llvm::DwarfCompileUnit&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x6122141)
#14 0x00000000061214ba
llvm::DwarfDebug::collectEntityInfo(llvm::DwarfCompileUnit&, llvm::DISubprogram
const*, llvm::DenseSet<std::pair<llvm::DINode const*, llvm::DILocation const*>,
llvm::DenseMapInfo<std::pair<llvm::DINode const*, llvm::DILocation const*> >
>&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x61214ba)
#15 0x0000000006122f5c llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction
const*)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x6122f5c)
#16 0x0000000006109bce
llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x6109bce)
#17 0x00000000060f5f7c llvm::AsmPrinter::emitFunctionBody()
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x60f5f7c)
#18 0x00000000041e7e06
llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x41e7e06)
#19 0x00000000048b1a7e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x48b1a7e)
#20 0x0000000004cd2b68 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x4cd2b68)
#21 0x0000000004cd9618 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x4cd9618)
#22 0x0000000004cd3217 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x4cd3217)
#23 0x00000000056b5701 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x56b5701)
#24 0x0000000005e6cfd6
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5e6cfd6)
#25 0x0000000006f2dc63 clang::ParseAST(clang::Sema&, bool, bool)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x6f2dc63)
#26 0x0000000005db54e3 clang::FrontendAction::Execute()
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5db54e3)
#27 0x0000000005d0c6b2
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5d0c6b2)
#28 0x0000000005e67032
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5e67032)
#29 0x000000000344e3e1 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x344e3e1)
#30 0x000000000344c10c ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x344c10c)
#31 0x0000000005ba5512 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::$_1>(long)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5ba5512)
#32 0x00000000053ecba1
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x53ecba1)
#33 0x0000000005ba4b29
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5ba4b29)
#34 0x0000000005b6c684
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5b6c684)
#35 0x0000000005b6cbca
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5b6cbca)
#36 0x0000000005b86508
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x5b86508)
#37 0x000000000344b8c4 main
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x344b8c4)
#38 0x00007f459acf30b3 __libc_start_main
/build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:342:3
#39 0x0000000003448d9e _start
(/home/dyung/src/upstream/6ef7835afca246e623e9990dcd8c71204f5691e5-linux/bin/clang+0x3448d9e)
clang-12: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
6ef7835afca246e623e9990dcd8c71204f5691e5)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
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/20201124/16ae2494/attachment-0001.html>


More information about the llvm-bugs mailing list