[llvm-bugs] [Bug 37255] New: Assertion failed:`DeclDie && "This DIE should've already been constructed when the " "definition DIE was created in " "getOrCreateSubprogramDIE"'

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 26 09:40:38 PDT 2018


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

            Bug ID: 37255
           Summary: Assertion failed:`DeclDie && "This DIE should've
                    already been constructed when the " "definition DIE
                    was created in " "getOrCreateSubprogramDIE"'
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: lto
          Assignee: unassignedbugs at nondot.org
          Reporter: yunlian at chromium.org
                CC: llvm-bugs at lists.llvm.org

When working on enabling debug fission with thinlto, I hit this assertion.

Steps to reproduce it.
Apply the patch below to clang.

--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -1136,6 +1136,8 @@ static void runThinLTOBackend(ModuleSummaryIndex
*CombinedIndex, Module *M,
   Conf.SampleProfile = std::move(SampleProfile);
   Conf.UseNewPM = CGOpts.ExperimentalNewPassManager;
   Conf.DebugPassManager = CGOpts.DebugPassManager;
+  Conf.DwoDir="./dis_dwo";
+  Conf.Objcopy="/usr/bin/objcopy";
   switch (Action) {
   case Backend_EmitNothing:
     Conf.PreCodeGenModuleHook = [](size_t Task, const Module &Mod) {


After that, run

clang-7 -cc1 -triple thumbv7-cros-linux-gnueabi -emit-obj -mrelax-all
-fthinlto-index=obj/third_party/blink/renderer/platform/wtf/wtf/fast-dtoa.o.thinlto.bc
-disable-free -main-file-name fast-dtoa.o -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu generic -target-abi
aapcs-linux -mfloat-abi hard -fallow-half-arguments-and-returns
-dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/usr/local/google/home/yunlian/dwp/build/tt/a.gcno -resource-dir
/usr/local/google/home/yunlian/dwp/build/lib/clang/7.0.0
-fdebug-compilation-dir /usr/local/google/home/yunlian/dwp/build/tt
-ferror-limit 19 -fmessage-length 153 -fno-signed-char -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o a.o -x ir
obj/third_party/blink/renderer/platform/wtf/wtf/fast-dtoa.o 

The backtrace is

  0x00007ffff675efcf in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff67603fa in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff6757e37 in __assert_fail_base () from
/lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff6757ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x000055555a0e1e9d in llvm::DwarfUnit::applySubprogramDefinitionAttributes
(this=0x55556311f8e0, SP=0x555563001a70, SPDie=...)
    at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1231
#5  0x000055555a0e22a6 in llvm::DwarfUnit::applySubprogramAttributes
(this=0x55556311f8e0, SP=0x555563001a70, SPDie=..., SkipSPAttributes=true)
    at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1275
#6  0x000055555a14d13d in
llvm::DwarfCompileUnit::applySubprogramAttributesToDefinition
(this=0x55556311f8e0, SP=0x555563001a70, SPDie=...)
    at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1001
#7  0x000055555a14bd1f in
llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE
(this=0x55556311f8e0, Scope=0x555562fccf20)
    at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:755
#8  0x000055555a09e79f in llvm::DwarfDebug::constructAbstractSubprogramScopeDIE
(this=0x555562fbf550, SrcCU=..., Scope=0x555562fccf20)
    at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:464
#9  0x000055555a0a344f in llvm::DwarfDebug::endFunctionImpl
(this=0x555562fbf550, MF=0x555562fe7070) at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1406
#10 0x000055555a1416b1 in llvm::DebugHandlerBase::endFunction
(this=0x555562fbf550, MF=0x555562fe7070)
    at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:294
#11 0x000055555a07eded in llvm::AsmPrinter::EmitFunctionBody
(this=0x555562fcd970) at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1177
#12 0x00005555578d83f6 in llvm::ARMAsmPrinter::runOnMachineFunction
(this=0x555562fcd970, MF=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/Target/ARM/ARMAsmPrinter.cpp:161
#13 0x00005555589600cb in llvm::MachineFunctionPass::runOnFunction
(this=0x555562fcd970, F=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/CodeGen/MachineFunctionPass.cpp:62
#14 0x0000555558dcf7df in llvm::FPPassManager::runOnFunction
(this=0x555562faaad0, F=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/IR/LegacyPassManager.cpp:1520
#15 0x0000555558dcf960 in llvm::FPPassManager::runOnModule
(this=0x555562faaad0, M=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/IR/LegacyPassManager.cpp:1541
#16 0x0000555558dcfcb1 in (anonymous namespace)::MPPassManager::runOnModule
(this=0x555562fcd6e0, M=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/IR/LegacyPassManager.cpp:1597
#17 0x0000555558dd0381 in llvm::legacy::PassManagerImpl::run
(this=0x555563070a40, M=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/IR/LegacyPassManager.cpp:1700
#18 0x0000555558dd0579 in llvm::legacy::PassManager::run (this=0x7fffffff98c0,
M=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/IR/LegacyPassManager.cpp:1731
#19 0x000055555a407566 in (anonymous namespace)::codegenWithSplitDwarf
(Conf=..., TM=0x55556263bc00, AddStream=..., Task=0, Mod=...)
    at /usr/local/google/home/yunlian/dwp/llvm/lib/LTO/LTOBackend.cpp:307
#20 0x000055555a407f5a in (anonymous namespace)::codegen (Conf=...,
TM=0x55556263bc00, AddStream=..., Task=0, Mod=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/LTO/LTOBackend.cpp:350
#21 0x000055555a4093e4 in llvm::lto::thinBackend(llvm::lto::Config&, unsigned
int, std::function<std::unique_ptr<llvm::lto::NativeObjectStream,
std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>,
llvm::Module&, llvm::ModuleSummaryIndex const&,
llvm::StringMap<std::map<unsigned long, unsigned int, std::less<unsigned long>,
std::allocator<std::pair<unsigned long const, unsigned int> > >,
llvm::MallocAllocator> const&, llvm::DenseMap<unsigned long,
llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>,
llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&,
llvm::MapVector<llvm::StringRef, llvm::BitcodeModule,
llvm::DenseMap<llvm::StringRef, unsigned int,
llvm::DenseMapInfo<llvm::StringRef>,
llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >,
std::vector<std::pair<llvm::StringRef, llvm::BitcodeModule>,
std::allocator<std::pair<llvm::StringRef, llvm::BitcodeModule> > > >&)
(Conf=..., Task=0, 
    AddStream=..., Mod=..., CombinedIndex=..., ImportList=...,
DefinedGlobals=..., ModuleMap=...) at
/usr/local/google/home/yunlian/dwp/llvm/lib/LTO/LTOBackend.cpp:546
#22 0x000055555980c843 in runThinLTOBackend (CombinedIndex=0x55556228dfe0,
M=0x555562285b30, HeaderOpts=..., CGOpts=..., TOpts=..., LOpts=..., 
    OS=std::unique_ptr<llvm::raw_pwrite_stream> = {...}, SampleProfile="",
Action=clang::Backend_EmitObj)
    at
/usr/local/google/home/yunlian/dwp/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1165
#23 0x000055555980cc04 in clang::EmitBackendOutput (Diags=..., HeaderOpts=...,
CGOpts=..., TOpts=..., LOpts=..., TDesc=..., M=0x555562285b30,
Action=clang::Backend_EmitObj, 
    OS=std::unique_ptr<llvm::raw_pwrite_stream> = {...}) at
/usr/local/google/home/yunlian/dwp/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1200
#24 0x000055555a3b1f1b in clang::CodeGenAction::ExecuteAction
(this=0x5555622751e0) at
/usr/local/google/home/yunlian/dwp/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1035
#25 0x0000555559ede8a5 in clang::FrontendAction::Execute (this=0x5555622751e0)
at
/usr/local/google/home/yunlian/dwp/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:904
#26 0x0000555559e70f57 in clang::CompilerInstance::ExecuteAction
(this=0x555562272e

-- 
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/20180426/7208a7b1/attachment-0001.html>


More information about the llvm-bugs mailing list