[llvm-bugs] [Bug 32004] New: lld crashes on -flto=thin -fsanitize=address (assertion failure)

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Feb 18 06:56:19 PST 2017


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

            Bug ID: 32004
           Summary: lld crashes on -flto=thin -fsanitize=address
                    (assertion failure)
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: matthias.krueger at famsik.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 18007
  --> https://bugs.llvm.org/attachment.cgi?id=18007&action=edit
the log which is also inlined in the ticket

git clone https://github.com/danmar/cppcheck
git checkout 774a897
make CXX=path/to/clang-dev CXXFLAGS="-std=c++0x -fuse-ld=path/to/lld -flto=thin
-fsanitize=address" dmake


I can reproduce using llvm/clang built today and lld with assertions + asan +
ubsan.
I found this with a non-debug build of lld, it just segfaulted.

/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang++ -std=c++0x
-fuse-ld=/home/matthias/LLVM/LLVM_assert/stage_1/build/bin/ld.lld -flto=thin
-fsanitize=address -o dmake tools/dmake.o cli/filelister.o lib/pathmatch.o
lib/path.o -Ilib 
/home/matthias/LLVM/LLVM_assert/stage_1/build/bin/ld.lld: warning: duplicate
symbol '__sanitizer_print_memory_profile' in version script
ld.lld:
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4549:
std::pair<GlobalValue::GUID, GlobalValue::GUID> (anonymous
namespace)::ModuleSummaryIndexBitcodeReader::getGUIDFromValueId(unsigned int):
Assertion `VGI != ValueIdToCallGraphGUIDMap.end()' failed.
#0 0x00000000004e6521 backtrace
/home/matthias/LLVM/LLVM_3_9/stage_2/llvm/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:3553:13
#1 0x00000000005be193 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Support/Unix/Signals.inc:402:13
#2 0x00000000005bb498 llvm::sys::RunSignalHandlers()
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Support/Signals.cpp:44:16
#3 0x00000000005bec0b SignalHandler(int)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Support/Unix/Signals.inc:246:3
#4 0x00007fa4c22bb5c0 __restore_rt (/lib64/libpthread.so.0+0x115c0)
#5 0x00007fa4c0e2391f __GI_raise
/usr/src/debug/glibc-2.24-33-ge9e69e4/signal/../sysdeps/unix/sysv/linux/raise.c:58:0
#6 0x00007fa4c0e2551a __GI_abort
/usr/src/debug/glibc-2.24-33-ge9e69e4/stdlib/abort.c:91:0
#7 0x00007fa4c0e1bda7 __assert_fail_base
/usr/src/debug/glibc-2.24-33-ge9e69e4/assert/assert.c:92:0
#8 0x00007fa4c0e1be52 (/lib64/libc.so.6+0x2de52)
#9 0x00000000047ee0bb (anonymous
namespace)::ModuleSummaryIndexBitcodeReader::getGUIDFromValueId(unsigned int)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4550:15
#10 0x00000000047ed951 (anonymous
namespace)::ModuleSummaryIndexBitcodeReader::makeRefList(llvm::ArrayRef<unsigned
long>)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4801:19
#11 0x00000000047e90c4 (anonymous
namespace)::ModuleSummaryIndexBitcodeReader::parseEntireSummary(llvm::StringRef)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4919:34
#12 0x00000000047aebcb (anonymous
namespace)::ModuleSummaryIndexBitcodeReader::parseModule(llvm::StringRef)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4706:25
#13 0x00000000047ade65 llvm::BitcodeModule::getSummary()
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:5321:13
#14 0x00000000022cc56a llvm::lto::LTO::addThinLTO(llvm::BitcodeModule,
llvm::Module&, llvm::iterator_range<llvm::lto::InputFile::symbol_iterator>,
llvm::lto::SymbolResolution const*&, llvm::lto::SymbolResolution const*)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/LTO/LTO.cpp:558:8
#15 0x00000000022cc1c1 llvm::lto::LTO::addModule(llvm::lto::InputFile&,
llvm::lto::InputFile::InputModule&, llvm::lto::SymbolResolution const*&,
llvm::lto::SymbolResolution const*)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/LTO/LTO.cpp:444:12
#16 0x00000000022cb521
llvm::lto::LTO::add(std::unique_ptr<llvm::lto::InputFile,
std::default_delete<llvm::lto::InputFile> >,
llvm::ArrayRef<llvm::lto::SymbolResolution>)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/lib/LTO/LTO.cpp:417:21
#17 0x00000000009eb001 lld::elf::BitcodeCompiler::add(lld::elf::BitcodeFile&)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/tools/lld/ELF/LTO.cpp:135:3
#18 0x0000000000b9378b
lld::elf::SymbolTable<llvm::object::ELFType<(llvm::support::endianness)1, true>
>::addCombinedLTOObject()
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/tools/lld/ELF/SymbolTable.cpp:117:23
#19 0x0000000000872ce4 void
lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)1,
true> >(llvm::opt::InputArgList&)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/tools/lld/ELF/Driver.cpp:836:7
#20 0x000000000085ce76 lld::elf::LinkerDriver::main(llvm::ArrayRef<char
const*>, bool)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/tools/lld/ELF/Driver.cpp:340:5
#21 0x000000000085c400 lld::elf::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&)
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/tools/lld/ELF/Driver.cpp:79:3
#22 0x0000000000570cf1 main
/home/matthias/LLVM/LLVM_assert/stage_1/llvm/tools/lld/tools/lld/lld.cpp:104:13
#23 0x00007fa4c0e0e401 __libc_start_main
/usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:323:0
#24 0x00000000004a1aca _start
(/home/matthias/LLVM/LLVM_assert/stage_1/build/bin/ld.lld+0x4a1aca)
Stack dump:
0.      Program arguments:
/home/matthias/LLVM/LLVM_assert/stage_1/build/bin/ld.lld --hash-style=gnu
--no-add-needed --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -o dmake
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/crtbegin.o
-L/usr/lib/gcc/x86_64-redhat-linux/6.3.1
-L/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../..
-L/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/../lib -L/lib -L/usr/lib
-plugin /home/matthias/LLVM/LLVM_dev/stage_2/build/bin/../lib/LLVMgold.so
-plugin-opt=mcpu=x86-64 -plugin-opt=thinlto -whole-archive
/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/../lib/clang/5.0.0/lib/linux/libclang_rt.asan-x86_64.a
-no-whole-archive
--dynamic-list=/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/../lib/clang/5.0.0/lib/linux/libclang_rt.asan-x86_64.a.syms
-whole-archive
/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/../lib/clang/5.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a
-no-whole-archive
--dynamic-list=/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/../lib/clang/5.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a.syms
tools/dmake.o cli/filelister.o lib/pathmatch.o lib/path.o -lstdc++ -lm
--no-as-needed -lpthread -lrt -lm -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/crtn.o 
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: linker command failed due to signal (use -v to see
invocation)
Makefile:269: recipe for target 'dmake' failed
make: *** [dmake] Error 254

LLD @ R295507  /   92e7562ea50d108e6ad699d3d2fa5741f64f0460
LLVM @ R295543  / 47cf6aadec0bc58d970052092ee85a69b3625792
clang @ R295541  / 0b7608a93efca9e8a3ea17f02e13b9acbaa3ce86

-- 
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/20170218/f91c9616/attachment.html>


More information about the llvm-bugs mailing list