<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 - OpenMP schedule(dynamic): Assertion failure at kmp_dispatch.cpp(375)"
   href="https://bugs.llvm.org/show_bug.cgi?id=49583">49583</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>OpenMP schedule(dynamic): Assertion failure at kmp_dispatch.cpp(375)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </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>Runtime Library
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>kim.walisch@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24645" name="attach_24645" title="OpenMP test program to trigger the bug">attachment 24645</a> <a href="attachment.cgi?id=24645&action=edit" title="OpenMP test program to trigger the bug">[details]</a></span>
OpenMP test program to trigger the bug

Hi,

While investigation a serious performance issue in Clang's OpenMP library
(which I will report in another issue) when using a parallel for loop with
schedule(dynamic) I found a bug (see the attached main.cpp which reproduces the
bug). I was able to reproduce the bug on both Linux x64 and Apple macOS ARM64.

clang++-11 -O3 -fopenmp main.cpp -o omp-bug
./omp-bug

Assertion failure at kmp_dispatch.cpp(375): pr->u.p.th_steal_lock == __null.
Assertion failure at kmp_dispatch.cpp(375): pr->u.p.th_steal_lock == __null.
Assertion failure at kmp_dispatch.cpp(375): pr->u.p.th_steal_lock == __null.
Assertion failure at kmp_dispatch.cpp(375): pr->u.p.th_steal_lock == __null.
OMP: Error #13: Assertion failure at kmp_dispatch.cpp(375).
OMP: Hint Please submit a bug report with this message, compile and run
commands used, and machine configuration info including native compiler and
operating system versions. Faster response will be obtained by including all
program sources. For information on submitting this issue, please see
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a>.
OMP: Error #13: Assertion failure at kmp_dispatch.cpp(375).
OMP: Hint Please submit a bug report with this message, compile and run
commands used, and machine configuration info including native compiler and
operating system versions. Faster response will be obtained by including all
program sources. For information on submitting this issue, please see
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a>.
Aborted (core dumped)

Regards,
Kim Walisch</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>