<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 - Segmentation fault: OpenMP critical hint(omp_sync_hint_uncontended):"
   href="https://bugs.llvm.org/show_bug.cgi?id=49613">49613</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segmentation fault: OpenMP critical hint(omp_sync_hint_uncontended):
          </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>enhancement
          </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=24654" name="attach_24654" title="Bash script that reproduces the segmentation fault">attachment 24654</a> <a href="attachment.cgi?id=24654&action=edit" title="Bash script that reproduces the segmentation fault">[details]</a></span>
Bash script that reproduces the segmentation fault

Hi,

While trying out the omp_sync_hint_uncontended synchronization hint with a
critical section I have hit a segmentation fault (Clang 11, Ubuntu 20.04 x64,
Intel i7-6700 CPU). With another synchronization hint such as
omp_sync_hint_contended or without any synchronization hint there is no
segmentation fault.

The attached crash-omp_sync_hint_uncontended.sh bash script clones my
primecount OpenMP project, changes the critical sections in the file
src/gourdon/AC.cpp to use the omp_sync_hint_uncontended synchronization hint,
builds the primecount program using clang++-11 (hardcoded in the bash script)
and then runs the program which immediately causes the segmentation fault:

$ ./crash-omp_sync_hint_uncontended.sh
./crash-omp_sync_hint_uncontended.sh: line 13: 71249 Segmentation fault     
(core dumped) ./primecount 1e15 --AC

I have also run the primecount binary using valgrind which gives a stack trace
of where the segmentation fault happened. I have attached the valgrind output
(Segmentation-fault.txt) to this bug report.

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>