<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 - libomp 12.0.0 introduces assertion failure when running OpenMP from a background thread"
   href="https://bugs.llvm.org/show_bug.cgi?id=50579">50579</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>libomp 12.0.0 introduces assertion failure when running OpenMP from a background thread
          </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>MacOS X
          </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>nathan.collins@kdab.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=24909" name="attach_24909" title="Minimum working example">attachment 24909</a> <a href="attachment.cgi?id=24909&action=edit" title="Minimum working example">[details]</a></span>
Minimum working example

Overview:
Our application runs OpenMP from a background thread and multiple threads may
end up doing that. This has worked fine using OpemMP 11.0.0 from homebrew.
However, upgrading to OpenMP 12.0.0 has introduced OMP: Error #13: Assertion
failure at kmp_runtime.cpp(3689).

Steps to reproduce:
I have attached a minimum working example.

To ease switching between OpenMP versions using brew I performed the following
steps:
$ brew unlink libomp
$ cp -R /usr/local/Cellar/libomp /usr/local/Cellar/<a href="mailto:libomp@12.0.0">libomp@12.0.0</a>
$ mv /usr/local/Cellar/libomp /usr/local/Cellar/<a href="mailto:libomp@11.0.0">libomp@11.0.0</a>
$ rm -r /usr/local/Cellar/<a href="mailto:libomp@12.0.0">libomp@12.0.0</a>/11.0.0
$ rm -r /usr/local/Cellar/<a href="mailto:libomp@11.0.0">libomp@11.0.0</a>/12.0.0
$ brew link <a href="mailto:libomp@11.0.0">libomp@11.0.0</a>

Compiling simply with:
$ tar xvf nested-openmp.tgz && cd nested-openmp
$ mkdir build && cd build
$ cmake ..
$ make

Running with <a href="mailto:libomp@11.0.0">libomp@11.0.0</a> cause no issues. Switching results in the attached
crash
$ ./nested-openmp
$ brew unlink <a href="mailto:libomp@11.0.0">libomp@11.0.0</a> && brew link <a href="mailto:libomp@12.0.0">libomp@12.0.0</a>
$ ./nested-openmp
OMP: Error #13: Assertion failure at kmp_runtime.cpp(3689).
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>.
[1]    15285 abort      ./nested-openmp
$ brew unlink <a href="mailto:libomp@11.0.0">libomp@11.0.0</a> &&</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>