llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

crash in LiveDebugVariables inside LexicalScopes::initialize

Open llvmbot opened this issue 11 years ago • 2 comments

Bugzilla Link 22652
Version trunk
OS Linux
Attachments input bitcode file associated with bug
Reporter LLVM Bugzilla Contributor
CC @dwblaikie,@wolfy1961

Extended Description

"clang" crashes with this command line on the attach test.c

... build/Debug+Asserts/bin/clang -O2 -S -o test.s -x ir test.bc

and produces this stack trace:

clang: /home/dcallahan/llvm-trunk/llvm/lib/CodeGen/LexicalScopes.cpp:170: llvm::LexicalScope* llvm::LexicalS
copes::getOrCreateRegularScope(llvm::MDNode*): Assertion `DISubprogram(Scope).describes(MF->getFunction())'
failed. 0 clang 0x000000000437f53c llvm::sys::PrintStackTrace(_IO_FILE*) + 38 1 clang 0x000000000437f7d7 2 clang 0x000000000437e498 3 libpthread.so.0 0x00007f696213d710 4 libc.so.6 0x00007f6961526625 gsignal + 53 5 libc.so.6 0x00007f6961527e05 abort + 373 6 libc.so.6 0x00007f696151f74e 7 libc.so.6 0x00007f696151f810 __assert_perror_fail + 0 8 clang 0x0000000003a1b1f0 llvm::LexicalScopes::getOrCreateRegularScope(llvm::MDNode*) + 746 9 clang 0x0000000003a1af04 llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DebugLoc) + 176 10 clang 0x0000000003a1b089 llvm::LexicalScopes::getOrCreateRegularScope(llvm::MDNode*) + 387 11 clang 0x0000000003a1af04 llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DebugLoc) + 176 12 clang 0x0000000003a1b3b0 llvm::LexicalScopes::getOrCreateInlinedScope(llvm::MDNode*, llvm::MDNo
de*) + 268 13 clang 0x0000000003a1aeef llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DebugLoc) + 155 14 clang 0x0000000003a1b3b0 llvm::LexicalScopes::getOrCreateInlinedScope(llvm::MDNode*, llvm::MDNo
de*) + 268 15 clang 0x0000000003a1aeef llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DebugLoc) + 155 16 clang 0x0000000003a1aa60 llvm::LexicalScopes::extractLexicalScopes(llvm::SmallVectorImpl<std::p
air<llvm::MachineInstr const*, llvm::MachineInstr const*> >&, llvm::DenseMap<llvm::MachineInstr const*, llvm
::LexicalScope*, llvm::DenseMapInfo<llvm::MachineInstr const*>, llvm::detail::DenseMapPair<llvm::MachineInst
r const*, llvm::LexicalScope*> >&) + 452 17 clang 0x0000000003a1a834 llvm::LexicalScopes::initialize(llvm::MachineFunction const&) + 112 18 clang 0x0000000003bf4388 19 clang 0x0000000003bf4631 llvm::LiveDebugVariables::runOnMachineFunction(llvm::MachineFunction&)\

  • 185 20 clang 0x0000000003a80419 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 95 21 clang 0x00000000042cf850 llvm::FPPassManager::runOnFunction(llvm::Function&) + 290 22 clang 0x00000000042cf9c0 llvm::FPPassManager::runOnModule(llvm::Module&) + 84 23 clang 0x00000000042cfd14 24 clang 0x00000000042d03c2 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 244 25 clang 0x00000000042d05e1 llvm::legacy::PassManager::run(llvm::Module&) + 39 26 clang 0x00000000015fdf21 27 clang 0x00000000015fdff3 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOpti
    ons const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::B
    ackendAction, llvm::raw_ostream*) + 127 28 clang 0x00000000015e1c0e clang::CodeGenAction::ExecuteAction() + 1318 29 clang 0x00000000012f47ff clang::FrontendAction::Execute() + 139 30 clang 0x00000000012ba1be clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 770 31 clang 0x000000000127c264 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1102 32 clang 0x0000000001268439 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 689 33 clang 0x0000000001275b1e 34 clang 0x00000000012760d6 main + 1027 35 libc.so.6 0x00007f6961512d5d __libc_start_main + 253 36 clang 0x0000000001266c19 Stack dump:

llvmbot avatar Feb 21 '15 00:02 llvmbot

// Not sure if this helps but r228052 produced the same crash, // which was fixed by r228053 (calls with default arguments with // default arguments). // clang -c -g -O2 -target x86_64-linux-pc test.cpp

template struct S { void m_fn1(C * = new C) { static C a; } S() { m_fn1(); } C c; };

template struct A { A(int = 0); }; S<A > b;

// really need the source to figure out if it's the same problem.

wolfy1961 avatar Feb 27 '15 02:02 wolfy1961

Source code for the reproduction (& minimized source code, if possible) would be helpful. It's tricky to reduce debug info test cases in bc/ir.

dwblaikie avatar Feb 21 '15 03:02 dwblaikie