<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - RelativeRel is used, but not initialized for AMDGPU"
   href="https://llvm.org/bugs/show_bug.cgi?id=30227">30227</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>RelativeRel is used, but not initialized for AMDGPU
          </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>normal
          </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>krasin@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As of now, MemorySanitizer bots are red, because Target->RelativeRel is used
but not initialized for AMDGPU arch:
<a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15968">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15968</a>

==28645==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7b66c5 in
lld::elf::RelocationSection<llvm::object::ELFType<(llvm::support::endianness)1,
true>
<span class="quote">>::addReloc(lld::elf::DynamicReloc<llvm::object::ELFType<(llvm::support::endianness)1,</span >
true> > const&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/OutputSections.cpp:357:7
    #1 0x9c38e4 in operator()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Relocations.cpp:532:25
    #2 0x9c38e4 in
scanRelocs<llvm::object::ELFType<llvm::support::endianness::little, true>,
llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::support::endianness::little,
true>, true> >
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Relocations.cpp:683
    #3 0x9c38e4 in void
lld::elf::scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1,
true>
<span class="quote">>(lld::elf::InputSectionBase<llvm::object::ELFType<(llvm::support::endianness)1,</span >
true> >&, llvm::object::ELFType<(llvm::support::endianness)1, true>::Shdr
const&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Relocations.cpp:696
    #4 0x96157c in operator()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/libcxx_build_msan/include/c++/v1/functional:1897:12
    #5 0x96157c in (anonymous
namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true>
<span class="quote">>::forEachRelSec(std::__1::function<void</span >
(lld::elf::InputSectionBase<llvm::object::ELFType<(llvm::support::endianness)1,
true> >&,
llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<(llvm::support::endianness)1,
true> > const&)>)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Writer.cpp:666
    #6 0x938123 in finalizeSections
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Writer.cpp:735:3
    #7 0x938123 in (anonymous
namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true>
<span class="quote">>::run()</span >
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Writer.cpp:260
    #8 0x93382d in void
lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true>
<span class="quote">>()</span >
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Writer.cpp:228:18
    #9 0x632244 in void
lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)1,
true> >(llvm::opt::InputArgList&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Driver.cpp:645:3
    #10 0x61e3ec in lld::elf::LinkerDriver::main(llvm::ArrayRef<char const*>)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Driver.cpp:308:5
    #11 0x61ba32 in lld::elf::link(llvm::ArrayRef<char const*>,
llvm::raw_ostream&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/Driver.cpp:52:11
    #12 0x54d8ee in main
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/tools/lld/lld.cpp:106:13
    #13 0x7f96a4537f44 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
    #14 0x4ca136 in _start
(/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/lld+0x4ca136)

SUMMARY: MemorySanitizer: use-of-uninitialized-value
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/ELF/OutputSections.cpp:357:7
in
lld::elf::RelocationSection<llvm::object::ELFType<(llvm::support::endianness)1,
true>
<span class="quote">>::addReloc(lld::elf::DynamicReloc<llvm::object::ELFType<(llvm::support::endianness)1,</span >
true> > const&)

The detected use was added in <a href="https://reviews.llvm.org/rL280210">https://reviews.llvm.org/rL280210</a> but it's just
the CL that exposed the issue, not the one that created it. In fact, we have
more uses of RelativeRel in the code base, they just don't run for AMDGPU under
MemorySanitizer => they are not detected.

We should either don't use this field on AMDGPU, or initialize it to a sane
value.</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>