<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLD crashes on Rust generated code with ASan/libfuzzer"
   href="https://bugs.llvm.org/show_bug.cgi?id=43147">43147</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD crashes on Rust generated code with ASan/libfuzzer
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>manojgupta@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llozano@chromium.org, llvm-bugs@lists.llvm.org, manojgupta@google.com, peter.smith@linaro.org, peter@pcc.me.uk, ruiu@google.com, zhizhouy@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We are building fuzzers for rust code in Chrome OS.

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

Reproducer:
<a href="https://drive.google.com/drive/folders/1hX7MHQGIocdCx2oraKqSbCohXYs8QAbS?usp=sharing">https://drive.google.com/drive/folders/1hX7MHQGIocdCx2oraKqSbCohXYs8QAbS?usp=sharing</a>

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*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">> >(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>) /usr/include/c++/8/bits/predefined_ops.h:143:49</span >
 #7 0x00005631e8009032 void
std::__insertion_sort<__gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(lld::elf::InputSection*,</span >
lld::elf::InputSection*)>
<span class="quote">>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(lld::elf::InputSection*,</span >
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*> >
<span class="quote">>, long, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(lld::elf::InputSection*,</span >
lld::elf::InputSection*)>
<span class="quote">>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, long, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(lld::elf::InputSection*,</span >
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*> >
<span class="quote">>, lld::elf::InputSection**, __gnu_cxx::__ops::_Iter_comp_iter<bool</span >
(*)(lld::elf::InputSection*, lld::elf::InputSection*)>
<span class="quote">>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, lld::elf::InputSection**, __gnu_cxx::__ops::_Iter_comp_iter<bool</span >
(*)(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*> >
<span class="quote">>, lld::elf::InputSection**, long, __gnu_cxx::__ops::_Iter_comp_iter<bool</span >
(*)(lld::elf::InputSection*, lld::elf::InputSection*)>
<span class="quote">>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, lld::elf::InputSection**, long, __gnu_cxx::__ops::_Iter_comp_iter<bool</span >
(*)(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*> >
<span class="quote">>, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(lld::elf::InputSection*,</span >
lld::elf::InputSection*)>
<span class="quote">>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(lld::elf::InputSection*,</span >
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*> >
<span class="quote">>, bool (*)(lld::elf::InputSection*,</span >
lld::elf::InputSection*)>(__gnu_cxx::__normal_iterator<lld::elf::InputSection**,
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, __gnu_cxx::__normal_iterator<lld::elf::InputSection**,</span >
std::vector<lld::elf::InputSection*, std::allocator<lld::elf::InputSection*> >
<span class="quote">>, bool (*)(lld::elf::InputSection*, lld::elf::InputSection*))</span >
/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>
<span class="quote">>::resolveShfLinkOrder()</span >
/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>
<span class="quote">>::finalizeSections()</span >
/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>
<span class="quote">>::run()</span >
/usr/local/google/home/manojgupta/llvm_monorepo/llvm-project/lld/ELF/Writer.cpp:581:3</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>