[llvm-bugs] [Bug 43661] New: -gmodules -gpubnames together cause a crash

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 13 07:34:28 PDT 2019


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

            Bug ID: 43661
           Summary: -gmodules -gpubnames together cause a crash
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: l.lunak at centrum.cz
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Using together -gmodules and -gpubnames may lead to a nullptr crash (or
infinite loop if Clang is built with -O2).

Steps to reproduce:

See the attached archive, run a.sh . Removing either -gmodule or -gpubnames
avoids the problem.

Relevant part of backtrace:

 #3 0x00007ff64b14b300 __restore_rt (/lib64/libpthread.so.0+0x12300)
 #4 0x00007ff6495f825c llvm::DwarfCompileUnit::getUniqueID() const
/home/seli/build/src/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h:110:41
 #5 0x00007ff6495f81cd llvm::emitDWARF5AccelTable(llvm::AsmPrinter*,
llvm::AccelTable<llvm::DWARF5AccelTableData>&, llvm::DwarfDebug const&,
llvm::ArrayRef<std::unique_ptr<llvm::DwarfCompileUnit,
std::default_delete<llvm::DwarfCompileUnit> >
>)::$_3::operator()(llvm::DWARF5AccelTableData const&) const
/home/seli/build/src/llvm/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp:579:24
 #6 0x00007ff6495f8170 unsigned int llvm::function_ref<unsigned int
(llvm::DWARF5AccelTableData
const&)>::callback_fn<llvm::emitDWARF5AccelTable(llvm::AsmPrinter*,
llvm::AccelTable<llvm::DWARF5AccelTableData>&, llvm::DwarfDebug const&,
llvm::ArrayRef<std::unique_ptr<llvm::DwarfCompileUnit,
std::default_delete<llvm::DwarfCompileUnit> > >)::$_3>(long,
llvm::DWARF5AccelTableData const&)
/home/seli/build/src/llvm/llvm/include/llvm/ADT/STLExtras.h:113:5
 #7 0x00007ff6495fddac llvm::function_ref<unsigned int
(llvm::DWARF5AccelTableData const&)>::operator()(llvm::DWARF5AccelTableData
const&) const /home/seli/build/src/llvm/llvm/include/llvm/ADT/STLExtras.h:130:5
 #8 0x00007ff6495fdbd0 (anonymous
namespace)::Dwarf5AccelTableWriter<llvm::DWARF5AccelTableData>::emitEntry(llvm::DWARF5AccelTableData
const&) const
/home/seli/build/src/llvm/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp:486:21
 #9 0x00007ff6495fce41 (anonymous
namespace)::Dwarf5AccelTableWriter<llvm::DWARF5AccelTableData>::emitData()
const
/home/seli/build/src/llvm/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp:506:30
#10 0x00007ff6495ead29 (anonymous
namespace)::Dwarf5AccelTableWriter<llvm::DWARF5AccelTableData>::emit() const
/home/seli/build/src/llvm/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp:539:3
#11 0x00007ff6495ea462 llvm::emitDWARF5AccelTable(llvm::AsmPrinter*,
llvm::AccelTable<llvm::DWARF5AccelTableData>&, llvm::DwarfDebug const&,
llvm::ArrayRef<std::unique_ptr<llvm::DwarfCompileUnit,
std::default_delete<llvm::DwarfCompileUnit> > >)
/home/seli/build/src/llvm/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp:575:3
#12 0x00007ff649631905 llvm::DwarfDebug::endModule()
/home/seli/build/src/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1256:3

In the lambda in llvm::emitDWARF5AccelTable() the value returned by
"DD.lookupCU(CUDie)" is nullptr. Presumably some of the debug info is not
present because of -gmodules and the PCH used, but this code doesn't account
for such a case?

-- 
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/20191013/ce2e2804/attachment.html>


More information about the llvm-bugs mailing list