-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closed as not planned
Closed as not planned
Copy link
Labels
LTOLink time optimization (regular/full LTO or ThinLTO)Link time optimization (regular/full LTO or ThinLTO)crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]invalidResolved as invalid, i.e. not a bugResolved as invalid, i.e. not a bugllvmUmbrella label for LLVM issuesUmbrella label for LLVM issues
Description
While trying to build mapbox/protozero, we encountered this issue with clang 14.0.0-++20220108064110+2cafbcb560d9-1~exp1~20220108184211.222
via AFL++ and we believe this to be an issue with Clang itself and not the AFL++ wrapper:
Stack dump:
0. Program arguments: /usr/lib/llvm-14/bin/ld.lld -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_d6afd /usr/lib/x8
6_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_6
4-linux-gnu -L/usr/lib/llvm-14/bin/../lib -L/lib -L/usr/lib -plugin-opt=mcpu=x86-64 -plugin-opt=O3 -plugin-opt=legacy-pass-manager --allow-multiple-definition -mllvm=-load=/usr/local/bin/../
lib/afl/SanitizerCoverageLTO.so CMakeFiles/cmTC_d6afd.dir/testCCompiler.c.o /usr/local/bin/../lib/afl/afl-compiler-rt.o /usr/local/bin/../lib/afl/afl-llvm-rt-lto.o --dynamic-list=/usr/local/
bin/../lib/afl/dynamic_list.txt -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/11/crtend.o /usr/lib/x86_64-linux-gnu/crtn
.o
1. Running pass 'sancov' on module 'ld-temp.o'.
#0 0x00007f7028b22be1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe20be1)
#1 0x00007f7028b2092e llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe1e92e)
#2 0x00007f7028b2311b (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe2111b)
#3 0x00007f702e54a980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#4 0x00007f7023b5d93d llvm::Value::getType() const /usr/lib/llvm-14/include/llvm/IR/Value.h:255:34
#5 0x00007f7023b5d93d (anonymous namespace)::ModuleSanitizerCoverage::instrumentFunction(llvm::Function&, llvm::function_ref<llvm::DominatorTree const* (llvm::Function&)>, llvm::functio
n_ref<llvm::PostDominatorTree const* (llvm::Function&)>) /root/AFLplusplus/instrumentation/SanitizerCoverageLTO.so.cc:1311:36
#6 0x00007f7023b5d93d (anonymous namespace)::ModuleSanitizerCoverage::instrumentModule(llvm::Module&, llvm::function_ref<llvm::DominatorTree const* (llvm::Function&)>, llvm::function_re
f<llvm::PostDominatorTree const* (llvm::Function&)>) /root/AFLplusplus/instrumentation/SanitizerCoverageLTO.so.cc:1005:5
#7 0x00007f7023b63a0d (anonymous namespace)::ModuleSanitizerCoverageLegacyPass::runOnModule(llvm::Module&) /root/AFLplusplus/instrumentation/SanitizerCoverageLTO.so.cc:316:25
#8 0x00007f7028c63ee6 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xf61ee6)
#9 0x00007f702a01d376 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::
vector<unsigned char, std::allocator<unsigned char> > const&) (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x231b376)
#10 0x00007f702a01f707 llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream> > > (unsigned int)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x231d707)
#11 0x00007f702a014395 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream> > > (unsigned int)>) (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x2312395)
#12 0x00007f702a013ba6 llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream> > > (unsigned int)>, std::function<llvm::Expected<std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream> > > (unsigned int)> > (unsigned int, llvm::StringRef)>) (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x2311ba6)
#13 0x00000000005fb398 lld::elf::BitcodeCompiler::compile() (/usr/lib/llvm-14/bin/ld.lld+0x5fb398)
#14 0x000000000058ad86 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::support::endianness)1, true> >(bool) (/usr/lib/llvm-14/bin/ld.lld+0x58ad86)
#15 0x0000000000576135 void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::opt::InputArgList&) (/usr/lib/llvm-14/bin/ld.lld+0x576135)
#16 0x00000000005655ca lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/lib/llvm-14/bin/ld.lld+0x5655ca)
#17 0x000000000056376f lld::elf::link(llvm::ArrayRef<char const*>, bool, llvm::raw_ostream&, llvm::raw_ostream&) (/usr/lib/llvm-14/bin/ld.lld+0x56376f)
#18 0x00000000004a48a1 (/usr/lib/llvm-14/bin/ld.lld+0x4a48a1)
#19 0x00000000004a419f main (/usr/lib/llvm-14/bin/ld.lld+0x4a419f)
#20 0x00007f7026f6fbf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#21 0x00000000004a3cea _start (/usr/lib/llvm-14/bin/ld.lld+0x4a3cea)
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: linker command failed due to signal (use -v to see invocation)
CMakeFiles/cmTC_d6afd.dir/build.make:97: recipe for target 'cmTC_d6afd' failed
make[1]: *** [cmTC_d6afd] Error 254
make[1]: Leaving directory '/root/protozero/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_d6afd/fast' failed
make: *** [cmTC_d6afd/fast] Error 2
Command line: git clone https://github.com/mapbox/protozero && cd protozero && CC=afl-clang-lto CXX=afl-clang-lto++ AFL_USE_ASAN=1 cmake ../ && make -j
Environment
Ubuntu clang version 14.0.0-++20220108064110+2cafbcb560d9-1~exp1~20220108184211.222
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
llvm-config --version
14.0.0
Linux ams3-01 4.15.0-166-generic #174-Ubuntu SMP Wed Dec 8 19:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Metadata
Metadata
Assignees
Labels
LTOLink time optimization (regular/full LTO or ThinLTO)Link time optimization (regular/full LTO or ThinLTO)crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]invalidResolved as invalid, i.e. not a bugResolved as invalid, i.e. not a bugllvmUmbrella label for LLVM issuesUmbrella label for LLVM issues