Skip to content

LLD crashes on Rust generated code with ASan/libfuzzer #42492

@m-gupta

Description

@m-gupta
Bugzilla Link 43147
Resolution FIXED
Resolved on Jan 26, 2020 13:21
Version unspecified
OS Linux
Blocks #43900
CC @MaskRay,@kcc,@LebedevRI,@lalozano,@m-gupta,@morehouse,@pcc,@rui314,@smithp35

Extended Description

We are building fuzzers for rust code in Chrome OS.

When switching to lld for linking, lld crashes when linking rust fuzzers.

Reproducer:
https://drive.google.com/drive/folders/1hX7MHQGIocdCx2oraKqSbCohXYs8QAbS?usp=sharing

ld.lld @​response.txt
Stack dump:
0. Program arguments: ../bin/ld.lld @​response.txt

#​0 0x00005631e7cf2390 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/llvm/lib/Support/Unix/Signals.inc:533:22
#​1 0x00005631e7cf2423 PrintStackTraceSignalHandler(void*) /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/llvm/lib/Support/Unix/Signals.inc:594:1
#​2 0x00005631e7cf05bd llvm::sys::RunSignalHandlers() /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/llvm/lib/Support/Signals.cpp:68:20
#​3 0x00005631e7cf1e0c SignalHandler(int) /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/llvm/lib/Support/Unix/Signals.inc:385:1
#​4 0x00007f08bec233a0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
#​5 0x00005631e7fbc6f2 compareByFilePosition(lld::elf::InputSection*, lld::elf::InputSection*) /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/lld/ELF/Writer.cpp:1530:18
#​6 0x00005631e800911a bool __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)>::operator()<__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > > >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >) /usr/include/c++/8/bits/predefined_ops.h:143:49
#​7 0x00005631e8009032 void std::__insertion_sort<__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)> >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)>) /usr/include/c++/8/bits/stl_algo.h:1847:4
#​8 0x00005631e800a461 void std::__chunk_insertion_sort<__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, long, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)> >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, long, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)>) /usr/include/c++/8/bits/stl_algo.h:2696:12
#​9 0x00005631e80093c7 void std::__merge_sort_with_buffer<__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, lld::elf::InputSection**, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)> >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, lld::elf::InputSection**, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)>) /usr/include/c++/8/bits/stl_algo.h:2718:26
#​10 0x00005631e8007c63 void std::__stable_sort_adaptive<__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, lld::elf::InputSection**, long, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)> >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, lld::elf::InputSection**, long, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)>) /usr/include/c++/8/bits/stl_algo.h:2753:25
#​11 0x00005631e8005bf5 void std::__stable_sort<__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)> >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__ops::_Iter_comp_iter<bool ()(lld::elf::InputSection, lld::elf::InputSection*)>) /usr/include/c++/8/bits/stl_algo.h:5001:15
#​12 0x00005631e8000069 void std::stable_sort<__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, bool ()(lld::elf::InputSection, lld::elf::InputSection*)>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, __gnu_cxx::__normal_iterator<lld::elf::InputSection**, std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* > >, bool ()(lld::elf::InputSection, lld::elf::InputSection*)) /usr/include/c++/8/bits/stl_algo.h:5077:5
#​13 0x00005631e7ff91fe void llvm::stable_sort<std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* >&, bool ()(lld::elf::InputSection, lld::elf::InputSection*)>(std::vector<lld::elf::InputSection*, std::allocatorlld::elf::InputSection* >&, bool ()(lld::elf::InputSection, lld::elf::InputSection*)) /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1323:1
#​14 0x00005631e7fdd583 (anonymous namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true> >::resolveShfLinkOrder() /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/lld/ELF/Writer.cpp:1560:14
#​15 0x00005631e7fce0f2 (anonymous namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true> >::finalizeSections() /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/lld/ELF/Writer.cpp:1930:3
#​16 0x00005631e7fbf59c (anonymous namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true> >::run() /usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/lld/ELF/Writer.cpp:581:3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions