<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 - Race condition in libomptarget"
   href="https://bugs.llvm.org/show_bug.cgi?id=49940">49940</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Race condition in libomptarget
          </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>herve@ic.unicamp.br
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The test "llvm-project/openmp/libomptarget/test/offloading/<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Segfault when running code with target nowait compiled for x86 offloading"
   href="show_bug.cgi?id=49334">bug49334</a>.cpp" fails
aleatory with both cuda and x86_64 plugins, most probably because of a race
condition within the device-agnostic part of libomptarget. This test is
implementing a block-based matrix multiplication that has the particularity to
create multiple asynchronous offloaded kernels (omp target nowait) that can be
executed in parallel (thus the race condition).

The issue can be reproduced by executing the test multiple times: 

- For CUDA plugin
clang++ -O3 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda
./llvm-project/openmp/libomptarget/test/offloading/<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Segfault when running code with target nowait compiled for x86 offloading"
   href="show_bug.cgi?id=49334">bug49334</a>.cpp -o
blockmatmul-gpu
for i in {1..100}; do ./blockmatmul-gpu || break; done

- For x86 plugin 
clang++ -O3 -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu
./llvm-project/openmp/libomptarget/test/offloading/<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Segfault when running code with target nowait compiled for x86 offloading"
   href="show_bug.cgi?id=49334">bug49334</a>.cpp -o
blockmatmul-cpu
for i in {1..100}; do ./blockmatmul-cpu || break; done

The issue happens with the every recent versions of Clang (current development
version, v12.x, v11.x)</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>