[llvm-bugs] [Bug 37623] New: Segfault when emitting Dwarf V5 debug info
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue May 29 10:38:02 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=37623
Bug ID: 37623
Summary: Segfault when emitting Dwarf V5 debug info
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: MC
Assignee: unassignedbugs at nondot.org
Reporter: pirama at google.com
CC: llvm-bugs at lists.llvm.org
Created attachment 20356
--> https://bugs.llvm.org/attachment.cgi?id=20356&action=edit
Source and clang invocation to reproduce original crash
The following program crashes when emitting debug info in DWARF V5. The
following reduced case was found using CReduce. The original failing source
invocation as an attachment is also attached.
$ cat crash.cpp
#define a(...) template __VA_ARGS__;
template <class> class b {};
a(class b<char>)
# 1 ""
int c;
$ clang "-cc1" "-emit-obj" "-debug-info-kind=limited" "-dwarf-version=4"
crash.cpp
// no crash
$ clang "-cc1" "-emit-obj" "-debug-info-kind=limited" "-dwarf-version=5"
crash.cpp
Stack dump:
0. Program arguments: ../llvm-release/bin/clang -cc1 -emit-obj
-debug-info-kind=
limited -dwarf-version=5 crash.cpp
1. <eof> parser at end of file
2. Code generation
#0 0x0000000001ba3af4 PrintStackTraceSignalHandler(void*)
(../llvm-release/bin/clang+
0x1ba3af4)
#1 0x0000000001ba1c30 llvm::sys::RunSignalHandlers()
(../llvm-release/bin/clang+0x1ba
1c30)
#2 0x0000000001ba3ca2 SignalHandler(int) (../llvm-release/bin/clang+0x1ba3ca2)
#3 0x00007f7b231330c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#4 0x00007f7b21dbae0e (/lib/x86_64-linux-gnu/libc.so.6+0x128e0e)
#5 0x0000000001946af2 llvm::MCObjectStreamer::EmitBytes(llvm::StringRef)
(../llvm-rel
ease/bin/clang+0x1946af2)
#6 0x000000000193526b emitOneV5FileEntry(llvm::MCStreamer*, llvm::MCDwarfFile
const&,
bool, bool, llvm::Optional<llvm::MCDwarfLineStr>&)
(../llvm-release/bin/clang+0x1935
26b)
#7 0x0000000001935175
llvm::MCDwarfLineTableHeader::emitV5FileDirTables(llvm::MCStrea
mer*, llvm::Optional<llvm::MCDwarfLineStr>&) const
(../llvm-release/bin/clang+0x19351
75)
#8 0x0000000001934c27 llvm::MCDwarfLineTableHeader::Emit(llvm::MCStreamer*,
llvm::MCD
warfLineTableParams, llvm::ArrayRef<char>,
llvm::Optional<llvm::MCDwarfLineStr>&) con
st (../llvm-release/bin/clang+0x1934c27)
#9 0x00000000019343dd llvm::MCDwarfLineTable::EmitCU(llvm::MCObjectStreamer*,
llvm::M
CDwarfLineTableParams, llvm::Optional<llvm::MCDwarfLineStr>&) const
(../llvm-release/
bin/clang+0x19343dd)
#10 0x0000000001934362 llvm::MCDwarfLineTable::Emit(llvm::MCObjectStreamer*,
llvm::MC
DwarfLineTableParams) (../llvm-release/bin/clang+0x1934362)
#11 0x000000000194771f llvm::MCObjectStreamer::FinishImpl()
(../llvm-release/bin/clan
g+0x194771f)
#12 0x00000000021d4cd3 llvm::AsmPrinter::doFinalization(llvm::Module&)
(../llvm-relea
se/bin/clang+0x21d4cd3)
#13 0x000000000176dd63 llvm::FPPassManager::doFinalization(llvm::Module&)
(../llvm-re
lease/bin/clang+0x176dd63)
#14 0x000000000176e184 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(../llvm-rel
ease/bin/clang+0x176e184)
#15 0x0000000001d168c7 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::Hea
derSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions
const&, c
lang::LangOptions const&, llvm::DataLayout const&, llvm::Module*,
clang::BackendActio
n, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stre
am> >) (../llvm-release/bin/clang+0x1d168c7)
#16 0x00000000023edfb0
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContex
t&) (../llvm-release/bin/clang+0x23edfb0)
#17 0x0000000002a8da74 clang::ParseAST(clang::Sema&, bool, bool)
(../llvm-release/bin
/clang+0x2a8da74)
#18 0x000000000211bd9f clang::FrontendAction::Execute()
(../llvm-release/bin/clang+0x
211bd9f)
#19 0x00000000020caff8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(../llvm-release/bin/clang+0x20caff8)
#20 0x00000000021a04d3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (..
/llvm-release/bin/clang+0x21a04d3)
#21 0x00000000008ebf7b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (../
llvm-release/bin/clang+0x8ebf7b)
#22 0x00000000008ea651 main (../llvm-release/bin/clang+0x8ea651)
#23 0x00007f7b21cb22b1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#24 0x00000000008e7b3a _start (../llvm-release/bin/clang+0x8e7b3a)
Segmentation fault
--
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/20180529/1ba05b0d/attachment-0001.html>
More information about the llvm-bugs
mailing list