<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/mac crashes doing ICF when targeting arm64"
   href="https://bugs.llvm.org/show_bug.cgi?id=51999">51999</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld/mac crashes doing ICF when targeting arm64
          </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>MachO
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>gkm@fb.com, jezreel@gmail.com, llvm-bugs@lists.llvm.org, smeenai@fb.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Download attachment from
<a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1253924">https://bugs.chromium.org/p/chromium/issues/detail?id=1253924</a> <a href="show_bug.cgi?id=51999#c0">comment 0</a> (direct
link:
<a href="https://bugs.chromium.org/p/chromium/issues/attachment?aid=521657&signed_aid=FyD9wPUBvRJ6-Dw40gqlFQ">https://bugs.chromium.org/p/chromium/issues/attachment?aid=521657&signed_aid=FyD9wPUBvRJ6-Dw40gqlFQ</a>==)

$ tar xzf arm64.tar.gz 
$ cd arm64/
$ ~/src/llvm-project/out/gn/bin/ld64.lld @response.txt

With --threads=1, the stack is a bit clearer, so here's the relevant bit of the
stack with that added:

#10 0x00007f97988dc0ad std::__throw_out_of_range(char const*)
/build/gcc-11-vdZbHt/gcc-11-11.2.0/build/x86_64-linux-gnu/libstdc++-v3/src/c++11/../../../../../src/libstdc++-v3/src/c++11/functexcept.cc:86:5
#11 0x00000000018c0bb9 std::__detail::_Map_base<std::pair<unsigned long,
unsigned long>, std::pair<std::pair<unsigned long, unsigned long> const,
unsigned long>, std::allocator<std::pair<std::pair<unsigned long, unsigned
long> const, unsigned long> >, std::__detail::_Select1st,
std::equal_to<std::pair<unsigned long, unsigned long> >,
lld::macho::WordLiteralSection::Hasher<std::pair<unsigned long, unsigned long>
<span class="quote">>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash,</span >
std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true,
false, true>, true>::at(std::pair<unsigned long, unsigned long> const&) const
(/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld+0x18c0bb9)
#12 0x00000000018c052f lld::macho::WordLiteralInputSection::getOffset(unsigned
long) const
(/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld+0x18c052f)
#13 0x00000000018a7ed3 equalsConstant(lld::macho::ConcatInputSection const*,
lld::macho::ConcatInputSection const*) ICF.cpp:0:0
#14 0x00000000018a6397 ICF::segregate(unsigned long, unsigned long,
std::function<bool (lld::macho::ConcatInputSection const*,
lld::macho::ConcatInputSection const*)>)
(/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld+0x18a6397)
#15 0x00000000018a7cfb std::_Function_handler<void (unsigned long, unsigned
long), ICF::run()::$_4>::_M_invoke(std::_Any_data const&, unsigned long&&,
unsigned long&&) ICF.cpp:0:0
#16 0x00000000018a588e ICF::forEachClass(std::function<void (unsigned long,
unsigned long)>)
(/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld+0x18a588e)
#17 0x00000000018a5f0a ICF::run()
(/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld+0x18a5f0a)
#18 0x00000000018a696f lld::macho::foldIdenticalSections()
(/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld+0x18a696f)
#19 0x000000000188ed65 lld::macho::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&, llvm::raw_ostream&)
(/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld+0x188ed65)</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>