[PATCH] D112337: [DebugInfo] Only create concrete DIEs of concrete functions
Jorge Gorbe Moya via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 10 12:12:47 PST 2021
jgorbe added a comment.
Hi, I created the reproducer that akuegel posted above. I have reproduced the crash starting with a clean repo with the steps below. The stack trace is a bit different, but a release build following the same steps will get you a stack trace very similar to what he posted. What I've noticed is that the crash does not always reproduce consistently. I was trying a new release build to double check the steps below, I ran the build command multiple times in a row, and it crashed only sometimes. The crash is a segfault, so it's possible that sometimes an invalid memory access doesn't immediatly crash the program.
$ git checkout f19471a24985a0cbc32b6548c8fce1d2514e8243
$ mkdir ../llvm-new-build
$ cd ../llvm-new-build
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_C_COMPILER=clang-11 -DCMAKE_CXX_COMPILER=clang++-11 -DCMAKE_ASM_COMPILER=clang-11 -DLLVM_ENABLE_LLD=ON ../llvm/llvm
$ ninja
$ cat > repro.ii
class A {
public:
unsigned n;
void Append() {
auto raw_append = [] {};
while (Avail())
;
}
long Avail();
} a;
bool c;
void f(A) { a.Append(); }
$ bin/clang "-cc1" "-triple" "x86_64-grtev4-linux-gnu" -ferror-limit 9999 "-emit-obj" "-debug-info-kind=constructor" "-dwarf-version=5" "-mllvm" "-generate-type-units" "-O3" "-std=gnu++17" "-fgnuc-version=4.2.1" "-fsized-deallocation" "-mllvm" "-disable-binop-extract-shuffle" "-x" "c++" "repro.ii"
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: bin/clang -cc1 -triple x86_64-grtev4-linux-gnu -ferror-limit 9999 -emit-obj -debug-info-kind=constructor -dwarf-version=5 -mllvm -generate-type-units -O3 -std=gnu++17 -fgnuc-version=4.2.1 -fsized-deallocation -mllvm -disable-binop-extract-shuffle -x c++ repro.ii
1. <eof> parser at end of file
2. Code generation
#0 0x000000000a1f60ea llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/Support/Unix/Signals.inc:565:11
#1 0x000000000a1f62bb PrintStackTraceSignalHandler(void*) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/Support/Unix/Signals.inc:632:1
#2 0x000000000a1f489b llvm::sys::RunSignalHandlers() /usr/local/google/home/jgorbe/code/llvm/llvm/lib/Support/Signals.cpp:96:5
#3 0x000000000a1f6a31 SignalHandler(int) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/Support/Unix/Signals.inc:407:1
#4 0x00007fb0702ab8e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x138e0)
#5 0x000000000b9354b0 llvm::PointerIntPair<llvm::IntrusiveBackListNode*, 1u, unsigned int, llvm::PointerLikeTypeTraits<llvm::IntrusiveBackListNode*>, llvm::PointerIntPairInfo<llvm::IntrusiveBackListNode*, 1u, llvm::PointerLikeTypeTraits<llvm::IntrusiveBackListNode*> > >::getPointer() const /usr/local/google/home/jgorbe/code/llvm/llvm/include/llvm/ADT/PointerIntPair.h:59:58
#6 0x000000000b93544a llvm::IntrusiveBackList<llvm::DIEValueList::Node>::begin() /usr/local/google/home/jgorbe/code/llvm/llvm/include/llvm/CodeGen/DIE.h:635:19
#7 0x000000000b935335 llvm::IntrusiveBackList<llvm::DIEValueList::Node>::begin() const /usr/local/google/home/jgorbe/code/llvm/llvm/include/llvm/CodeGen/DIE.h:638:51
#8 0x000000000b934f2c llvm::DIEValueList::values() const /usr/local/google/home/jgorbe/code/llvm/llvm/include/llvm/CodeGen/DIE.h:731:49
#9 0x000000000b934aca llvm::AsmPrinter::emitDwarfDIE(llvm::DIE const&) const /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp:293:28
#10 0x000000000b934d8f llvm::AsmPrinter::emitDwarfDIE(llvm::DIE const&) const /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp:310:22
#11 0x000000000b934d8f llvm::AsmPrinter::emitDwarfDIE(llvm::DIE const&) const /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp:310:22
#12 0x000000000b9f0b92 llvm::DwarfFile::emitUnit(llvm::DwarfUnit*, bool) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp:54:28
#13 0x000000000b9f0a6e llvm::DwarfFile::emitUnits(bool) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp:32:25
#14 0x000000000b95c5ad llvm::DwarfDebug::emitDebugInfo() /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2291:1
#15 0x000000000b95c06c llvm::DwarfDebug::endModule() /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1443:3
#16 0x000000000b917c5c llvm::AsmPrinter::doFinalization(llvm::Module&) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1839:3
#17 0x000000000949cc8a llvm::FPPassManager::doFinalization(llvm::Module&) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/IR/LegacyPassManager.cpp:1503:16
#18 0x0000000009498494 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/IR/LegacyPassManager.cpp:1590:16
#19 0x0000000009497cd8 llvm::legacy::PassManagerImpl::run(llvm::Module&) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/IR/LegacyPassManager.cpp:542:16
#20 0x000000000949ce61 llvm::legacy::PassManager::run(llvm::Module&) /usr/local/google/home/jgorbe/code/llvm/llvm/lib/IR/LegacyPassManager.cpp:1681:3
#21 0x000000000a6ba76f (anonymous namespace)::EmitAssemblyHelper::RunCodegenPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile> >&) /usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen/BackendUtil.cpp:1502:1
#22 0x000000000a6b2962 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen/BackendUtil.cpp:1533:7
#23 0x000000000a6b1124 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen/BackendUtil.cpp:1693:5
#24 0x000000000b4a146b clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen/CodeGenAction.cpp:370:7
#25 0x000000000dceeeee clang::ParseAST(clang::Sema&, bool, bool) /usr/local/google/home/jgorbe/code/llvm/clang/lib/Parse/ParseAST.cpp:178:12
#26 0x000000000b2bac72 clang::ASTFrontendAction::ExecuteAction() /usr/local/google/home/jgorbe/code/llvm/clang/lib/Frontend/FrontendAction.cpp:1076:1
#27 0x000000000b49cb0b clang::CodeGenAction::ExecuteAction() /usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen/CodeGenAction.cpp:1108:5
#28 0x000000000b2ba638 clang::FrontendAction::Execute() /usr/local/google/home/jgorbe/code/llvm/clang/lib/Frontend/FrontendAction.cpp:971:7
#29 0x000000000b1ee852 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /usr/local/google/home/jgorbe/code/llvm/clang/lib/Frontend/CompilerInstance.cpp:1030:23
#30 0x000000000b4897c9 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /usr/local/google/home/jgorbe/code/llvm/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:261:8
#31 0x000000000681bd7d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /usr/local/google/home/jgorbe/code/llvm/clang/tools/driver/cc1_main.cpp:246:13
#32 0x000000000680e678 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /usr/local/google/home/jgorbe/code/llvm/clang/tools/driver/driver.cpp:317:5
#33 0x000000000680d692 main /usr/local/google/home/jgorbe/code/llvm/clang/tools/driver/driver.cpp:388:5
#34 0x00007fb06fd30e4a __libc_start_main ./csu/../csu/libc-start.c:314:16
#35 0x000000000680ceba _start (bin/clang+0x680ceba)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112337/new/
https://reviews.llvm.org/D112337
More information about the llvm-commits
mailing list