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

            Bug ID: 43147
           Summary: LLD crashes on Rust generated code with ASan/libfuzzer
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedb...@nondot.org
          Reporter: manojgu...@google.com
                CC: lloz...@chromium.org, llvm-bugs@lists.llvm.org,
                    manojgu...@google.com, peter.sm...@linaro.org,
                    pe...@pcc.me.uk, r...@google.com, zhizh...@google.com

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::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
> >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::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::allocator<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::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::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::allocator<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::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<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:2696:12
 #9 0x00005631e80093c7 void
std::__merge_sort_with_buffer<__gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::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::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::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::allocator<lld::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::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::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::allocator<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::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::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::allocator<lld::elf::InputSection*> >
>, bool (*)(lld::elf::InputSection*,
lld::elf::InputSection*)>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::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::allocator<lld::elf::InputSection*> >&, bool (*)(lld::elf::InputSection*,
lld::elf::InputSection*)>(std::vector<lld::elf::InputSection*,
std::allocator<lld::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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to