<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 --- - UB when shifting at llvm/lib/Fuzzer/FuzzerTracePC.cpp:73"
   href="https://llvm.org/bugs/show_bug.cgi?id=31457">31457</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>UB when shifting at llvm/lib/Fuzzer/FuzzerTracePC.cpp:73
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ttaubert@mozilla.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>../../fuzz/libFuzzer/FuzzerTracePC.cpp:73:33: runtime error: shift exponent
8832 is too large for 64-bit type 'uint64_t' (aka 'unsigned long')
    #0 0x540e84 in fuzzer::TracePC::FinalizeTrace(fuzzer::InputCorpus*,
unsigned long, bool)
/home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerTracePC.cpp:73:33
    #1 0x52abd3 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long)
/home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:475:32
    #2 0x529ec4 in fuzzer::Fuzzer::RunOne(std::vector<unsigned char,
std::allocator<unsigned char> > const&)
/home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerInternal.h:113:41
    #3 0x529ec4 in
fuzzer::Fuzzer::ShuffleAndMinimize(std::vector<std::vector<unsigned char,
std::allocator<unsigned char> >, std::allocator<std::vector<unsigned char,
std::allocator<unsigned char> > > >*)
/home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:451
    #4 0x5142b2 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char
const*, unsigned long))
/home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerDriver.cpp:523:6
    #5 0x508724 in main /home/worker/nss/out/Debug/../../fuzz/nssfuzz.cc:151:10
    #6 0x7faea9fb082f in __libc_start_main
/build/glibc-t3gR2i/glibc-2.23/csu/../csu/libc-start.c:291
    #7 0x41ee98 in _start (/home/worker/dist/Debug/bin/nssfuzz+0x41ee98)

SUMMARY: AddressSanitizer: undefined-behavior
../../fuzz/libFuzzer/FuzzerTracePC.cpp:73:33 in

Here's where it happens:

<span class="quote">> for (size_t Idx = 0; Idx < N; Idx += Step) {
>   uint64_t Bundle = *reinterpret_cast<uint64_t*>(&Counters[Idx]);
>   if (!Bundle) continue;
>   for (size_t i = Idx; i < Idx + Step; i++) {
>     uint8_t Counter = (Bundle >> (i * 8)) & 0xff;</span >

I'm not sure what the right fix would be, I don't understand the code well
enough to propose a fix.</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>