[llvm-bugs] [Bug 25915] New: rL256003 breaks LTO with debug info

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 21 15:44:24 PST 2015


            Bug ID: 25915
           Summary: rL256003 breaks LTO with debug info
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: krasin at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider the following program:

$ cat lala.cc
const char lala[] = { 0 };

Let's compile it with -flto and -g, and link using Gold plugin:

$ /usr/local/google/home/krasin/src/llvm.org/release-build/bin/clang++ -flto -g
-fuse-ld=gold -o lala lala.cc
clang-3.8: error: unable to execute command: Segmentation fault (core dumped)
clang-3.8: error: linker command failed due to signal (use -v to see

Gold under gdb:

Program received signal SIGSEGV, Segmentation fault.
(anonymous namespace)::IRLinker::findNeededSubprograms
(this=this at entry=0x7fffffff6350, ValueMap=...) at
1196        for (const Metadata *Op : CU->getSubprograms()->operands()) {
(gdb) bt
#0  (anonymous namespace)::IRLinker::findNeededSubprograms
(this=this at entry=0x7fffffff6350, ValueMap=...) at
#1  0x00007ffff454e361 in linkNamedMDNodes (this=0x7fffffff6350) at
#2  run (this=0x7fffffff6350) at
#3  llvm::IRMover::move(llvm::Module&, llvm::ArrayRef<llvm::GlobalValue*>,
std::function<void (llvm::GlobalValue&, std::function<void
(llvm::GlobalValue&)>)>, llvm::DenseMap<unsigned int, llvm::MDNode*,
llvm::DenseMapInfo<unsigned int>, llvm::detail::DenseMapPair<unsigned int,
llvm::MDNode*> >*, bool) (this=this at entry=0x7fffffff6a30, Src=...,
ValuesToLink=..., AddLazyFor=..., ValIDToTempMDMap=ValIDToTempMDMap at entry=0x0,
IsMetadataLinkingPostpass=IsMetadataLinkingPostpass at entry=false) at
#4  0x00007ffff3be433d in allSymbolsReadHook (ApiFile=ApiFile at entry=0x0) at
#5  0x00007ffff3be66ab in all_symbols_read_hook () at
#6  0x00000000004d5aef in ?? ()
#7  0x00000000004d5c24 in ?? ()
#8  0x0000000000516c65 in ?? ()
#9  0x0000000000516fca in ?? ()
#10 0x0000000000404f32 in ?? ()
#11 0x00007ffff7313ec5 in __libc_start_main (main=0x404a80, argc=37,
argv=0x7fffffffd708, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffd6f8) at libc-start.c:287
#12 0x0000000000405e41 in ?? ()

This is introduced in http://reviews.llvm.org/rL256003 and the immediate
problem is in the line IRMover.cpp:1197 that makes an assumption that
CU->getSubprograms() will always return a non-NULL value.

This was initially discovered on one of Chromium buildbots, see

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/20151221/47e30330/attachment.html>

More information about the llvm-bugs mailing list