[llvm-bugs] [Bug 49312] New: [OpenMP] UB when hidden helper threads is 1

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 22 05:24:07 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49312

            Bug ID: 49312
           Summary: [OpenMP] UB when hidden helper threads is 1
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: rofirrim at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hi,

while investigating another issue, we found that the macro
`KMP_GTID_TO_SHADOW_GTID` is defined in `kmp.h` as follows

  #define KMP_GTID_TO_SHADOW_GTID(gtid)                  
    ((gtid) % (__kmp_hidden_helper_threads_num - 1) + 2) 

When there is only one helper thread the macro attempts to compute `(gtid % 0)
- 2`. Setting the environment variable `LIBOMP_NUM_HIDDEN_HELPER_THREADS` to
`1` should be enough to trigger this.

Perhaps using only one helper thread is not valid?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210222/75599d95/attachment.html>


More information about the llvm-bugs mailing list